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

phpdoc diff in git -L is not the correct one

From
Grégoire PARIS <postmaster@greg0ire.fr>
Date
Nov 14, 2020, 13:19 UTC
Message-ID
<348a2a4a-dfdb-190b-edac-01e9ad4c2d4d@greg0ire.fr>
Hello,

I have recently found out about git -L , which is great! I think I have found a bug in it though: the diff is correct on the method itself, but changes in the phpdoc of the method do not seem to be taken into account, while changes in the phpdoc of the method that follows the one I care about show up in the diff. I have attached a bug report generated with git bugreport.

Regards,
-- 
greg0ire



Thank you for filling out a Git bug report!
Please answer the following questions to help us understand your issue.

What did you do before the bug happened? (Steps to reproduce your issue)

echo '*.php diff=php' > ~/.config/git/attributes
git clone git@github.com:doctrine/instantiator.git
cd instantiator
git log -L :instantiate:src/Doctrine/Instantiator/Instantiator.php

What did you expect to happen? (Expected behavior)

See changes that happened in the phpdoc of the instantiate() method appear in
the log.

What happened instead? (Actual behavior)

I saw changes that happened in the phpdoc of the buildAndCacheFromFactory()
method, which is the one right after the instantiate() method

What's different between what you expected and what actually happened?

The phpdoc being diffed.

Anything else you want to add:

Showing changes of the phpdoc of the method might not be easy to implement, but
I think not showing changes of the phpdoc of the next method should be.

Please review the rest of the bug report below.
You can delete any lines you don't wish to share.

[System Info]
git version:
git version 2.28.0
cpu: x86_64
no commit associated with this build
sizeof-long: 8
sizeof-size_t: 8
shell-path: /bin/sh
uname: Linux 5.8.16-300.fc33.x86_64 #1 SMP Mon Oct 19 13:18:33 UTC 2020 x86_64
compiler info: gnuc: 10.2
libc info: glibc: 2.32
$SHELL (typically, interactive shell): /bin/zsh


[Enabled Hooks]
pre-commit
post-commit
post-checkout
post-merge
pre-push
post-rewrite
Next: Martin Ågren
Message 1 of 7 in “phpdoc diff in git -L is not the correct one”
  1. Grégoire PARISNov 14, 2020
  2. Martin ÅgrenNov 14, 2020
  3. Grégoire PARISNov 14, 2020
  4. Martin ÅgrenNov 14, 2020
  5. René ScharfeNov 14, 2020
  6. Grégoire PARISNov 18, 2020
  7. Martin ÅgrenNov 18, 2020

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.