Hi Folks!
The issue is best explained on an example. You can reproduce it using the
Lucene repo https://github.com/apache/lucene-solr.git. Tested with the
following versions: 1.8.1.6 (Ubuntu), 2.11.0.windows.1, 2.11.1.windows.1.
First, let's produce the correct results without using --procelain:
> git blame --show-name --show-number -s -w --abbrev=40 -C -C -C
> d1165b19726fa0cd13a539827a7cd43237a4feef..10ba9abeb208d37df985e95a742f756de067353f
> --not f5dba8b76709ff0ef8715b8b288a4b64d4993fa3 --
> lucene/src/java/org/apache/lucene/index/DirectoryReader.java
The following excerpt shows lines 501-505 from the output. In particular we can
see that lines 502-503 originate from IndexReader.java.
10ba9abeb208d37df985e95a742f756de067353f
lucene/src/java/org/apache/lucene/index/DirectoryReader.java 501 501) *
<p>This method
^d1165b19726fa0cd13a539827a7cd43237a4fee
lucene/src/java/org/apache/lucene/index/IndexReader.java 496 502) *
returns the version recorded in the commit that the
^d1165b19726fa0cd13a539827a7cd43237a4fee
lucene/src/java/org/apache/lucene/index/IndexReader.java 497 503) *
reader opened. This version is advanced every time
^d1165b19726fa0cd13a539827a7cd43237a4fee
lucene/src/java/org/apache/lucene/index/IndexReader.java 498 504) * a
change is made with {@link IndexWriter}.</p>
10ba9abeb208d37df985e95a742f756de067353f
lucene/src/java/org/apache/lucene/index/DirectoryReader.java 505 505) */
The same information can be obtained as well by using --line-porcelain:
> git blame --show-name --show-number --line-porcelain -s -w --abbrev=40 -C -C
> -C
> d1165b19726fa0cd13a539827a7cd43237a4feef..10ba9abeb208d37df985e95a742f756de067353f
> --not f5dba8b76709ff0ef8715b8b288a4b64d4993fa3 --
> lucene/src/java/org/apache/lucene/index/DirectoryReader.java
Here is the output for line 502:
d1165b19726fa0cd13a539827a7cd43237a4feef 496 502 3
author Michael McCandless
author-mail <[email protected]>
author-time 1327877325
author-tz +0000
committer Michael McCandless
committer-mail <[email protected]>
committer-time 1327877325
committer-tz +0000
summary LUCENE-3725: add optional packing to FSTs
boundary
filename lucene/src/java/org/apache/lucene/index/IndexReader.java
* returns the version recorded in the commit that the
However, when using --porcelain DirectoryReader.java is reported as the origin
of lines 502-504:
> git blame --show-name --show-number --porcelain -s -w --abbrev=40 -C -C -C
> d1165b19726fa0cd13a539827a7cd43237a4feef..10ba9abeb208d37df985e95a742f756de067353f
> --not f5dba8b76709ff0ef8715b8b288a4b64d4993fa3 --
> lucene/src/java/org/apache/lucene/index/DirectoryReader.java
10ba9abeb208d37df985e95a742f756de067353f 501 501 1
author Uwe Schindler
author-mail <[email protected]>
author-time 1327879145
author-tz +0000
committer Uwe Schindler
committer-mail <[email protected]>
committer-time 1327879145
committer-tz +0000
summary Reverse merged revision(s) from lucene/dev/trunk up to 1237502
previous f5dba8b76709ff0ef8715b8b288a4b64d4993fa3
lucene/src/java/org/apache/lucene/index/DirectoryReader.java
filename lucene/src/java/org/apache/lucene/index/DirectoryReader.java
* <p>This method
d1165b19726fa0cd13a539827a7cd43237a4feef 496 502 3
* returns the version recorded in the commit that the
d1165b19726fa0cd13a539827a7cd43237a4feef 497 503
* reader opened. This version is advanced every time
d1165b19726fa0cd13a539827a7cd43237a4feef 498 504
This is not only inconsistent with the other outputs but the output is also
inconsistent in itself because lines 496 -498 do not even exist in a previous
version of DirectoryReader.java.
Thanks for any feedback.
Kind Regards
Konstantin Sokolov