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

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

From
Junio C Hamano <gitster@pobox.com>
Date
May 9, 2013, 22:32 UTC
Message-ID
<7vvc6r7pii.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1368063095-22861-3-git-send-email-felipe.contreras@gmail.com>
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.

Previous: Felipe ContrerasNext: Felipe Contreras
Message 9 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.