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

git blame and cherry-picking

From
Steven Grimm <koreth@midwinter.com>
Date
Aug 6, 2008, 22:18 UTC
Message-ID
<91A979F0-1329-4CA6-AADC-6CF55872B57A@midwinter.com>

What, if any, is the approved way to get git blame to follow cherry- picked changes? Right now blame is good about showing you the actual responsible revision and author in the case of merges, but if you cherry-pick a change with "-n" (to test before committing), the modifications are attributed to the person who did the cherry-pick instead of the cherry-picked revision's author. Even without the "-n" option, the changes are attributed to the cherry-pick *revision* instead of the original one.

My horrible hack workaround for now is to temporarily put a grafts entry in place to make git think the cherry-pick revisions I'm interested in are actually merges. That requires me to know that a given revision is a cherry-pick and I have to be careful to remove my fake graft afterwards. What's more, it can result in some strange and seemingly nonsensical "merge" topologies if, e.g., a newer change is cherry-picked before an older one.

Surely there must be a better way...?
-Steve
Next: Alex Riesen
Message 1 of 7 in “git blame and cherry-picking”
  1. Steven GrimmAug 6, 2008
  2. Alex RiesenAug 7, 2008
  3. Jeff KingAug 7, 2008
  4. Steven GrimmAug 7, 2008
  5. Junio C HamanoAug 7, 2008
  6. Jeff KingAug 7, 2008
  7. Avery PennarunAug 7, 2008

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.