On doing git diff --stat some files are listed with full path from repository base but some files are listed as:
.../short/path/to/filename.
That is the path starts with ... and only short path is shown.
I would like git diff to list full file path for all files for it to be easily processed by a script. Is there some way I can get git diff to always show full path
By default
git difftruncates its output to fit into a 80-column terminal.You can override this by specifying values using the
--statoption:For example, by setting the output value to a very large number:
Note that produces the path relative to the root of the git repository.
(For scripting you might want to use
git diff-treedirectly since it’s more of a "plumbing" command, although I suspect you’ll be fine either way. Note that you need the same extra text with--statwhen usinggit diff-tree. The essential difference between using thegit diff"porcelain" front end, and thegit diff-treeplumbing command, is thatgit difflooks up your configured settings for options likediff.renamesto decide whether to do rename detection. Well, that, plus the front endgit diffwill do the equivalent ofgit diff-indexif you’re comparing a commit with the index, for instance. In other words,git diffreads your config and invokes the right plumbing automatically.)