From: Junio C Hamano <gitster@pobox.com>
To: Marcus Griep <neoeinstein@gmail.com>
Cc: Daniel Barkalow <barkalow@iabervon.org>,
Git Mailing List <git@vger.kernel.org>
Subject: Re: Call Me Gitless
Date: Mon, 18 Aug 2008 23:47:44 -0700 [thread overview]
Message-ID: <7vmyj9h567.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <48AA4430.3060207@gmail.com> (Marcus Griep's message of "Mon, 18 Aug 2008 23:55:28 -0400")
Marcus Griep <neoeinstein@gmail.com> writes:
> Junio C Hamano wrote:
>
>> This implements Daniel's idea to indicate what are compared by using
>> prefix different from the traditional a/ and b/ in the textual diff
>> header:
>>
>> "git diff" compares the (i)ndex and the (w)ork tree;
>> "git diff HEAD" compares a (c)ommit and the (w)ork tree;
>> "git diff --cached" compares a (c)ommit and the (i)ndex;
>> "git diff HEAD:f /tmp/f" compares an (o)bject and (w)ork tree.
>>
>> Because these mnemonics now have meanings, they are swapped when reverse
>> diff is in effect.
>
> I like this proposal-ish; making the prefixes more intuitive could be
> useful when looking at a bare diff from git too. I'd put some time in
> to help implement this.
What I did not bother in the patch is --no-index codepath, but with the
recent refactoring of it to separate it out from the normal "index vs work
tree" codepath, I would expect it to be trivial to use "1/" vs "2/" (or
"old/" and "new/") prefixes for them. I didn't actually look, though.
I also left "-c" and "--cc" unmodified. Daniel's "have many patches to
apply, but cannot readily tell in which direction they were generated"
use-case won't involve them, and reverse diff won't make sense with --cc,
so that should be Ok.
And obviously I didn't adjust the test vectors and documentation, which is
needed if somebody is serious enough about actually making this part of
the official system.
But be warned that this has two downsides, one minor, and one rather
major:
* Using non-standard prefix affects git-patch-id output. This would not
affect "git-format-patch --ignore-if-in-upstream", "git-cherry",
"git-rebase" because they all use internal patch-id generation, but
third party scripts that feed patches to "git-patch-id" and compare its
output with precomputed patch-id database to cull duplicates will be
affected.
* Similarly, scripts that assume more about "git diff" output than that
they are meant to be applied with depth 1 may break.
I think gitweb would be Ok, because I do not think it would try parsing
a textual diff, stripping out a/ (or b/), to figure out the paths being
affected. Even if it did, it would be doing two-tree form (iow, it
does not use working tree at all) which I deliberately kept to use a/
vs b/ with my patch, so it should be fine. I do not offhand recall how
cvsserver generates its diff output, but it would also be fine as the
server side would do two-tree form and nothing else.
But nobody knows what third-party scripts are assuming. They may be
parsing the pathnames, stripping a/ and b/ away.
next prev parent reply other threads:[~2008-08-19 6:49 UTC|newest]
Thread overview: 67+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-18 0:02 Call Me Gitless Trans
2008-08-18 0:28 ` Benjamin Sergeant
2008-08-18 0:40 ` Martin Langhoff
2008-08-18 8:50 ` Pascal Obry
2008-08-18 16:43 ` Jon Loeliger
2008-08-18 19:22 ` Daniel Barkalow
2008-08-18 20:17 ` Marcus Griep
2008-08-18 20:20 ` Junio C Hamano
2008-08-18 21:31 ` Daniel Barkalow
2008-08-18 22:30 ` Junio C Hamano
2008-08-18 23:12 ` Daniel Barkalow
2008-08-19 3:22 ` Junio C Hamano
2008-08-19 3:55 ` Marcus Griep
2008-08-19 6:47 ` Junio C Hamano [this message]
2008-08-19 7:02 ` Junio C Hamano
2008-08-20 8:00 ` [PATCH v2] diff: vary default prefix depending on what are compared Junio C Hamano
2008-08-20 9:06 ` Jakub Narebski
2008-08-19 6:28 ` Call Me Gitless Stephen R. van den Berg
2008-08-19 11:42 ` Jakub Narebski
2008-08-19 18:18 ` Junio C Hamano
2008-08-19 17:52 ` Jeff King
2008-08-19 18:39 ` Daniel Barkalow
2008-08-19 18:45 ` Jeff King
2008-08-19 18:57 ` Daniel Barkalow
2008-08-19 19:01 ` Jeff King
2008-08-19 19:42 ` Daniel Barkalow
2008-08-19 20:33 ` Petr Baudis
2008-08-19 21:49 ` Daniel Barkalow
2008-08-19 19:43 ` Junio C Hamano
2008-08-19 7:25 ` Junio C Hamano
2008-08-19 19:22 ` Daniel Barkalow
2008-08-21 3:40 ` Sverre Hvammen Johansen
2008-08-21 8:41 ` Junio C Hamano
2008-08-21 8:43 ` [PATCH 1/3] sha1_object_info(): pay attention to cached objects Junio C Hamano
2008-08-21 8:43 ` [PATCH 2/3] cached_object: learn empty blob Junio C Hamano
2008-08-21 8:44 ` [PATCH 3/3] git-add --intent-to-add (-N) Junio C Hamano
2008-08-21 14:23 ` Paolo Bonzini
2008-08-21 21:14 ` Jonathan Nieder
2008-08-22 4:10 ` Jonathan Nieder
2008-08-22 4:34 ` Daniel Barkalow
2008-08-22 4:59 ` Junio C Hamano
2008-08-22 5:32 ` Jonathan Nieder
2008-08-22 5:59 ` Junio C Hamano
2008-08-22 6:38 ` Jonathan Nieder
2008-08-22 7:52 ` Jonathan Nieder
2008-08-21 13:58 ` Call Me Gitless Daniel Barkalow
2008-08-18 23:24 ` Tarmigan
2008-08-19 0:32 ` Daniel Barkalow
2008-08-19 0:45 ` Tarmigan
2008-08-19 7:53 ` "Peter Valdemar Mørch (Lists)"
2008-08-19 8:01 ` Junio C Hamano
2008-08-19 8:10 ` Imran M Yousuf
2008-08-19 8:26 ` "Peter Valdemar Mørch (Lists)"
2008-08-19 8:53 ` Imran M Yousuf
2008-08-19 8:57 ` Alexander E Genaud
2008-08-19 9:11 ` Matthieu Moy
2008-08-19 9:36 ` Mike Hommey
2008-08-19 10:09 ` Alexander E Genaud
2008-08-19 11:27 ` Pascal Obry
2008-08-21 14:15 ` Paolo Bonzini
2008-08-22 19:10 ` Elijah Newren
2008-08-19 10:16 ` "Peter Valdemar Mørch (Lists)"
2008-08-19 11:31 ` Mark Struberg
2008-08-19 12:04 ` Alexander E Genaud
2008-08-19 18:15 ` Junio C Hamano
2008-08-19 8:56 ` Teemu Likonen
2008-08-19 13:15 ` Jakub Narebski
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=7vmyj9h567.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=barkalow@iabervon.org \
--cc=git@vger.kernel.org \
--cc=neoeinstein@gmail.com \
/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).