git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Feature request: "author branch" in commit object

From
Ed Hutchins <eh@demeterr.com>
Date
Jul 3, 2013, 15:47 UTC
Message-ID
<CADL+T9Z=SrVyMMnYk3M7Dmb4c5xGiQtCTiDYaceKwB2-51TV-g@mail.gmail.com>
In-Reply-To
<vpqehbgrnrx.fsf@anie.imag.fr>

I'm not trying to change the way git does things (which works perfectly well), I'm asking for some extra information to be added to the commit so that analysis of the ancestry graph can be tied to the branch topics that the original author was working from. Currently if you have a rebase-branch/ff-merge-to-master workflow, the graph of commits looks like a single user produced all of the code. It would be very useful for both forensic and display purposes to categorize those commits by their original topics, but that history is lost in such a workflow. Certainly there are work-arounds (notes etc.) to capture this history, but I think that this is a basic feature which most projects would benefit from. I fully understand that branches are not global and that it may be confusing to keep an "author branch" name around in some cases, but the vast majority of cases where authors pick meaningful branch names would benefit from being able to look back and go "ah-ha! that was a commit to fix bug such-and-such" or "that was a commit from when I was working on super-cool feature X". Even just knowing that two commits were from different (or the same) branches would tell you something useful about the evolution of the project. Arguing that branch names are local and thus meaningless misses the point: branches are *names* which were meaningful to the author at the time the branch was being worked on. Discarding this information makes it harder to reason about or display the history of the project and is an irritating defect in an otherwise wonderful tool.

On Wed, Jul 3, 2013 at 2:33 AM, Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> wrote:

Show 23 quoted lines
> Ed Hutchins <eh@demeterr.com> writes:
>
>> I realize that branch names are ephemeral repo-specific things, but it
>> would be really useful to be able to determine what branch a commit
>> was authored from (as a hint to ancestry graph layout tools, for
>> example). Is there any way to do this currently, is it planned, or
>> would it be deemed useful enough to be worth adding to each commit
>> object?
>
> FWIW, this is what Mercurial's "named branches" do. Instead of having
> branches point to commit, each commit says what branch it belongs to.
>
> One drawback of this approach is that the branch name is part of the
> commit and can't be changed without changing the commit's sha1. Hence, a
> local, private, branch name becomes permanent the day it's merged
> upstream.
>
> (for completeness: Mercurial also has essentially Git-like branches,
> but they call this "bookmarks")
>
> --
> Matthieu Moy
> http://www-verimag.imag.fr/~moy/
Previous: Matthieu MoyNext: Junio C Hamano
Message 11 of 17 in “Feature request: "author branch" in commit object”
  1. Ed HutchinsJul 2, 2013
  2. Fredrik GustafssonJul 2, 2013
  3. Junio C HamanoJul 2, 2013
  4. Ed HutchinsJul 2, 2013
  5. Antoine PelisseJul 3, 2013
  6. Ed HutchinsJul 3, 2013
  7. Junio C HamanoJul 3, 2013
  8. Andrew ArdillJul 4, 2013
  9. Johan HerlandJul 2, 2013
  10. Matthieu MoyJul 3, 2013
  11. Ed HutchinsJul 3, 2013
  12. Junio C HamanoJul 3, 2013
  13. Jakub NarebskiJul 3, 2013
  14. DanyJul 3, 2013
  15. DanyJul 3, 2013
  16. Matthieu MoyJul 4, 2013
  17. Philip OakleyJul 9, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.