Using git to get a changelog for Toastman builds?

Discussion in 'Tomato Firmware' started by darksky, Sep 20, 2013.

  1. darksky

    darksky Addicted to LI Member

  2. koitsu

    koitsu Network Guru Member

    What you're essentially asking is "how do I use git?" :) I'll talk about Toastman's stuff because it's what I'm familiar with:

    With Toastman, there are two "branches" -- one called Toastman-RT, the other called Toastman-RT-N. These branch names are considered "head" (if you're familiar with CVS or SVN terminology) and are where all work-in-progress changes are made.

    Within each branch, there are tags. When Toastman is ready to release a new version, he makes a new tag (for example, Toastman-1.28.0503 (for Toastman-RT-N) or Toastman-1.28.7503 (for Toastman-RT)). The tags themselves do not contain RT or RT-N strings; you simply have to know what is what.

    The even trickier part is that sometimes RT gets fixes from RT-N and vice-versa, so you might occasionally see commits that "merge" the two (but not all pieces; for example RT-N has newer wireless drivers).

    And it gets even more tricky: you need to understand how branching works in git to truly understand the nature of its tree mechanism. For example, all the firmwares (Toastman, Shibby, Victek, etc.) are "branches" of the main Tomato branch -- so if someone commits a major change to the "main Tomato branch" it actually can affect all the underlying branches underneath. This is very rare though, as the licensing/legality issues relating to the original Zarate Tomato code are unanswered (because Jon doesn't seem to respond to mail/contact), so touching that is often avoided.

    (Commentary: this is one of the reasons I don't particularly like git. It's very powerful but I find it immensely confusing/very VERY easy to get lost)

    You can confirm all of this by looking at the main git repo web interface here:

    If you want to review all the commits (which may or may not be what you want; you say you want "the differences" but what you link to looks like a commit log, not a diff), then you simply click on the word log next to the tag you want to review; for example, in the tags section, you can click on log next to Toastman-1.28.0503 to see what all has been committed to that tag over the entire existence of the branch (Toastman-RT-N) itself.

    You'll see little icons with tag names (version numbers) when a particular tag is made. Toastman's commit message also usually says something like "Merge branch 'Toastman-RT' into Toastman-RT-N" when he makes a release, so you can simply skim the changes between those two points to see what's what.

    You can do the same thing for the head/main branch by scrolling down to the heads section and doing the same thing there.

    If you want to review actual code changes (as in the literal code diffs), then you need to get a list of commits (I explained how above) and click on each of the diffs along the way. I will tell you right now there is definitely an easier way to do this, but I do not know how using the interface. Someone else here probably has familiarity with it.

    I'm more familiar with using the git CLI tool and so on, where you can literally do something like:

    git checkout Toastman-RT-N
    git diff Toastman-1.28.0502.8 Toastman-1.28.0503

    Which would show you the actual code differences between those two tags. The syntax is git diff {old} {new} -- if you reverse old and new, you'll get a "reversed diff". People screw up the syntax of this all the time, sadly.

    To look at the commit log messages between two tags, you'd do:

    git checkout Toastman-RT-N
    git log Toastman-1.28.0502.8..Toastman-1.28.0503

    And to get a list of tags (for example the RT-N branch) you would do:

    git checkout Toastman-RT-N
    git tags -l

    And for a list of branches:

    git branch -a

    The ones you care about are called "remotes" -- when making code changes to something, they're considered a "local" branch (i.e. local to your disk/system), and "remotes" are what are on the actual git repo server. They'll be listed something like remotes/origin/Toastman-RT-N -- you only need the stuff after the last / (git figures it out for you). You could also use git branch -l -r I guess.

    You do not have to do git checkout xxx each time, by the way -- once you do a git checkout it "stays" until you do another one, so you really only have to issue it once. To find out what branch you're currently on, use git status.

    I do feel the web interface is not all that great compared to github, but I'm not going to get into a discussion about that -- I don't make the decisions, and I'm not going to impose my opinion on developers.

    Commits you see from me, by the way, are not actually commits I've done (I do not have repo access) -- I just simply code the changes + provide diffs as attachments here, and Toastman et al commits them on my behalf, somehow making them show my pseudoname. :)
  3. darksky

    darksky Addicted to LI Member

    Wow, thanks for the highly detailed and thoughtful reply. I guess github simplifies things greatly. I will follow your steps to see if I can get what I'm looking for.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice