From: Junio C Hamano <gitster@pobox.com>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: Daniel Barkalow <barkalow@iabervon.org>,
Linus Torvalds <torvalds@linux-foundation.org>,
Chris Ortman <chrisortman@gmail.com>,
git@vger.kernel.org
Subject: Re: [PATCH v2] Do not show "diff --git" metainfo with --no-prefix
Date: Wed, 16 Jan 2008 18:28:09 -0800 [thread overview]
Message-ID: <7vzlv5kwxy.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <alpine.LSU.1.00.0801170151040.17650@racer.site> (Johannes Schindelin's message of "Thu, 17 Jan 2008 01:54:16 +0000 (GMT)")
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
>> No, what you are talking about is a need of negative prefix, which you
>> did not implement in that no/src/dst-prefix patch.
>
> I'm probably missing something, but wouldn't a "diff --git gitk-git/gitk
> gitk-git/gitk" instead of "diff --git a/gitk-git/gitk b/gitk-git/gitk" in
> mbox format be directly grokkable by git-am?
>
>> Using --no-prefix is a _hack_ that may happen to work only when
>> the subtree-merged project is one level down.
>
> Yep. But my point was more to show that it is still a valid git diff.
My point was that the validness you mentined above is a
happenstance, and not a result of a good design.
After I move gitk-git one level down to modules/gitk but before
making it as a submodule, the output with --no-prefix will say
"diff --git modules/gitk/gitk modules/gitk/gitk", and that will
not be a suitable diff for Paul to apply to his tree.
I think he needs "-p2", but then he can already do that to diffs
produced without using your --no-prefix that talks about "diff
--git a/gitk-git/gitk b/gitk-git/gitk". IOW, --no-prefix is not
a solution to anything.
And that is why I keep calling your "--no-prefix happens to work
if you are only talking about a project that is subtree-merged
one level down" argument a _hack_.
If we were to do this properly in "git diff", we would:
- introduce a separate --strip-paths=1 (or whatever number of
levels of leading prefix);
- not use --{src,dst,no}-prefix
and you would do:
$ git diff --strip-paths=1 gitk-git
in the current tree, which would first strip one path component
and then do the usual opt->a_prefix/b_prefix thing to show:
diff --git a/gitk b/gitk
Similarly you would run:
$ git diff --strip-paths=2 modules/gitk
after I move gitk-git down one level.
An alternative would be to use the jc/diff-relative topic
currently parked in 'offcuts' branch, and run:
$ cd gitk-git && git diff .
or
$ cd modules/gitk && git diff .
which would give diffs in relative paths.
next prev parent reply other threads:[~2008-01-17 2:29 UTC|newest]
Thread overview: 53+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-15 13:59 [FEATURE REQUEST] git-svn format-patch Chris Ortman
2008-01-15 14:45 ` Johannes Schindelin
2008-01-15 15:58 ` Chris Ortman
2008-01-15 16:13 ` Johannes Schindelin
2008-01-15 16:23 ` Chris Ortman
2008-01-15 16:52 ` Johannes Schindelin
2008-01-15 17:07 ` Chris Ortman
2008-01-15 17:11 ` Johannes Schindelin
2008-01-15 19:04 ` Chris Ortman
2008-01-15 20:15 ` Jan Hudec
2008-01-16 6:41 ` Miles Bader
2008-01-16 6:54 ` Shawn O. Pearce
2008-01-15 17:10 ` Pascal Obry
2008-01-15 23:11 ` Daniel Barkalow
2008-01-16 0:19 ` Junio C Hamano
2008-01-16 0:58 ` [PATCH/RFC] Do not show "diff --git" metainfo with --no-prefix Junio C Hamano
2008-01-16 1:37 ` Johannes Schindelin
2008-01-16 1:46 ` Junio C Hamano
2008-01-16 1:53 ` Johannes Schindelin
2008-01-16 2:04 ` Daniel Barkalow
2008-01-16 2:15 ` Junio C Hamano
2008-01-16 2:08 ` [PATCH v2] " Junio C Hamano
2008-01-16 3:09 ` Linus Torvalds
2008-01-16 3:26 ` Linus Torvalds
2008-01-16 4:04 ` Daniel Barkalow
2008-01-16 4:22 ` Linus Torvalds
2008-01-16 20:19 ` Junio C Hamano
2008-01-16 20:39 ` Daniel Barkalow
2008-01-17 0:57 ` Junio C Hamano
2008-01-17 1:11 ` Johannes Schindelin
2008-01-17 1:19 ` Junio C Hamano
2008-01-17 1:54 ` Johannes Schindelin
2008-01-17 2:28 ` Junio C Hamano [this message]
2008-01-17 1:34 ` Junio C Hamano
2008-01-17 1:48 ` Johannes Schindelin
2008-01-17 2:42 ` Junio C Hamano
2008-01-17 2:45 ` Johannes Schindelin
2008-01-17 14:49 ` Jeff King
2008-01-17 15:03 ` Jeff King
2008-01-17 15:12 ` Johannes Schindelin
2008-01-17 15:18 ` Jeff King
2008-01-18 8:22 ` Junio C Hamano
2008-01-16 17:22 ` Junio C Hamano
2008-01-16 3:56 ` Daniel Barkalow
2008-01-19 9:36 ` Jan Hudec
2008-01-16 4:18 ` Junio C Hamano
2008-01-16 2:01 ` [FEATURE REQUEST] git-svn format-patch Chris Ortman
2008-01-15 20:14 ` Jean-Luc Herren
2008-01-15 20:30 ` Chris Ortman
2008-01-16 2:20 ` Daniel Barkalow
2008-03-11 17:38 ` Nigel Magnay
2008-03-11 19:22 ` Jan Hudec
2008-03-12 4:38 ` Daniel Barkalow
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7vzlv5kwxy.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=barkalow@iabervon.org \
--cc=chrisortman@gmail.com \
--cc=git@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).