"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
"Omar Polo" <op@omarpolo.com>
Subject:
Re: change got clone's got.conf default branch setting
To:
Stefan Sperling <stsp@stsp.name>
Cc:
gameoftrees@openbsd.org
Date:
Sun, 17 Aug 2025 12:48:29 +0200

Download raw body.

Thread
Stefan Sperling <stsp@stsp.name> wrote:
> The 'got clone' command generates a default configuration file
> which currently looks something like this:
> 
> remote "origin" {
> 	server git.example.com
> 	protocol ssh
> 	repository "/repo.git"
> 	branch { "main" }
> }
> 
> Where the "branch" directive applies to both 'got fetch' and 'got send'.
> 
> This can result in the default branch being sent even when that is not
> what the user intended. For example, when 'got send -d foo' is used to
> delete branch "foo", the above config file makes this command equivalent
> to 'got send -d foo -b main'.
> 
> The patch below avoids this issue in fresh clones by writing a got.conf
> like this instead:
> 
> remote "origin" {
> 	server git.example.com
> 	protocol ssh
> 	repository "/repo.git"
> 	fetch {
> 		branch { "main" }
> 	}
> }
> 
> 
> If 'got send -d foo' is used with the above got.conf then it will
> really only delete branch "foo" and not send anything else. This is
> because we only get a default branch from the work tree or the
> repository if the -d option is not used.
> 
> ok?

Yes, yes, yes!  Thank you! :)

I completely forgot about the `fetch' stanza.

ok op@