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

git log --follow wrongly includes delete commit

From
SGSteinar H. Gunderson <steinar+git@gunderson.no>
Date
Jan 26, 2023, 13:05 UTC
Message-ID
<20230126130509.ovii7ji7hi5wm7qx@sesse.net>
Hi,

I'm in the Chromium repository; it can be checked out at https://chromium.googlesource.com/chromium/src.git (you don't need the sub-repostiories). HEAD is pointing to 4e0db738b37c. git 2.39.1.

When I run
  git log --raw --follow base/third_party/xdg_user_dirs/xdg_user_dir_lookup.h
this is the first commit that it lists (snipped):

commit 5d4451ebf298d9d71f716cc0135f465cec41fcd0 [...] :100644 000000 9e81e1b53029f 0000000000000 D base/third_party/xdg_user_dirs/xdg_user_dir_lookup.h

This indicates that the last thing that happened to the file is a delete. However, the file isn't deleted; it's alive and well. git log without --follow does not list this commit at all.

So either git log --follow is listing a delete commit that doesn't make sense, or it's missing whatever commit put it back into place afterwards.

/* Steinar */
-- 
Homepage: http://www.sesse.net/
Next: Derrick Stolee
Message 1 of 3 in “git log --follow wrongly includes delete commit”
  1. Steinar H. GundersonJan 26, 2023
  2. Derrick StoleeJan 26, 2023
  3. Steinar H. GundersonJan 26, 2023

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.