I’ve added the diet-asf repo.

And even made an issue for it…

@tehn, you can downgrade my membership of monome back to member now

done, but i’ve changed member perms to have read/write, so you have authority to merge (i think, if i did it right)

I was going to write some longer comments about submodules, and I can still do if needed. Instead I’ve got 2 links that might be helpful, the Git Book chaper on submodules, and this blog post which goes in to the internals a bit (it is quite old though). Now onto the brain dump…

They key thing to take away is that there is a difference between the source URL to the submodule and the stored commit hash of the submodule. The commit hash is stored in the Git history, it does not care what the source URL is. Git is distributed after all!

The URL is stored in the .gitmodules file, and should always be https://github.com/monome/libavr32.git unless you know what you are doing. Don’t commit a change that modifies that. The URL in .gitmodules is just the initial checkout URL. If you want to change the origin URL for the submodule for a local copy just:

cd libavr32
git remote set-url origin git@github.com:samdoshi/libavr32.git
# also a good idea to set an upstream remote
git remote add upstream git@github.com:monome/libavr32.git

Now you can push, pull and fetch to your own GitHub account. (There are other ways to do this too… I think.) To revert to the .gitmodules URL, do a git submodule sync.

If you want to update the commit that the parent repo points to, change the checked out version of libavr32 and commit the libavr32 directory, e.g. to update it to upstream/master (this is assuming that libavr32 is clean and that you haven’t made any commits to it).

cd libavr32
git checkout master # checkout local master branch
git fetch upstream
git rebase upstream/master # rebase local master onto upstream/master
cd ..
git add libavr32
git commit -m "updated libavr32 to master"
git push # now go to GitHub and open a PR

You could also cheat and do it using a detached commit

cd libavr32
git fetch upstream
git checkout upstream/master
cd ..
git add libavr32
git commit -m "updated libavr32 to master"
git push # now go to GitHub and open a PR

When you git pull or git checkout, your submodule won’t update! You need to use the git submodule update command, beware if your submodule is dirty (see the --merge and --rebase options). You’ll find that your life is a lot easier if you don’t work on the master branch.

One final tip:

git config --global status.submoduleSummary true

will change your git status command to show submodule info too.

1 Like

Definitely want an 80 char line limit?

pretty sure this is that:
( https://github.com/catfact/aleph-old/blob/dev/.clang-format#L25 )

re: submodules

The URL is stored in the .gitmodules file, and should always be https://github.com/monome/libavr32.git unless you know what you are doing.

so it’s not a good idea to have my forks of module repos point at my fork of libavr32? given that i’m probably going to have PRs for libavr32.
just curious

You can point them at your own fork via .gitmodules, just make sure those commits that change the URL never end up upstream on a monome repo. It’s not particularly bad, it just messes up the history a bit. The easiest way to do that (IMO), is to not change the URL as it’s only used for the initial clone / init (or git submodule sync).

understood, no changes to .gitmodules allowed upstream. (so they are best avoided altogether if experience is any judge.)

sorry, i took the time to actually read the brain dump and it’s clearer now.

in a nutshell (i’m dense): add a second remote for interacting with my fork of the submodule.

Definitely want an 80 char line limit?

@sam, sorry, i think i misunderstood - you would like a longer line limit, yeah? fine with me.

seems like if we’re gonna impose a format, now would be the time to do it. i’ll open a PR for libavr32 with clang-format and people can weight in on tweaks for it

[edit] … aaand, actually, i don’t know. it seems like clang-format just doesn’t handle aligning #defines. i can’t make it not do this:

-#define BANG        (0x1E)
-#define AT          (0x1F)
-#define POUND       (0x20)
-#define DOLLAR      (0x21)
-#define PERCENT     (0x22)
-#define CAP         (0x23)
-#define AND         (0x24)
-#define STAR        (0x25)
-#define OPENBKT     (0x26)
-#define CLOSEBKT    (0x27)
+#define BANG (0x1E)
+#define AT (0x1F)
+#define POUND (0x20)
+#define DOLLAR (0x21)
+#define PERCENT (0x22)
+#define CAP (0x23)
+#define AND (0x24)
+#define STAR (0x25)
+#define OPENBKT (0x26)
+#define CLOSEBKT (0x27)

anyone know a way around?
(SO doesn’t: http://stackoverflow.com/questions/27111078/can-clang-format-align-variable-or-macro-assignments-in-columns )

or, maybe i should be looking for a different formatter (uncrustify?); this is kind of a deal-breaker.

Right, after banging my head repeatedly against a wall for 2 days trying to get avr32-toolchain to build properly on newer versions of Linux (there are issues with newer versions of gperf and texinfo), I gave up and just used the Atmel builds. Maybe when I stop being quite so fed up with it, I’ll write it up as an issue on the repo.

Anyway, the main point being, I’ve now got travis-ci builds running, I’ve just created 2 so far, a simple one for the teletype repo: https://travis-ci.org/samdoshi/teletype

And a more complicated one for the libavr32 repo: https://travis-ci.org/samdoshi/libavr32

The libavr32 one will download the master branch of each of the firmwares, copy itself over and test to see if anything breaks. It could be useful for PRs.

The downside, particularly for the libavr32 repo, is that we’re using submodules, we don’t need each firmware to work with the latest libavr32. There’s no point using a CI if you don’t expect it to always pass. IMO having a CI that is expected to fail is worse than no CI.

Anyway, let me know if you’re interested in getting travis-ci working on the repos and I’ll create some PRs. We’ll need to move this repo over to the monome org too.

That brings back memories, sure enough I did run into that problem… from my post about aleph toolchain hosts way back when:

There is this fork of the avr32-toolchain repo: https://github.com/lis-epfl/avr32-toolchain

They’ve got patches to fix gperf and textinfo changes, they build on my mac, (and bizarrely give some extra warnings when compiling our code). But I couldn’t get them to build on the travis-ci OSX images.

I’ll try to update the readme later this week with updated Linux recommendations.

for what it’s worth, i’ve never had much luck with the jsnyder toolchain scripts on linux, nor had much motivation to try very hard since the atmel releases work fine.

the whole strategy of the Makefile seems kinda… brittle. combining specific arbitrary versions of gcc boostrap sources, with basically random versions of tools like texinfo

It’s handy because it does build a usable toolchain on OSX, which is very convenient. But I agree the Makefile is really hard to deal with. When it stops working I’ll replace it with the Atmel binaries and Vagrant / Docker / whatever the flavour of the month is.

@tehn, any interest in the getting travis set up?

https://travis-ci.org/samdoshi/libavr32/builds/118831379

at this point i’m still coming to grips with the submodule workflow-- minor confusion being worked out right now in fact while adding clock division to MP (which requires abstracting the external clock, which is a good thing in general).

i’ll check out travis!

I need to get the teletype codebase cleaned up a bit before I work on it, I’m going slightly crazy trying to follow control flow with the mixed up indentation.

So I was thinking, it doesn’t have to be a continuous affair, we could just take the hit once, sort the #defines out, and then all just try hard to keep it tidy looking. Thoughts?

@tehn, shall I just get on with it and run clang-format against the teletype codebase?

i say go. i can help sort out the messy things by hand as well (ie #defines)-- i’m pretty fast with sublime hotkeys

Works for me … 20

Is wrapping #defines in // clang-format off and // clang-format on an option? (Does that even work?)

EDIT: more on clang ignores in the docs.

Yeah, that occurred to me, it is a little irritating to have to baby the formatter that way. Good point though; probably better than having to fix things by hand.

Late to the party but yes please!