Page MenuHomePhabricator

git diff parsing fails with --submodule=log
Closed, ResolvedPublic


If you make a change to a submodule and use the alternative formatting for submodules in git diff, arcanist fails to parse the diff output.

Repro steps:

# enable git diff --submodule=log by default
$ git config --global diff.submodule log

# now make a change to a submodule (e.g. updating it)
$ cd my-git-submodule
$ git checkout master
$ git pull
$ cd ..

# invoke a command that tries to parse the git diff output
$ arc lint

# most notably this affects arc diff
$ git commit -am 'updating my-git-submodule'
$ arc diff
# fill in review details, submit for review
# see: "Diff Parse Exception: ..."

Event Timeline

minyoung created this task.Apr 26 2016, 9:21 PM

Knowing what the problem is, the workaround is obvious (remove the relevant git config option).

The fix also seems quite easy though, add --submodule=short to ArcanistGitAPI.getDiffBaseOptions

chad added a subscriber: chad.Apr 26 2016, 9:29 PM

What version arcanist are you running?

shandor added a subscriber: shandor.Nov 3 2016, 1:04 PM

Just encountered this problem on my setup too.

arcanist rARC9e82ef979e8148c43b9b8439025d505b1219e213 (25 Aug 2016)
libphutil rPHU491ebc74d816dbe2fc8bbbbc992e8a14f8c613be (29 Aug 2016)

I guess one should not be surprised that anything at all does not work with git submodules. On the other hand it'd be nice if arcanist behaved nicely here, to take away at least some of the pain with them.

Thanks for the workaround, @minyoung

epriestley moved this task from Backlog to vNext on the Arcanist board.Nov 14 2016, 5:47 PM
alexmv closed this task as Resolved.Feb 14 2017, 1:40 AM
alexmv claimed this task.