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

Feature request: add a metadata in the commit: the "commited in branch" information

From
ABArnaud Bertrand <xda@abalgo.com>
Date
Dec 23, 2019, 12:56 UTC
Message-ID
<CAEW0o+jV+r1UMZReRXa3g_fyqCYxHTVYVf6pWvjB7_isofbBaw@mail.gmail.com>
Hello,

Git is a nice tool but one of the most important missing information is the branch in which a commit was done. I understood that in git philosophy, once it is merged, a branch can disappear. But for a lot of companies, a SCM is also a guardian of the history. With this point of view, keeping track of the branch name when the commit was done should be a very very big improvement (and a Major argument to switch to git) I speak just about a meta-data, exactly as the committer username, email or date... no more. If the branch is removed in the future or is renamed... so what, we have at least its name at the time of the commit (better than nothing).

Today, all my git repositories are using hooks to add the name of the branch as header of the comment. But it would be so better to have it officially and automatically and accessible as a git log meta-data. It does not imply any constrains, simply a few characters more in the commit. We can also imagine a core.branchInCommit parameter (true by default ;-) ) that could be set to false for those that don't one it. The only commands affected should be git commit, git merge --no-ff and git log that should be able to show this metadata.

Best regards,
Arnaud Bertrand
Next: Junio C Hamano
Message 1 of 6 in “Feature request: add a metadata in the commit: the "commited in branch" information”
  1. Arnaud BertrandDec 23, 2019
  2. Junio C HamanoDec 29, 2019
  3. Arnaud BertrandDec 29, 2019
  4. Theodore Y. Ts'oDec 30, 2019
  5. Arnaud BertrandDec 30, 2019
  6. Paul SmithDec 30, 2019

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.