Skip to content

fix(picker.git): properly handle file copy in git log#2682

Open
lpiepiora wants to merge 1 commit intofolke:mainfrom
lpiepiora:main
Open

fix(picker.git): properly handle file copy in git log#2682
lpiepiora wants to merge 1 commit intofolke:mainfrom
lpiepiora:main

Conversation

@lpiepiora
Copy link

@lpiepiora lpiepiora commented Jan 21, 2026

Description

This change is a followup to the change #1154, because similar situation may happen when a file is copied.

This can be easily reproduced by doing this:

echo "test1" >file1.txt
git add . && git commit -a -m "first change"
echo "test2" >file1.txt
git add . && git commit -a -m "second change"

# copy the file to the file2.txt

cp file1.txt file2.txt
git add . && git commit -a -m "third change"

echo "test3" >file2.txt
git add . && git commit -a -m "fourth change"

Then one may inspect the log:

$ git log --name-status --oneline --follow -- file2.txt
4173ba0 (HEAD -> main) fourth change
M       file2.txt
5a74d25 third change
C100    file1.txt       file2.txt
b6c4d07 second change
M       file1.txt
276e31a first change
A       file1.txt

Note the change is of type C not R as technically this is not rename, but the --follow will follow the file history.

Related Issue(s)

There is no issue for this particular change, but this is a followup to this one: #1154

Screenshots

This is without the change:

Screenshot 2026-01-21 at 09 34 20

This is with the change:

Screenshot 2026-01-21 at 09 34 58

@github-actions github-actions bot added picker size/s Small PR (<10 lines changed) labels Jan 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

picker size/s Small PR (<10 lines changed)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant