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

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

What version arcanist are you running?

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

alexmv claimed this task.