Bug 460354 - jgit does not follow copies, just "real" renames
Summary: jgit does not follow copies, just "real" renames
Status: NEW
Alias: None
Product: JGit
Classification: Technology
Component: JGit (show other bugs)
Version: 3.7   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-19 11:05 EST by Henning Moll CLA
Modified: 2015-02-19 11:19 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Henning Moll CLA 2015-02-19 11:05:51 EST
jgit is not able to follow "two step renames". A "two step rename" is a rename of a file using two commits: in the first commit the file is just copied to the new name/location, in a second commit, the original file is deleted. Example

Consider the following history:

A - B - C

Description of each commit

A file1 and file2 added

  git add file1
  git add file2
  git commit -m 'A'

B file1 copied to file11, file2 moved to file22

  cp file1 file11
  git add file11
  git mv file2 file22
  git commit -m 'B'

C file1 removed

  git rm file1
  git commit -m 'C'
  
Results using git:

$ git log --follow -- file22
B
A

$ git log --follow -- file11
B
A

Results using jgit:

$ jgit log --follow file22
B
A

$ jgit log --follow file11
B

(but not A)

git seems to follow copies and renames, while jgit just follows "real" renames.