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

Re: Using Origin hashes to improve rebase behavior

From
Johan Herland <johan@herland.net>
Date
Feb 10, 2011, 22:16 UTC
Message-ID
<201102102316.23628.johan@herland.net>
In-Reply-To
<m21v3fvbix.fsf@hermes.luannocracy.com>
On Thursday 10 February 2011, John Wiegley wrote:
> Is it allowable to add new metadata fields to a commit, and would this
> require bumping the repository version number?  Or should this be
> implemented by appending a Header-style textual field at the end of the
> commit message?

Many have tried before you to add such fields to the commit objects (including, literally, storing the origin of cherry-picks to help with rebases; search the archives for several examples). They have not succeeded. With good reason. This information does not belong in the commit object header section (see earlier discussions for a more complete rationale). Putting them at the end of the commit message is your best bet. Or even better: as a note object stored in a special-purpose notes ref (e.g. refs/notes/cherry-picks). The note approach also allows you to retroactively add this field to previous cherry-picks. AND it allows you to remove Origin- IDs that refer to no-longer-existing commits. AND it pretty much solves the "git log should show this info" for you as well. In short, this is exactly the thing that notes were created to do.

Also, don't forget that the existing -x option to cherry-pick pretty much does exactly what you want to add to the commit object.

As for making use of this information in other git commands (e.g. rebase, log, etc.), you should show the list that the feature works well and solves Real Problems(tm) in the real world. If you can do so (with patches), and are willing to work with the list to address issues raised, and improve your patches, I'll guess you have a pretty good shot at getting this accepted.

AFAIK, nobody else is working in this area right now, although I don't read the mailing list religuously, so I may have missed things. As I said, others have previously proposed similar features, so you'll want to search the archive for those discussions to make sure you don't repeat the same mistakes.

Have fun! :)
...Johan
-- 
Johan Herland, <johan@herland.net>
www.herland.net
Previous: John WiegleyNext: Jeff King
Message 2 of 14 in “Using Origin hashes to improve rebase behavior”
  1. John WiegleyFeb 10, 2011
  2. Johan HerlandFeb 10, 2011
  3. Jeff KingFeb 10, 2011
  4. John WiegleyFeb 11, 2011
  5. Jeff KingFeb 11, 2011
  6. John WiegleyFeb 11, 2011
  7. Thomas RastFeb 12, 2011
  8. skillzero@gmail.comFeb 11, 2011
  9. Johan HerlandFeb 11, 2011
  10. Jeff KingFeb 11, 2011
  11. Junio C HamanoFeb 11, 2011
  12. Jeff KingFeb 11, 2011
  13. Enrico WeigeltFeb 20, 2011
  14. Dave AbrahamsFeb 21, 2011

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.