DISCLAIMER. English language used here only for compatibility (ASCII only), so any suggestions about my bad grammar (and not only it) will be greatly appreciated.

понедельник, 26 ноября 2012 г.

Strange behavior of git blame '-C' option.

(update1)
'git blame' 's option '-C' works strangely to me, and i'm neither able to find
anything relevent in manpage nor somewhere else.  So, here is just test
results and my speculations, which may be (completely) wrong.

It seems, that there is some threshold on number of successive lines from file F,
which should match consecutively somewhere in file G, in order to attribute
these lines to file G. And may be this threshold is "at least 3" (>= 3).
Though, i have test repository, where it attributes even one line to other
file (but only when invoked with constraint to this one line ('-L')), i can't
reproduce this on any repository (constraint for one or two lines results in
not detecting move at all). Also, it seems, that 'blame' may attribute one
line to other file G, but only if there is 3 or more successive lines
somewhere else already attributed to this file G. What about argument to
option '-C', but it seems, that it just changes minimum line length, rather
than minimum number of lines.

So, below all changes are greater, than 3 lines to ensure, that 'blame'
detects them. And here is presumably correct detailed description of option
'-C'. In all cases i 'blame' whole file F.

IMPORTANT! Do not stack several '-C' options into one, like

    git blame -CC

it is incorrect! It will work, but like _one_ option '-C' given, not two (or
three).  I think, the reason is that options with optional argument can't be
stacked (why git doesn't warn about this is another question).

1. Without '-C'. It looks for commit, which have last modified every
   (requested) line, and attributes all changes to the same file F at
   corresponding commit.
2. One '-C'. Lines, which have been last modified at some commit C, will be
   searched in versions from commit C^ (commit C 's parent) of every other
   file modified at commit C.  Particularly, this means, that if same lines at
   the commit C were added to _both_ file F and file G, file G will _not_ be
   blamed for these lines (and actually this is correct). Also this means,
   that changes in other files at commit C do not matter, when searching for
   lines origin. Lines origin commit will be the one, which have last modified
   them in file they attributed to (file G in above example).  Particularly,
   this means, that commit C will never be origin for lines attributed to
   other file.

   Example. {{{

   History
    $ git log --oneline --name-status  | cat -
    1e84185 Move from SWO to SW. Copy from SWT to SW. Change (partially) copied lines in SWT. Add the same to SWC and SW.
    M       ShowWords.hs
    M       ShowWordsConfig.hs
    M       ShowWordsOutput.hs
    M       ShowWordsText.hs
    6a36c44 Add SW.
    A       ShowWords.hs
    579b036 Add SWO.
    A       ShowWordsOutput.hs
    12d5b07 Initial commit. Add SWC, SWT.
    A       ShowWordsConfig.hs
    A       ShowWordsText.hs

   Description of changes at commit 1e84185:
    - Mpve several lines from ShowWordsOutput to ShowWords (hence, these lines
      have been deleted from ShowWordsOutput).
    - Copy several lines from ShowWordsText to ShowWords. Also modify some of
      these copied lines in ShowWordsText.
    - Add the same lines to both ShowWordsConfig and ShowWords.

   As i explain above, none of the ShowWords lines will be attributed to
   ShowWordsConfig, even with three '-C':

    $ git blame --incremental -C -C -C -- ShowWords.hs | grep filename
    filename ShowWords.hs
    filename ShowWords.hs
    filename ShowWords.hs
    filename ShowWords.hs
    filename ShowWords.hs
    filename ShowWordsOutput.hs
    filename ShowWordsText.hs
    $ git blame --incremental -C -C -C -- ShowWords.hs
    {{{
    1e84185721b0b84ff0a5900e66b2f14a2bd23878 20 20 10
    author sgf
    author-mail <sgf.dma@gmail.com>
    author-time 1353947381
    author-tz +0400
    committer sgf
    committer-mail <sgf.dma@gmail.com>
    committer-time 1353947381
    committer-tz +0400
    summary Move from SWO to SW. Copy from SWT to SW. Change (partially) copied lines in SWT. Add the same to SWC and SW.
    previous 6a36c44b23e57e84e99e5e422b3fd449c03c9d71 ShowWords.hs
    filename ShowWords.hs
    6a36c44b23e57e84e99e5e422b3fd449c03c9d71 1 1 19
    author sgf
    author-mail <sgf.dma@gmail.com>
    author-time 1353848192
    author-tz +0400
    committer sgf
    committer-mail <sgf.dma@gmail.com>
    committer-time 1353848192
    committer-tz +0400
    summary Add SW.
    filename ShowWords.hs
    6a36c44b23e57e84e99e5e422b3fd449c03c9d71 20 30 24
    filename ShowWords.hs
    6a36c44b23e57e84e99e5e422b3fd449c03c9d71 44 60 53
    filename ShowWords.hs
    6a36c44b23e57e84e99e5e422b3fd449c03c9d71 97 129 157
    filename ShowWords.hs
    579b0364e9a045eb86f1c18b3202228550733c64 22 54 6
    author sgf
    author-mail <sgf.dma@gmail.com>
    author-time 1353848183
    author-tz +0400
    committer sgf
    committer-mail <sgf.dma@gmail.com>
    committer-time 1353848183
    committer-tz +0400
    summary Add SWO.
    filename ShowWordsOutput.hs
    12d5b07d387834fe0e113f104f3e34d2e51dcfed 25 113 16
    author sgf
    author-mail <sgf.dma@gmail.com>
    author-time 1353848160
    author-tz +0400
    committer sgf
    committer-mail <sgf.dma@gmail.com>
    committer-time 1353848160
    committer-tz +0400
    summary Initial commit. Add SWC, SWT.
    boundary
    filename ShowWordsText.hs
    }}}

   Though ShowWordsOutput and ShowWordsText will be blamed with one '-C':

    $ git blame --incremental -C  -- ShowWords.hs | grep filename
    filename ShowWords.hs
    filename ShowWords.hs
    filename ShowWords.hs
    filename ShowWords.hs
    filename ShowWords.hs
    filename ShowWordsOutput.hs
    filename ShowWordsText.hs
    $ git blame --incremental -C  -- ShowWords.hs
    {{{
    1e84185721b0b84ff0a5900e66b2f14a2bd23878 20 20 10
    author sgf
    author-mail <sgf.dma@gmail.com>
    author-time 1353947381
    author-tz +0400
    committer sgf
    committer-mail <sgf.dma@gmail.com>
    committer-time 1353947381
    committer-tz +0400
    summary Move from SWO to SW. Copy from SWT to SW. Change (partially) copied lines in SWT. Add the same to SWC and SW.
    previous 6a36c44b23e57e84e99e5e422b3fd449c03c9d71 ShowWords.hs
    filename ShowWords.hs
    6a36c44b23e57e84e99e5e422b3fd449c03c9d71 1 1 19
    author sgf
    author-mail <sgf.dma@gmail.com>
    author-time 1353848192
    author-tz +0400
    committer sgf
    committer-mail <sgf.dma@gmail.com>
    committer-time 1353848192
    committer-tz +0400
    summary Add SW.
    filename ShowWords.hs
    6a36c44b23e57e84e99e5e422b3fd449c03c9d71 20 30 24
    filename ShowWords.hs
    6a36c44b23e57e84e99e5e422b3fd449c03c9d71 44 60 53
    filename ShowWords.hs
    6a36c44b23e57e84e99e5e422b3fd449c03c9d71 97 129 157
    filename ShowWords.hs
    579b0364e9a045eb86f1c18b3202228550733c64 22 54 6
    author sgf
    author-mail <sgf.dma@gmail.com>
    author-time 1353848183
    author-tz +0400
    committer sgf
    committer-mail <sgf.dma@gmail.com>
    committer-time 1353848183
    committer-tz +0400
    summary Add SWO.
    filename ShowWordsOutput.hs
    12d5b07d387834fe0e113f104f3e34d2e51dcfed 25 113 16
    author sgf
    author-mail <sgf.dma@gmail.com>
    author-time 1353848160
    author-tz +0400
    committer sgf
    committer-mail <sgf.dma@gmail.com>
    committer-time 1353848160
    committer-tz +0400
    summary Initial commit. Add SWC, SWT.
    boundary
    filename ShowWordsText.hs
    }}}

   }}}

3. Two '-C'. Lines, which have _not_ been modified after commit C, where file F
   was _added_ into repository, will be searched in versions from commit C^
   (commit C 's parent) of _every_ other file at commit C (not only modified).
   Lines modified at other commits, will be searched only in files _modified_
   at corresponding commit (the same as with one '-C'). In other words, two
   '-C' options may change result only for lines, that remain unchanged from
   the beginning (since file F has been added into repository).

   Example. {{{

   History
    $ git log --oneline --name-status
    3421478 Move from SWO to SW. Copy from SWC and SOL to SW.
    M       ShowWords.hs
    M       ShowWordsOutput.hs
    4f0d505 Add SOL.
    A       SgfOrderedLine.hs
    ebfa18d Add to SWT and SW the same func. Copy from SWC and SL to SW.
    A       ShowWords.hs
    M       ShowWordsText.hs
    5c84fe3 Add SL.
    A       SgfList.hs
    f5b0553 Initial commit. Add SWT, SWO, SWC.
    A       ShowWordsConfig.hs
    A       ShowWordsOutput.hs
    A       ShowWordsText.hs

   Description of changes at commit ebfa18d:
    - Add the same lines to both ShowWords and ShowWordsText.
    - Copy several lines from ShowWordsConfig to ShowWords (ShowWordsConfig
      remains uchanged).
    - Copy several lines from SgfList to ShowWords (SgfList remains
      unchanged).

   Descritpion of changes at commit 3421478:
    - Move several lines from ShowWordsOutput to ShowWords (hence, these lines
      have been deleted from ShowWordsOutput).
    - Copy several lines (not the same as at commit ebfa18d) from
      ShowWordsConfig to ShowWords (ShowWordsConfig remains uchanged).
    - Copy several lines from SgfOrderedLine to ShowWords (SgfOrderedLine
      remains unchanged).

   Hence, one '-C' option will only notice move from file ShowWordsOutput:

    $ git blame --incremental -C -- ShowWords.hs | grep filename
    filename ShowWords.hs
    filename ShowWords.hs
    filename ShowWords.hs
    filename ShowWords.hs
    filename ShowWords.hs
    filename ShowWordsOutput.hs
    $ git blame --incremental -C -- ShowWords.hs
    {{{
    342147897af7c166c5c960eedf4f1417bd2f679e 253 253 21
    author sgf
    author-mail <sgf.dma@gmail.com>
    author-time 1353857418
    author-tz +0400
    committer sgf
    committer-mail <sgf.dma@gmail.com>
    committer-time 1353857418
    committer-tz +0400
    summary Move from SWO to SW. Copy from SWC and SOL to SW.
    previous 4f0d505c923f8f407d41c2b446ab43838cbb19ed ShowWords.hs
    filename ShowWords.hs
    342147897af7c166c5c960eedf4f1417bd2f679e 320 320 29
    filename ShowWords.hs
    ebfa18d40e650b9876aa56f24656060916e353c9 1 1 230
    author sgf
    author-mail <sgf.dma@gmail.com>
    author-time 1353857320
    author-tz +0400
    committer sgf
    committer-mail <sgf.dma@gmail.com>
    committer-time 1353857320
    committer-tz +0400
    summary Add to SWT and SW the same func. Copy from SWC and SL to SW.
    filename ShowWords.hs
    ebfa18d40e650b9876aa56f24656060916e353c9 231 237 16
    filename ShowWords.hs
    ebfa18d40e650b9876aa56f24656060916e353c9 247 274 46
    filename ShowWords.hs
    f5b055331a37c17376983a953fa43a1bb9771032 22 231 6
    author sgf
    author-mail <sgf.dma@gmail.com>
    author-time 1353857234
    author-tz +0400
    committer sgf
    committer-mail <sgf.dma@gmail.com>
    committer-time 1353857234
    committer-tz +0400
    summary Initial commit. Add SWT, SWO, SWC.
    boundary
    filename ShowWordsOutput.hs
    }}}

   Two '-C' options will find move from ShowWordsOutput, and copy from
   SgfList and _first_ copy (at commit ebfa18d) from ShowWordsConfig:

    $ git blame --incremental -C -C -- ShowWords.hs | grep filename
    filename ShowWords.hs
    filename ShowWords.hs
    filename ShowWords.hs
    filename ShowWords.hs
    filename ShowWords.hs
    filename ShowWords.hs
    filename ShowWords.hs
    filename ShowWordsConfig.hs
    filename SgfList.hs
    filename ShowWordsOutput.hs
    $ git blame --incremental -C -C -- ShowWords.hs
    {{{
    342147897af7c166c5c960eedf4f1417bd2f679e 253 253 21
    author sgf
    author-mail <sgf.dma@gmail.com>
    author-time 1353857418
    author-tz +0400
    committer sgf
    committer-mail <sgf.dma@gmail.com>
    committer-time 1353857418
    committer-tz +0400
    summary Move from SWO to SW. Copy from SWC and SOL to SW.
    previous 4f0d505c923f8f407d41c2b446ab43838cbb19ed ShowWords.hs
    filename ShowWords.hs
    342147897af7c166c5c960eedf4f1417bd2f679e 320 320 29
    filename ShowWords.hs
    ebfa18d40e650b9876aa56f24656060916e353c9 1 1 112
    author sgf
    author-mail <sgf.dma@gmail.com>
    author-time 1353857320
    author-tz +0400
    committer sgf
    committer-mail <sgf.dma@gmail.com>
    committer-time 1353857320
    committer-tz +0400
    summary Add to SWT and SW the same func. Copy from SWC and SL to SW.
    filename ShowWords.hs
    ebfa18d40e650b9876aa56f24656060916e353c9 129 129 15
    filename ShowWords.hs
    ebfa18d40e650b9876aa56f24656060916e353c9 152 152 79
    filename ShowWords.hs
    ebfa18d40e650b9876aa56f24656060916e353c9 231 237 16
    filename ShowWords.hs
    ebfa18d40e650b9876aa56f24656060916e353c9 247 274 46
    filename ShowWords.hs
    f5b055331a37c17376983a953fa43a1bb9771032 8 113 16
    author sgf
    author-mail <sgf.dma@gmail.com>
    author-time 1353857234
    author-tz +0400
    committer sgf
    committer-mail <sgf.dma@gmail.com>
    committer-time 1353857234
    committer-tz +0400
    summary Initial commit. Add SWT, SWO, SWC.
    boundary
    filename ShowWordsConfig.hs
    5c84fe33852a0cd4dede51b96d642e782d782814 43 144 8
    author sgf
    author-mail <sgf.dma@gmail.com>
    author-time 1353857251
    author-tz +0400
    committer sgf
    committer-mail <sgf.dma@gmail.com>
    committer-time 1353857251
    committer-tz +0400
    summary Add SL.
    filename SgfList.hs
    f5b055331a37c17376983a953fa43a1bb9771032 22 231 6
    filename ShowWordsOutput.hs
    }}}

   And only three '-C' options will find copy from SgfOrderedLine and second
   copy (at commit 3421478) from ShowWordsConfig:

    $ git blame --incremental -C -C -C -- ShowWords.hs | grep filename
    filename ShowWords.hs
    filename ShowWords.hs
    filename ShowWords.hs
    filename ShowWords.hs
    filename ShowWords.hs
    filename ShowWordsConfig.hs
    filename SgfList.hs
    filename ShowWordsOutput.hs
    filename ShowWordsConfig.hs
    filename SgfOrderedLine.hs
    $ git blame --incremental -C -C -C -- ShowWords.hs
    {{{
    ebfa18d40e650b9876aa56f24656060916e353c9 1 1 112
    author sgf
    author-mail <sgf.dma@gmail.com>
    author-time 1353857320
    author-tz +0400
    committer sgf
    committer-mail <sgf.dma@gmail.com>
    committer-time 1353857320
    committer-tz +0400
    summary Add to SWT and SW the same func. Copy from SWC and SL to SW.
    filename ShowWords.hs
    ebfa18d40e650b9876aa56f24656060916e353c9 129 129 15
    filename ShowWords.hs
    ebfa18d40e650b9876aa56f24656060916e353c9 152 152 79
    filename ShowWords.hs
    ebfa18d40e650b9876aa56f24656060916e353c9 231 237 16
    filename ShowWords.hs
    ebfa18d40e650b9876aa56f24656060916e353c9 247 274 46
    filename ShowWords.hs
    f5b055331a37c17376983a953fa43a1bb9771032 8 113 16
    author sgf
    author-mail <sgf.dma@gmail.com>
    author-time 1353857234
    author-tz +0400
    committer sgf
    committer-mail <sgf.dma@gmail.com>
    committer-time 1353857234
    committer-tz +0400
    summary Initial commit. Add SWT, SWO, SWC.
    boundary
    filename ShowWordsConfig.hs
    5c84fe33852a0cd4dede51b96d642e782d782814 43 144 8
    author sgf
    author-mail <sgf.dma@gmail.com>
    author-time 1353857251
    author-tz +0400
    committer sgf
    committer-mail <sgf.dma@gmail.com>
    committer-time 1353857251
    committer-tz +0400
    summary Add SL.
    filename SgfList.hs
    f5b055331a37c17376983a953fa43a1bb9771032 22 231 6
    filename ShowWordsOutput.hs
    f5b055331a37c17376983a953fa43a1bb9771032 24 253 21
    filename ShowWordsConfig.hs
    4f0d505c923f8f407d41c2b446ab43838cbb19ed 36 320 29
    author sgf
    author-mail <sgf.dma@gmail.com>
    author-time 1353857353
    author-tz +0400
    committer sgf
    committer-mail <sgf.dma@gmail.com>
    committer-time 1353857353
    committer-tz +0400
    summary Add SOL.
    filename SgfOrderedLine.hs
    }}}

   }}}

4. Three '-C'. Lines, which have been last modified at commit C, will be
   searched in versions from commit C^ of all files at corresponding commit C.


   Example. {{{

   Example of three '-C' options and its difference from two '-C' have shown
   above under point 3. Though, here i want to ensure, that lines modified at
   some commit C are searched _only_ in files present at commit C (in the
   version of these files from commit C^ as explained above).

   History
    $ git log --oneline --name-status
    df9b947 Move from SWO to SW.
    M       ShowWords.hs
    M       ShowWordsOutput.hs
    9d3d1b1 Rm SWC.
    D       ShowWordsConfig.hs
    7b6375f Copy from SWC to SW. Add SW.
    A       ShowWords.hs
    3378c83 Initial commit. Add SWC, SWO.
    A       ShowWordsConfig.hs
    A       ShowWordsOutput.hs 

   Description of changes at commit 7b6375f:
    - Copy several lines from ShowWordsConfig to ShowWords.

   Description of changes at commit df9b947:
    - Move several lines from ShowWordsOutput to ShowWords.
    - Copy another several lines from deleted at previous commit (9d3d1b1)
      ShowWordsConfig to ShowWords.

   And all works as expected. One '-C' detects only move from ShowWordsOutput:

    $ git blame --incremental -C -- ShowWords.hs | grep filename
    filename ShowWords.hs
    filename ShowWords.hs
    filename ShowWords.hs
    filename ShowWords.hs
    filename ShowWordsOutput.hs
    $ git blame --incremental -C -- ShowWords.hs
    {{{
    df9b9476576f5d7bc1589842d04fd4ab2b7bdea2 214 214 21
    author sgf
    author-mail <sgf.dma@gmail.com>
    author-time 1353924633
    author-tz +0400
    committer sgf
    committer-mail <sgf.dma@gmail.com>
    committer-time 1353924633
    committer-tz +0400
    summary Move from SWO to SW.
    previous 9d3d1b1db9706b24993393deb335e6f822865310 ShowWords.hs
    filename ShowWords.hs
    7b6375ff9f04d49c03198091dc897f9c30833ac9 1 1 44
    author sgf
    author-mail <sgf.dma@gmail.com>
    author-time 1353924524
    author-tz +0400
    committer sgf
    committer-mail <sgf.dma@gmail.com>
    committer-time 1353924524
    committer-tz +0400
    summary Copy from SWC to SW. Add SW.
    filename ShowWords.hs
    7b6375ff9f04d49c03198091dc897f9c30833ac9 45 51 163
    filename ShowWords.hs
    7b6375ff9f04d49c03198091dc897f9c30833ac9 208 235 62
    filename ShowWords.hs
    3378c83a81aced612f54467927c2d6f1860289a1 22 45 6
    author sgf
    author-mail <sgf.dma@gmail.com>
    author-time 1353924387
    author-tz +0400
    committer sgf
    committer-mail <sgf.dma@gmail.com>
    committer-time 1353924387
    committer-tz +0400
    summary Initial commit. Add SWC, SWO.
    boundary
    filename ShowWordsOutput.hs
    }}}

   Two '-C' detects additionally copy from ShowWordsConfig at 7b6375f:

    $ git blame --incremental -C -C -- ShowWords.hs | grep filename
    filename ShowWords.hs
    filename ShowWords.hs
    filename ShowWords.hs
    filename ShowWords.hs
    filename ShowWords.hs
    filename ShowWordsOutput.hs
    filename ShowWordsConfig.hs
    $ git blame --incremental -C -C -- ShowWords.hs
    {{{
    df9b9476576f5d7bc1589842d04fd4ab2b7bdea2 214 214 21
    author sgf
    author-mail <sgf.dma@gmail.com>
    author-time 1353924633
    author-tz +0400
    committer sgf
    committer-mail <sgf.dma@gmail.com>
    committer-time 1353924633
    committer-tz +0400
    summary Move from SWO to SW.
    previous 9d3d1b1db9706b24993393deb335e6f822865310 ShowWords.hs
    filename ShowWords.hs
    7b6375ff9f04d49c03198091dc897f9c30833ac9 1 1 44
    author sgf
    author-mail <sgf.dma@gmail.com>
    author-time 1353924524
    author-tz +0400
    committer sgf
    committer-mail <sgf.dma@gmail.com>
    committer-time 1353924524
    committer-tz +0400
    summary Copy from SWC to SW. Add SW.
    filename ShowWords.hs
    7b6375ff9f04d49c03198091dc897f9c30833ac9 45 51 51
    filename ShowWords.hs
    7b6375ff9f04d49c03198091dc897f9c30833ac9 113 119 95
    filename ShowWords.hs
    7b6375ff9f04d49c03198091dc897f9c30833ac9 208 235 62
    filename ShowWords.hs
    3378c83a81aced612f54467927c2d6f1860289a1 22 45 6
    author sgf
    author-mail <sgf.dma@gmail.com>
    author-time 1353924387
    author-tz +0400
    committer sgf
    committer-mail <sgf.dma@gmail.com>
    committer-time 1353924387
    committer-tz +0400
    summary Initial commit. Add SWC, SWO.
    boundary
    filename ShowWordsOutput.hs
    3378c83a81aced612f54467927c2d6f1860289a1 7 102 17
    filename ShowWordsConfig.hs
    }}}

   And three '-C' still does not attribute another lines copied from deleted
   at 9d3d1b1 ShowWordsConfig to ShowWordsConfig:

    $ git blame --incremental -C -C -C -- ShowWords.hs | grep filename
    filename ShowWords.hs
    filename ShowWords.hs
    filename ShowWords.hs
    filename ShowWords.hs
    filename ShowWords.hs
    filename ShowWordsOutput.hs
    filename ShowWordsConfig.hs
    $ git blame --incremental -C -C -C -- ShowWords.hs
    {{{
    df9b9476576f5d7bc1589842d04fd4ab2b7bdea2 214 214 21
    author sgf
    author-mail <sgf.dma@gmail.com>
    author-time 1353924633
    author-tz +0400
    committer sgf
    committer-mail <sgf.dma@gmail.com>
    committer-time 1353924633
    committer-tz +0400
    summary Move from SWO to SW.
    previous 9d3d1b1db9706b24993393deb335e6f822865310 ShowWords.hs
    filename ShowWords.hs
    7b6375ff9f04d49c03198091dc897f9c30833ac9 1 1 44
    author sgf
    author-mail <sgf.dma@gmail.com>
    author-time 1353924524
    author-tz +0400
    committer sgf
    committer-mail <sgf.dma@gmail.com>
    committer-time 1353924524
    committer-tz +0400
    summary Copy from SWC to SW. Add SW.
    filename ShowWords.hs
    7b6375ff9f04d49c03198091dc897f9c30833ac9 45 51 51
    filename ShowWords.hs
    7b6375ff9f04d49c03198091dc897f9c30833ac9 113 119 95
    filename ShowWords.hs
    7b6375ff9f04d49c03198091dc897f9c30833ac9 208 235 62
    filename ShowWords.hs
    3378c83a81aced612f54467927c2d6f1860289a1 22 45 6
    author sgf
    author-mail <sgf.dma@gmail.com>
    author-time 1353924387
    author-tz +0400
    committer sgf
    committer-mail <sgf.dma@gmail.com>
    committer-time 1353924387
    committer-tz +0400
    summary Initial commit. Add SWC, SWO.
    boundary
    filename ShowWordsOutput.hs
    3378c83a81aced612f54467927c2d6f1860289a1 7 102 17
    filename ShowWordsConfig.hs
    }}}

   }}}


Appendix A. Here is repository, where blame (suprisingly) works for one line.

$ git log --oneline  --name-status
51a479e Changes from other files to f.
M       f
M       g
A       k
M       l
aac7be6 Add line to g, h, l.
M       g
M       h
M       l
e70bb4b Initail commit. Add f, g, h, l.
A       f
A       g
A       h
A       l

$ git log --oneline  -p | cat -
{{{
51a479e Changes from other files to f.
diff --git a/f b/f
index 3beb53d..bc7d86b 100644
--- a/f
+++ b/f
@@ -1 +1,5 @@
 green green green green green green green green green green green green green
+yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow
+cyan cyan cyan cyan cyan cyan cyan cyan cyan cyan cyan cyan cyan cyan cyan
+black black black black black black black black black black black black black
+purple purple purple purple purple purple purple purple purple purple purple
diff --git a/g b/g
index 6228ae4..538e316 100644
--- a/g
+++ b/g
@@ -1,2 +1 @@
 blue blue blue blue blue blue blue blue blue blue blue blue blue blue blue
-yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow
diff --git a/k b/k
new file mode 100644
index 0000000..c851261
--- /dev/null
+++ b/k
@@ -0,0 +1,2 @@
+red red red red red red red red red red red red red red red red red red red
+purple purple purple purple purple purple purple purple purple purple purple
diff --git a/l b/l
index 85edc30..eb6cf5a 100644
--- a/l
+++ b/l
@@ -1,2 +1,3 @@
 black black black black black black black black black black black black black
 grey grey grey grey grey grey grey grey grey grey grey grey grey grey grey
+silver silver silver silver silver silver silver silver silver silver silver
aac7be6 Add line to g, h, l.
diff --git a/g b/g
index 538e316..6228ae4 100644
--- a/g
+++ b/g
@@ -1 +1,2 @@
 blue blue blue blue blue blue blue blue blue blue blue blue blue blue blue
+yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow
diff --git a/h b/h
index 4d478d6..fe5f36f 100644
--- a/h
+++ b/h
@@ -1 +1,2 @@
 cyan cyan cyan cyan cyan cyan cyan cyan cyan cyan cyan cyan cyan cyan cyan
+magenta magenta magenta magenta magenta magenta magenta magenta magenta
diff --git a/l b/l
index ad61d2d..85edc30 100644
--- a/l
+++ b/l
@@ -1 +1,2 @@
 black black black black black black black black black black black black black
+grey grey grey grey grey grey grey grey grey grey grey grey grey grey grey
e70bb4b Initail commit. Add f, g, h, l.
diff --git a/f b/f
new file mode 100644
index 0000000..3beb53d
--- /dev/null
+++ b/f
@@ -0,0 +1 @@
+green green green green green green green green green green green green green
diff --git a/g b/g
new file mode 100644
index 0000000..538e316
--- /dev/null
+++ b/g
@@ -0,0 +1 @@
+blue blue blue blue blue blue blue blue blue blue blue blue blue blue blue
diff --git a/h b/h
new file mode 100644
index 0000000..4d478d6
--- /dev/null
+++ b/h
@@ -0,0 +1 @@
+cyan cyan cyan cyan cyan cyan cyan cyan cyan cyan cyan cyan cyan cyan cyan
diff --git a/l b/l
new file mode 100644
index 0000000..ad61d2d
--- /dev/null
+++ b/l
@@ -0,0 +1 @@
+black black black black black black black black black black black black black
}}}

$ git blame -f -n -C -C -C -- f | cat -
^e70bb4b f 1 (sgf 2012-11-23 21:32:27 +0400 1) green green green green green green green green green green green green green
51a479eb f 2 (sgf 2012-11-23 21:52:25 +0400 2) yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow
51a479eb f 3 (sgf 2012-11-23 21:52:25 +0400 3) cyan cyan cyan cyan cyan cyan cyan cyan cyan cyan cyan cyan cyan cyan cyan
51a479eb f 4 (sgf 2012-11-23 21:52:25 +0400 4) black black black black black black black black black black black black black
51a479eb f 5 (sgf 2012-11-23 21:52:25 +0400 5) purple purple purple purple purple purple purple purple purple purple purple
$ git blame -f -n -C -L2,2 -- f | cat -
aac7be6c g 2 (sgf 2012-11-23 21:36:17 +0400 2) yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow
$ git blame -f -n -C -C -C -L3,3 -- f | cat -
^e70bb4b h 1 (sgf 2012-11-23 21:32:27 +0400 3) cyan cyan cyan cyan cyan cyan cyan cyan cyan cyan cyan cyan cyan cyan cyan
$ git blame -f -n -C -L4,4 -- f | cat -
^e70bb4b l 1 (sgf 2012-11-23 21:32:27 +0400 4) black black black black black black black black black black black black black


Upd1. Several changes in point 2.

Комментариев нет:

Отправить комментарий