GNU bug report logs -
#76407
[GCD] A better name for the default branch
Previous Next
Full log
View this message in rfc822 format
Hi Liliana,
On Fri, 21 Feb 2025 at 20:56, Liliana Marie Prikler <liliana.prikler <at> gmail.com> wrote:
>> Therefore, maybe we could imagine that the last commit pushed master
>> introduce a double pull.
>>
>> Assume I still run this 056910e and we are after the grace period. I
>> run “guix pull” so it fetch the last commit of master. Now, when I
>> run again “guix pull”, I will get the last commit of main. This
>> second pull could be transparent for me.
>
> I don't think we should do this for two reasons:
>
> First, the "double pull" commit would be introduced to master only,
> which would break authentication of the main branch pulled this way.
At this end of the grace period, you have a direct path from the HEAD of
’main’ to the authenticated commit. And you also have a direct path
from the HEAD of ’master’ to the authenticated commit.
Assuming, this commit with “double pull” lives only in ’master’ and
’master’ forks from ’main’ – fork because it holds the very commit.
I do not know the detail about switching from an authenticable branch to
another authenticable branch. Because indeed, the HEAD of both branches
’main’ and ’master’ would not be in the same closure.
Hum, something I need to check for my understanding. :-)
> Second, we would have to break Guix itself to introduce arbitrary code
> execution for this particular code 😉
Why? We only need to introduce a special case in
’update-cached-checkout’, no?
Somehow, we would have:
* main
| * master
|/
* End grace period
so we could have something like introduced in the ’master’ branch.
--8<---------------cut here---------------start------------->8---
1 file changed, 1 insertion(+), 1 deletion(-)
guix/git.scm | 2 +-
modified guix/git.scm
@@ -653,7 +653,7 @@ (define* (update-cached-checkout url
#:cleanup-period
%checkout-cache-cleanup-period)))
- (values cache-directory (oid->string oid) relation)))))
+ (update-cached-checkout ... #:ref `(branch . "main") ...)))))
(define* (latest-repository-commit store url
#:key
--8<---------------cut here---------------end--------------->8---
Well, modulo the former question about authentication. :-)
> Perhaps instead, we can on the Git side "redirect" the master branch to
> main. This would avoid the double pull, and it would be truly
> transparent. Perhaps the following sequence of commands would achieve
> just that. (CC'ing Denis for their expertise)
Yeah, who can more can less. :-)
> Am Mittwoch, dem 19.02.2025 um 02:12 +0100 schrieb Denis 'GNUtoo'
> Carikli:
>> $ git checkout origin/master -b temporary
>> $ git push origin HEAD:main
>> $ ssh root <at> server
>> $ cd /path/to/repository.git
>> $ git symbolic-ref HEAD refs/heads/main # Change the main branch
>> $ git symbolic-ref refs/heads/master refs/heads/main # Make master
>> point to main
>
>> This might avoid: Oops why don’t I get the last? Because you’re
>> after the grace period. :-)
>>
>> I don’t know if my suggestion is worth.
>
> Fair point. Double-pulling is a source of annoyance in other package
> managers, so we should do our best not to make it affect too many
> users.
Assuming we are allowed to do that on the server hosting the Git
repository.
Cheers,
simon
This bug report was last modified 35 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.