git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Theodore Tso <tytso@mit.edu>
Cc: Francis Moreau <francis.moro@gmail.com>,
	Mike Hommey <mh@glandium.org>,
	Shawn Bohrer <shawn.bohrer@gmail.com>,
	git@vger.kernel.org
Subject: Re: Confusion about diffing branches
Date: Mon, 27 Aug 2007 10:20:42 -0700	[thread overview]
Message-ID: <7vmywczyfp.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <20070827170504.GH4680@thunk.org> (Theodore Tso's message of "Mon, 27 Aug 2007 13:05:04 -0400")

Theodore Tso <tytso@mit.edu> writes:

> The bigger inconsistency is with git-format-patch, which *does* take a
> set of commits, and where "git-format-patch a" does operates on a very
> different set of commits than what what "git-rev-list a" returns.  I
> understand that for backwards compatibility "git-format-patch a" is
> equivalent to "git-format-patch a..HEAD", but what it means is that
> all other ways of specifying sets of commits work with
> git-format-patch, *except* if you want to specify all commits from the
> beginning of time to a particular head (i.e., "git-rev-list a") is
> something that you simply can not possibly do using git-format-patch.

Heh, I really hate when people say this.

If you wanted to, you could:

	$ git format-patch a a

The original syntax

	$ git format-patch upstream

may have been a mistake and maybe

	$ git format-patch ^upstream

or even        

	$ git format-patch --since upstream

might have been better.  It is (1) too late to change now, and
(2) for too small or perhaps negative a gain.

The reason why I say (2) is because _I_ think it is far more
common and frequent to want to get "patches the other guy does
not have" than "everything since nothingness up to this point".

Oops.  I think I have a solution.

	$ git format-patch a a

does not do _ROOT_ commit.  So you have to say

	$ git format-patch --root a a

for the above example to work.  Why not tweak the option parser
so that:

	$ git format-patch --root a

to do what you want?  Without --root and with a single positive
commit, it can keep doing the traditional "what I did since I
forked from that guy's history".

Hmm...

  reply	other threads:[~2007-08-27 17:20 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-26 23:35 Confusion about diffing branches Shawn Bohrer
2007-08-27  0:18 ` Junio C Hamano
2007-08-27  1:40   ` Shawn Bohrer
2007-08-27  6:25     ` Mike Hommey
2007-08-27  7:07     ` Junio C Hamano
2007-08-27  7:50       ` Mike Hommey
2007-08-27 13:21         ` Francis Moreau
2007-08-27 13:33           ` Mike Hommey
2007-08-27 17:06             ` Junio C Hamano
2007-08-27 17:24               ` Mike Hommey
2007-08-27 17:05           ` Theodore Tso
2007-08-27 17:20             ` Junio C Hamano [this message]
2007-08-27 20:29               ` Theodore Tso
2007-08-27 22:20     ` 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=7vmywczyfp.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=francis.moro@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=mh@glandium.org \
    --cc=shawn.bohrer@gmail.com \
    --cc=tytso@mit.edu \
    /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).