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

Re: [PATCH v3] receive-pack: Create a HEAD ref for ref namespace

From
Johannes Löthberg <johannes@kyriasis.com>
Date
Jun 5, 2015, 17:27 UTC
Message-ID
<20150605172736.GA30419@leeloo.kyriasis.com>
In-Reply-To
<xmqqh9qmrs2j.fsf@gitster.dls.corp.google.com>
On 05/06, Junio C Hamano wrote:
Show 9 quoted lines
>Johannes Löthberg <johannes@kyriasis.com> writes:
>
>> +
>> +		echo "ref: refs/namespaces/new_namespace/refs/heads/master" >expect &&
>> +		test_cmp expect ../bare/refs/namespaces/new_namespace/HEAD  &&
>
>Use "symbolic-ref refs/namespaces/new_namespace/HEAD"; HEAD is not
>required to be expressed as a textual symref.
>
Gotcha.
Show 21 quoted lines
>> +
>> +		(
>> +			printf "%s commit\t%s\n" $(git rev-parse master^) \
>> +			                         refs/heads/master &&
>> +			printf "%s commit\t%s\n" $(git rev-parse master) \
>> +			                         refs/namespaces/new_namespace/HEAD &&
>> +			printf "%s commit\t%s\n" $(git rev-parse master) \
>> +			                         refs/namespaces/new_namespace/refs/heads/master
>> +		) >expect &&
>
>Use of 'printf' is clever and I like it.  Have you considered
>letting it do the iteration as well?  I.e.
>
>	printf "%s commit\t%s\n" \
>        	one two \
>                three four \
>                five six \
>	>expect &&
>
>might be easier to read.
>
Didn't think about that actually. Will do.
Show 12 quoted lines
>> +		git -C ../bare for-each-ref refs/ >actual &&
>> +		test_cmp expect actual
>> +	) &&
>> +	GIT_NAMESPACE=new_namespace git clone bare clone &&
>> +	(
>> +		cd clone &&
>> +		git show
>
>We can accept any random commit at HEAD as long as it exists at this
>point?  Don't we need to make sure that a ref whose tip is still "one"
>is not propagated to this new clone?
>
Oh crap, I just remembered that I forgot to address that part, sorry.
Show 5 quoted lines
>> +	)
>> +'
>> +
>> +
>>  test_done
-- 
Sincerely,
  Johannes Löthberg
  PGP Key ID: 0x50FB9B273A9D0BB5
  https://theos.kyriasis.com/~kyrias/
Previous: Junio C HamanoNext: Johannes Löthberg
Message 18 of 22 in “receive-pack: Create a HEAD ref for ref namespace”
  1. receive-pack: Create a HEAD ref for ref namespaceJohannes Löthberg, Jun 1, 2015
  2. Johannes LöthbergJun 5, 2015
  3. Michael J GruberJun 5, 2015
  4. Johannes LöthbergJun 5, 2015
  5. Johannes LöthbergJun 5, 2015
  6. Fix cloning from ref namespaceJohannes Löthberg, Jun 5, 2015
  7. 1/2 receive-pack: Create a HEAD ref for ref namespaceJohannes Löthberg, Jun 5, 2015
  8. 2/2 t: Add test for cloning from ref namespaceJohannes Löthberg, Jun 5, 2015
  9. Junio C HamanoJun 5, 2015
  10. Johannes LöthbergJun 5, 2015
  11. Junio C HamanoJun 5, 2015
  12. Johannes LöthbergJun 5, 2015
  13. Johannes LöthbergJun 5, 2015
  14. Junio C HamanoJun 5, 2015
  15. receive-pack: Create a HEAD ref for ref namespaceJohannes Löthberg, Jun 5, 2015
  16. Johannes LöthbergJun 5, 2015
  17. Junio C HamanoJun 5, 2015
  18. Johannes LöthbergJun 5, 2015
  19. receive-pack: Create a HEAD ref for ref namespaceJohannes Löthberg, Jun 5, 2015
  20. Johannes LöthbergJun 10, 2015
  21. Junio C HamanoJun 15, 2015
  22. Johannes LöthbergJun 15, 2015

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.