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

Re: git clone -b

From
Stefan Näwe <stefan.naewe@atlas-elektronik.com>
Date
Jun 28, 2013, 12:27 UTC
Message-ID
<51CD8136.6090702@atlas-elektronik.com>
In-Reply-To
<20130628121847.GB1351@paksenarrion.iveqy.com>
Am 28.06.2013 14:18, schrieb Fredrik Gustafsson:
Show 23 quoted lines
> On Fri, Jun 28, 2013 at 01:59:51PM +0200, Stefan Näwe wrote:
>> Hi there!
>>
>> Is there any reason why 'git clone -b' only takes a branch (from refs/heads/)
>> or a tag (from refs/tags/) ?
>>
>> Background: At $dayjob we're using some kind of 'hidden' refs (in refs/releases/)
>> to communicate between the 'branch integrator' (who creates the ref in refs/releases/)
>> and the 'build master' who wants to build that ref. 
>>
>> It would be a little easier if the build master could simply say
>>
>>   git clone -b refs/releases/the-release-for-today URL
>>
>> instead of: git clone... ; cd ... ; git fetch... ; git checkout....
>>
>> Any answer or even a better idea to solve that is appreciated.
>>
>> Stefan
> 
> I don't understand what the alternative should be. You can't look in
> /refs/* because there's a lot of other stuff like bisect/remotes etc.
> there.
Well, I tell clone exactly what I want. There is no reason try something
from refs/*.
 
> Of course you could add to also look in /refs/releases/ but as I
> understand you that a special solution for your company. Why should all
> git users have that addition?
It wouldn't hurt, IMHO. Maybe it would even make sense to allow any SHA-1
to be passed to '-b'.
 
> Two questions about your setup:
> 
> 	1. Why do you always clone your repository? To me clone is a one
> 	time operation.
We would use 'git archive' if that would be submodule-aware...
> 	2. Why don't you tag your releases with an ordinary tag?

Because we use that 'refs/release' thing as a hidden ref that other developers will not see when they fetch (unless they are told to checkout that particular ref).

Think of using this similar to the way github uses refs/pull/*/{head,merge} for their pull request mechanism.

Stefan
-- 
----------------------------------------------------------------
/dev/random says: The Definition of an Upgrade: Take old bugs out, put new ones in.
python -c "print '73746566616e2e6e616577654061746c61732d656c656b74726f6e696b2e636f6d'.decode('hex')"
Previous: Fredrik GustafssonNext: Stefan Näwe
Message 4 of 10 in “git clone -b”
  1. Stefan NäweJun 28, 2013
  2. Stefan NäweJun 28, 2013
  3. Fredrik GustafssonJun 28, 2013
  4. Stefan NäweJun 28, 2013
  5. Stefan NäweJul 1, 2013
  6. Junio C HamanoJul 1, 2013
  7. Stefan NäweJul 2, 2013
  8. Junio C HamanoJul 2, 2013
  9. Phil HordJul 1, 2013
  10. Jeff KingJul 3, 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.