mainSavannah Administration - Support: sr #110723, Broken git remote HEAD

 
 

sr #110723: Broken git remote HEAD

Submitter:  CismonX <cismonx>
Submitted:  Fri 16 Sep 2022 08:27:04 AM UTC
   
 
Category:  Source code repositories - anonymous access Priority:  5 - Normal
Severity:  3 - Normal Status:  Done
Privacy:  Public Assigned to:  rwp
Operating System:  GNU/Linux Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 19 Sep 2022 07:35:30 PM UTC, comment #3: 


> I prefer looking for solutions myself, before bothering anyone

with support tickets.  I only ask for help when I believe it's
necessary.

Me too.  And I understand.  But we are nice people and are happy to smooth over the rough parts.  It's really the community that makes everything work.

Bob Proulx <rwp>
Site Administrator
Sat 17 Sep 2022 07:23:47 AM UTC, comment #2: 


> I manually switched the git HEAD for you from "master" to
> "primary" for these two repositories.


It works.  Thank you for your support.

> This does not change the default branch.  It simply uploads
> an additional branch.


Yes, that's my fault.  I just found out by setting up a git ssh
server and doing some testing.

Many source code hosting sites have the behaviour of setting
the remote git repo's HEAD to the first branch it recieves,
but I should not be expecting all sites to behave like that.

> There have been many articles of documentation written recently
> about how to command git to change the default branch.


I did a little research on git, and yet to find a viable git-only
solution (without resorting to external API, or shell access to the
remote repo, with is not available on Savannah).

There are `git symbolic-ref' and `git remote set-head', but they
only work on the local repository, and there is no way to ask for
a remote to update its symbolic refs.

Some code hosting sites work around this by providing a `Change
Default Branch' option in their Web interface, which does the
`git symbolic-ref' stuff on the server side.  But I don't think
it's very beneficial to add this feature to Savannah, since it's
not an everyday task to change a repo's default branch.

> But this is simply standard git operation and standard
> git documentation is available for it.


I agree with you.

I prefer looking for solutions myself, before bothering anyone
with support tickets.  I only ask for help when I believe it's
necessary.

CismonX <cismonx>
Fri 16 Sep 2022 05:08:20 PM UTC, comment #1: 

Are these newly set up repositories?  I think they must be.

The "git init" command defaults to "master" for the default branch.  This init happens on the server side and at this moment there is no control in place for project members to specify anything other than the upstream git init default when creating a new repository.  That would be possible but it would need someone to do some hacking on it in order to implement it and that has not yet happened.

It appears that these repositories were created with the defaults and then a branch was pushed upstream and that branch was called "primary".  This does not change the default branch.  It simply uploads an additional branch.

There have been many articles of documentation written recently about how to command git to change the default branch.  Apologies for not having the time at this moment to go find one and reference it but let me say that there are recipes available for switching the default branch name from master to other names.

It is also okay to ask us to help with branch name changes.  We are happy to help.  But this is simply standard git operation and standard git documentation is available for it.

I manually switched the git HEAD for you from "master" to "primary" for these two repositories.

Try a pristine git clone now and the default branch for these two will be "primary" as you desire.


Bob Proulx <rwp>
Site Administrator
Fri 16 Sep 2022 08:27:04 AM UTC, original submission:  

When cloning the git repository of some of my projects,
I got the following warning message from git:

  warning: remote HEAD refers to nonexistent ref, unable to checkout.

The projects in question are listed below:

  ctlseqs
  vscode-texinfo

The problem is that the HEAD of remote repository points to `master'
instead of `primary', the former of which never existed, and the latter
is the default branch of these repositories.

Possibly related to [sr #110623].

I'd like to have the remove repository of these two projects fixed, so
that HEAD points to `primary' branch and `git clone' works as expected.

This problem could apply to other projects on Savannah with non-master
default branch.  Perhaps a full check is necessary.

CismonX <cismonx>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rwp (Posted a comment)
  • -email is unavailable- added by cismonx (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-09-16 rwp StatusNone Done
        Assigned toNone rwp
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code