git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 2/3] fast-export: add new --refspec option

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
May 9, 2013, 22:53 UTC
Message-ID
<CAMP44s2yoBFZU+LzHWT30ijbQ2rknmV1ZoB9qDDYvvme2chB7g@mail.gmail.com>
In-Reply-To
<7vvc6r7pii.fsf@alter.siamese.dyndns.org>
On Thu, May 9, 2013 at 5:32 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 46 quoted lines
> 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.

Of course, but how do you implement that? That's mixing refspecs and revlist arguments, which AFAIK don't mix:

% git fast-export ^next:new-next master:new-master --not refs/tags/*:refs/tags/backup/*

-- 
Felipe Contreras
Previous: Junio C HamanoNext: Junio C Hamano
Message 10 of 19 in “Support for old:new remote-helper push”
  1. 0/3 Support for old:new remote-helper pushFelipe Contreras, May 9, 2013
  2. 1/3 fast-export: improve argument parsingFelipe Contreras, May 9, 2013
  3. Junio C HamanoMay 9, 2013
  4. Felipe ContrerasMay 9, 2013
  5. Junio C HamanoMay 9, 2013
  6. Felipe ContrerasMay 9, 2013
  7. Junio C HamanoMay 10, 2013
  8. 2/3 fast-export: add new --refspec optionFelipe Contreras, May 9, 2013
  9. Junio C HamanoMay 9, 2013
  10. Felipe ContrerasMay 9, 2013
  11. Junio C HamanoMay 9, 2013
  12. Felipe ContrerasMay 9, 2013
  13. Junio C HamanoMay 10, 2013
  14. Felipe ContrerasMay 10, 2013
  15. Junio C HamanoMay 10, 2013
  16. Johannes SixtMay 10, 2013
  17. Felipe ContrerasMay 16, 2013
  18. 3/3 transport-helper: add support for old:new refspecFelipe Contreras, May 9, 2013
  19. Felipe ContrerasMay 16, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.