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

Re: RFE: support change-id generation natively

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 22, 2013, 19:50 UTC
Message-ID
<xmqqy55lrsoo.fsf@gitster.dls.corp.google.com>
In-Reply-To
<201310211249.49568.mfick@codeaurora.org>
Martin Fick <mfick@codeaurora.org> writes:
> As a Gerrit maintainer, I would suspect that we would 
> welcome a way to track "changes" natively in git.

I would suspect that we would not mind "git commit --change-id" (and probably "git commit-tree --change-id") option that can be used to tell the command to add a new Change-Id: trailer at the end, if and only if there is none in the log message to be recorded (this needs to happen after the user possibly edits). We may even want to introduce commit.changeId boolean configuration variable if we did so.

"git commit --amend", "git rebase", etc. can be left oblivious to the "Change-Id:" trailer, as the default mode of operation you guys want is to leave the existing one as-is, unless the end user really wants to change it, I think.

It would be just the matter of updating commit_tree_extended() in commit.c to:

 - detect the need to add a new Change-Id: trailer;
 - call hash_sha1_file() on the commit object buffer (assuming that
   a commit object that you can actually "git cat-file commit" using
   the change Id does not have to exist anywhere for Gerrit to
   work---otherwise you would need to call write_sha1_file()
   instead) before adding Change-Id: trailer;
 - add Change-Id: trailer to the buffer; and then finally
 - let the existing write_sha1_file() to write it out.

I would think. You might have a funny chicken-and-egg problem with the signed commit, though. I didn't think that part through.

Previous: Martin FickNext: Pyeron, Jason J CTR (US)
Message 10 of 24 in “RFE: support change-id generation natively”
  1. james.moger@gitblit.comOct 21, 2013
  2. Jeremy RosenOct 21, 2013
  3. james.moger@gitblit.comOct 21, 2013
  4. Shawn PearceOct 21, 2013
  5. Ondřej BílkaOct 21, 2013
  6. Shawn PearceOct 21, 2013
  7. Thomas KochOct 21, 2013
  8. james.moger@gitblit.comOct 21, 2013
  9. Martin FickOct 21, 2013
  10. Junio C HamanoOct 22, 2013
  11. Pyeron, Jason J CTR (US)Oct 22, 2013
  12. Junio C HamanoOct 22, 2013
  13. Duy NguyenOct 23, 2013
  14. Junio C HamanoOct 23, 2013
  15. Duy NguyenOct 24, 2013
  16. Nasser GrainawiOct 24, 2013
  17. Duy NguyenOct 24, 2013
  18. Johannes SixtOct 24, 2013
  19. james.moger@gitblit.comOct 24, 2013
  20. Thomas KochOct 24, 2013
  21. Duy NguyenOct 24, 2013
  22. Junio C HamanoOct 24, 2013
  23. Johannes SixtOct 25, 2013
  24. Shawn PearceOct 21, 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.