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

Re: [PATCH v2 4/4] fast-export: make sure refs are updated properly

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Oct 31, 2012, 00:11 UTC
Message-ID
<20121031001117.GA29486@elie.Belkin>
In-Reply-To
<1351623987-21012-5-git-send-email-felipe.contreras@gmail.com>

(cc-ing the git list) Felipe Contreras wrote:

Show 6 quoted lines
> When an object has already been exported (and thus is in the marks) it
> is flagged as SHOWN, so it will not be exported again, even if this time
> it's exported through a different ref.
>
> We don't need the object to be exported again, but we want the ref
> updated
Yes, makes perfect sense.
For what it's worth,
Acked-by: Jonathan Nieder <jrnieder@gmail.com>
[...]
Show 15 quoted lines
> --- a/t/t5800-remote-helpers.sh
> +++ b/t/t5800-remote-helpers.sh
> @@ -145,4 +145,15 @@ test_expect_failure 'push new branch with old:new refspec' '
>  	compare_refs clone HEAD server refs/heads/new-refspec
>  '
>  
> +test_expect_success 'push ref with existing object' '
> +	(cd localclone &&
> +	git branch point-to-master master &&
> +	git push origin point-to-master
> +	) &&
> +
> +	(cd server &&
> +	git show-ref refs/heads/point-to-master
> +	)
Style: if you indent like this, the test becomes clearer:
	(
		cd localclone &&
		git branch point-to-master master &&
		git push origin point-to-master
	) &&
	(
		cd server &&
		git rev-parse --verify refs/heads/point-to-master
	)
[...]
> +test_expect_success 'refs are updated even if no commits need to be exported' '
> +	git fast-export --import-marks=tmp-marks \
> +		--export-marks=tmp-marks master > /dev/null &&

The redirect just makes the test log with "-v" less informative, so I'd drop it.

> +	git fast-export --import-marks=tmp-marks \
> +		--export-marks=tmp-marks master > actual &&
> +	test_cmp expected actual

Redirections in git shell scripts are generally spelled as "do_something >actual", without a space between the operator and filename.

Hope that helps, Jonathan

Previous: Felipe ContrerasNext: Felipe Contreras
Message 6 of 21 in “fast-export: general fixes”
  1. 0/4 fast-export: general fixesFelipe Contreras, Oct 30, 2012
  2. 1/4 fast-export: trivial cleanupFelipe Contreras, Oct 30, 2012
  3. 2/4 fast-export: fix comparisson in testsFelipe Contreras, Oct 30, 2012
  4. 3/4 fast-export: don't handle uninteresting refsFelipe Contreras, Oct 30, 2012
  5. 4/4 fast-export: make sure refs are updated properlyFelipe Contreras, Oct 30, 2012
  6. Jonathan NiederOct 31, 2012
  7. Felipe ContrerasOct 31, 2012
  8. Jonathan NiederOct 31, 2012
  9. Sverre RabbelierOct 31, 2012
  10. Jonathan NiederOct 31, 2012
  11. [OT] How to get the discussion details via notesPeter Baumann, Oct 31, 2012
  12. Drew NorthupOct 31, 2012
  13. Jeff KingOct 31, 2012
  14. Peter BaumannNov 1, 2012
  15. Felipe ContrerasOct 31, 2012
  16. Jeff KingNov 2, 2012
  17. Jonathan NiederNov 2, 2012
  18. Johannes SchindelinNov 2, 2012
  19. Jeff KingNov 2, 2012
  20. Felipe ContrerasNov 2, 2012
  21. Felipe ContrerasNov 2, 2012

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.