9front - general discussion about 9front
 help / color / mirror / Atom feed
From: ori@eigenstate.org
To: 9front@9front.org
Subject: Re: [9front] git/push with refs not in refs/heads
Date: Fri, 16 Jul 2021 23:08:20 -0400	[thread overview]
Message-ID: <9B6128858FC970E911395421287D640F@eigenstate.org> (raw)
In-Reply-To: <YPIup1s5B74YO/YH@alice>

Quoth Anthony Martin <ality@pbrane.org>:
> Is there interest in allowing git/push to send an
> arbitrary ref to a remote repository? Right now
> the ref has to be a branch in refs/heads.
> 
> My usual way of working with git on Unix is to have
> a canonical origin that I fetch from and a single
> local branch that I commit to and rebase onto the
> origin before pushing.
> 
> Sometimes I want to push the current origin branch
> to a mirror without involving any of my local refs,
> something like:
> 
> 	git push mirror origin/master:master
> 
> where the local refs are
> 
> 	refs/heads/master
> 	refs/remotes/mirror/master
> 	refs/remotes/origin/HEAD
> 	refs/remotes/origin/master
> 
> the remote refs on mirror are
> 
> 	HEAD
> 	refs/heads/master
> 
> and my own master has diverged from origin/master.
> 
> Please advise.
> 
> Thanks,
>   Anthony
> 

That's definitely not supported, but adding
it should be easy.

Git/push -b passes the branch unmolested
to git/send, but git/send assumes that the
ref is under refs/heads.

I think we would adopt the ':' separated
branches in git/send; the main change would
be in send.c:/^readours, where the branch
would have to be split on ':', the lhs resolved,
and the rhs converted to the refs/heads/$remote
format.



      parent reply	other threads:[~2021-07-17  3:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-17  1:13 Anthony Martin
2021-07-17  2:11 ` Kurt H Maier
2021-07-17 11:20   ` Anthony Martin
2021-07-17 21:11     ` Kurt H Maier
2021-07-17  3:08 ` ori [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9B6128858FC970E911395421287D640F@eigenstate.org \
    --to=ori@eigenstate.org \
    --cc=9front@9front.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).