Parsing diff --git lines

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'm working on a GUI for git, and I'd like to be able to provide
some diff navigation tools. That requires that I can find the
file chunks in a diff, and parse out the file names.

However, I don't see a reliable way to identify the two files
from a "diff --git" line. Here's a (deliberately pathological)
example:

diff --git a/a / b/file with spaces.txt b/a / b/file with spaces.txt

In this case, the repository contains directories called "a " and
" b" and the file names have spaces in.

What would make this possible would be either to always quote
file paths containing spaces, or use a character other than
a space (e.g. a \t) between the two file names.

Thanks
Simon

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux