Re: git-diff passes <rev>:<path> args to GIT_EXTERNAL_DIFF incorrectly?

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

 



I've figured it out. It's not a bug, it's a peculiarity of pprint().
It splits strings to avoid long lines and abuses the fact that in
Python strings split with whitespace are concatenated by the parser.

Also, in my example newlines are not parsed correctly in the shell.
Escaping them, I get the exact same behavior as in
subprocess.check_call():

$ python2 print_argv.py $'similarity index 90%\nrename from
file1.txt\nrename to file1-mv.txt\nindex 2bef330..f8fd673 100644\n'
['print_argv.py',
 'similarity index 90%\nrename from file1.txt\nrename to
file1-mv.txt\nindex 2bef330..f8fd673 100644\n']
$ python3 print_argv.py $'similarity index 90%\nrename from
file1.txt\nrename to file1-mv.txt\nindex 2bef330..f8fd673 100644\n'
['print_argv.py',
 'similarity index 90%\n'
 'rename from file1.txt\n'
 'rename to file1-mv.txt\n'
 'index 2bef330..f8fd673 100644\n']



[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