git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [BUG] Spurious leading '/' in filename in "git diff --raw --relative=<subdirectory>"
@ 2010-07-05  8:15 Jakub Narebski
  2010-07-05 15:44 ` Jakub Narebski
  0 siblings, 1 reply; 10+ messages in thread
From: Jakub Narebski @ 2010-07-05  8:15 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano

I wanted to get non-recursive raw diff (difftree), but for a given
subdirectory and not starting from root.  

I have found '--relative[=<path>]', introduced in 

  c0cb4a0 (diff --relative: help working in a bare repository, 2008-02-13)
  cd676a5 (diff --relative: output paths as relative to the current subdirectory, 2008-02-12)

But when examining it's output in 'raw' mode, I have notice spurious
leading '/' in filename:

  $ git diff-tree --abbrev -r --raw HEAD --relative=sub
  a3a8425fe5496c61921010cb1e7b455a1f52bb86
  :100644 100644 d90bda0... cefcae0... M	/quux

The output without '-r' (recurse into sub-trees) is even more strange

  $ git diff-tree --abbrev --raw HEAD --relative=sub
  a3a8425fe5496c61921010cb1e7b455a1f52bb86
  :040000 040000 e62aa6e... b5d4a43... M	

(that's a trailing TAB, and no filename).

What I expected was the following output:

  $ git diff-tree --abbrev --raw HEAD --relative=sub
  a3a8425fe5496c61921010cb1e7b455a1f52bb86
  :040000 040000 e62aa6e... b5d4a43... M	quux


I see that the '--relative' and '--relative=<path>' options were introduced
for patch ('-p') format, and not for difftree / raw format, but I think
they should work for it, too.


P.S. I have noticed this bug when working on proof-of-concept tree-blame
(i.e. when given file was modified) in Perl.
-- 
Jakub Narebski
Poland

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2010-08-09 15:00 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-05  8:15 [BUG] Spurious leading '/' in filename in "git diff --raw --relative=<subdirectory>" Jakub Narebski
2010-07-05 15:44 ` Jakub Narebski
2010-07-08 11:00   ` [BUG/RFC] Raw diff output format (git-diff-tree) and --relative[=<path>] option Jakub Narebski
2010-07-08 11:41     ` Jeff King
2010-07-08 12:11       ` Jakub Narebski
2010-07-08 12:19       ` Jakub Narebski
2010-07-08 14:23         ` Jeff King
2010-07-08 14:56           ` Jakub Narebski
2010-08-09 14:50             ` Jeff King
2010-08-09 14:59             ` Jeff King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).