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

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

 



On Fri, Aug 30, 2019 at 04:23:13PM +0300, Dmitry Nikulin wrote:
> On Fri, 30 Aug 2019 at 13:16, Phillip Wood <phillip.wood123@xxxxxxxxx> wrote:
> > I'm not sure why the last argument is being split in
> > your example. It is not split in the example below
> 
> I have replicated the splitting issue on my small demo repo [1]:
> 
> $ env GIT_EXTERNAL_DIFF=./print_argv.py git diff -M origin/branch1
> origin/branch1-mv -- file1.txt file1-mv.txt
> ['./print_argv.py',
>  'file1.txt',
>  '/tmp/EWaCSc_file1.txt',
>  '2bef330804cb3f6962e45a72a12a3071ee9b5888',
>  '100644',
>  '/tmp/mtEiSc_file1-mv.txt',
>  'f8fd6737fbe5a45c97ba9c9de495dc46ff11eccd',
>  '100644',
>  'file1-mv.txt',
>  'similarity index 90%\n'
>  'rename from file1.txt\n'
>  'rename to file1-mv.txt\n'
>  'index 2bef330..f8fd673 100644\n']

Another Python 2 vs 3 issue, perhaps?

  # Python2, good:
  $ GIT_EXTERNAL_DIFF='python2 ./print_argv.py' git --no-pager diff -M origin/branch1 origin/branch1-mv  -- file1.txt file1-mv.txt
  ['./print_argv.py',
   'file1.txt',
   '/tmp/ViB58B_file1.txt',
   '2bef330804cb3f6962e45a72a12a3071ee9b5888',
   '100644',
   '/tmp/p6OH9B_file1-mv.txt',
   'f8fd6737fbe5a45c97ba9c9de495dc46ff11eccd',
   '100644',
   'file1-mv.txt',
   'similarity index 90%\nrename from file1.txt\nrename to
  file1-mv.txt\nindex 2bef330..f8fd673 100644\n']
  # Python3, bad:
  $ GIT_EXTERNAL_DIFF='python3 ./print_argv.py' git --no-pager diff -M origin/branch1 origin/branch1-mv  -- file1.txt file1-mv.txt
  ['./print_argv.py',
   'file1.txt',
   '/tmp/5xD2DS_file1.txt',
   '2bef330804cb3f6962e45a72a12a3071ee9b5888',
   '100644',
   '/tmp/vvHQGS_file1-mv.txt',
   'f8fd6737fbe5a45c97ba9c9de495dc46ff11eccd',
   '100644',
   'file1-mv.txt',
   'similarity index 90%\n'
   'rename from file1.txt\n'
   'rename to file1-mv.txt\n'
   'index 2bef330..f8fd673 100644\n']

Let's just stick to plain old printf for now, as suggested by Phillip
earlier, to reduce unnecessary confusion.




[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