Re: [BUG/RFC] Raw diff output format (git-diff-tree) and --relative[=<path>] option

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

 



On Thu, Jul 08, 2010 at 02:19:42PM +0200, Jakub Narebski wrote:

> Nevertheless for the patch output format both "git diff --relative=sub"
> and "git diff --relative=sub/" give the same output, without 'b//quux'.
> The same IMHO should be done for raw output format, so we don't have
> '/quux' but 'quux'.

Hmm. That is because the diff output properly eliminates the double "/".
But AFAICT, all of the following do what I would expect:

  git diff --relative=sub
  git diff --relative=sub/ ;# same as above
  git diff --relative=foo- ;# yields "a/10" for file "foo-10"

Doing

  git diff --relative=sub --stat

shows the same issue as your --raw version, as does --name-only. I think
the right solution is to clean up a leading "/" for those cases. That
leaves the possibility for non-directory prefixes, but should do what
the user wants in the directory case (since a leading "/" is
nonsensical).

Or was that what you had in mind the whole time? My impression was that
you wanted --relative=foo to always be equivalent to --relative=foo/.
The subtle difference is that I want the "/" removed only if it is the
next character (or another way of thinking about it is to append "/" to
the prefix only if it is an actual directory).

-Peff
--
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]