All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Felipe Contreras <felipe.contreras@gmail.com>
Cc: git@vger.kernel.org, Jeff King <peff@peff.net>,
	Elijah Newren <newren@gmail.com>,
	Sverre Rabbelier <srabbelier@gmail.com>
Subject: Re: [PATCH 2/3] fast-export: add new --refspec option
Date: Thu, 09 May 2013 15:32:53 -0700	[thread overview]
Message-ID: <7vvc6r7pii.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <1368063095-22861-3-git-send-email-felipe.contreras@gmail.com> (Felipe Contreras's message of "Wed, 8 May 2013 20:31:34 -0500")

Felipe Contreras <felipe.contreras@gmail.com> writes:

> +test_expect_success 'use refspec' '
> +	git fast-export --refspec refs/heads/master:refs/heads/foobar master | \
> +		grep "^commit " | sort | uniq > actual &&

You do not need backslash after the pipe symbol at the end of line;
the shell knows you haven't finished speaking at that point.

The usual "pipe hides the error status of upstream commands" applies
here.  The command may die after writing enough to fill the pipe
buffer and showing the lines that begin with "commit".

Also it makes it harder to debug the test when something goes wrong.

By the way, don't you find that something does not feel quite right
with this command line?

    git fast-export --refspec=refs/heads/master:refs/heads/foobar master 

Why do we even have to say "master" at the end, when the other
option makes it clear that we are shipping "master" out?

Without thinking ramifications through, my gut feeling is that it
would feel more natural if we took:

    git fast-export master:foobar

to mean the same thing (which is what happens to the users of "git
push").  Is there a case where you have some ref on the left hand
side of the --refspec but you do not push out the history leading to
it?

With such an update, this part of the test would of course look
like:

	git fast-export master:foobar >actual.dump &&
        grep "^commit " actual.dump |
        sort -u >actual &&
        ...

and we do not need a new option.  Just a new extension to express
what gets pushed out.

But of course I may be missing some cases why there need to be a
separate option.

  reply	other threads:[~2013-05-09 22:56 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-09  1:31 [PATCH 0/3] Support for old:new remote-helper push Felipe Contreras
2013-05-09  1:31 ` [PATCH 1/3] fast-export: improve argument parsing Felipe Contreras
2013-05-09 22:17   ` Junio C Hamano
2013-05-09 23:02     ` Felipe Contreras
2013-05-09 23:27       ` Junio C Hamano
2013-05-09 23:33         ` Felipe Contreras
2013-05-10  4:49           ` Junio C Hamano
2013-05-09  1:31 ` [PATCH 2/3] fast-export: add new --refspec option Felipe Contreras
2013-05-09 22:32   ` Junio C Hamano [this message]
2013-05-09 22:53     ` Felipe Contreras
2013-05-09 23:23       ` Junio C Hamano
2013-05-09 23:32         ` Felipe Contreras
2013-05-10  0:21           ` Junio C Hamano
2013-05-10  0:44             ` Felipe Contreras
2013-05-10  1:13             ` Junio C Hamano
2013-05-10  6:42               ` Johannes Sixt
2013-05-16  9:15               ` Felipe Contreras
2013-05-09  1:31 ` [PATCH 3/3] transport-helper: add support for old:new refspec Felipe Contreras
2013-05-16  9:15 ` [PATCH 0/3] Support for old:new remote-helper push Felipe Contreras

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=7vvc6r7pii.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=felipe.contreras@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=newren@gmail.com \
    --cc=peff@peff.net \
    --cc=srabbelier@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.