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

Re: [PATCH] update-ref: add forward command to safely fast-forward refs

From
ronan@rjp.ie <ronan@rjp.ie>
Date
Feb 23, 2023, 18:01 UTC
Message-ID
<52a5d6ae0b5d668b1c5e9c05a51701b1@rjp.ie>
In-Reply-To
<xmqqpma09udd.fsf@gitster.g>
> Unless I am missing something, this
> does not seem to be adding anything we cannot already do.
Correct. In my case it replaces:

MERGE_BASE=$(git merge-base refs/remotes/origin/master refs/prefetch/remotes/origin/master) update refs/remotes/origin/master refs/prefetch/remotes/origin/master $MERGE_BASE

I just thought the "forward" form was a little more convenient since it could output it all in one for-each-ref invocation. I mean, I could always open .git/refs/* in vim but that doesn't mean I want to...
Originally I left it as a three argument command but figured it might as well be possible to update to the descendent of any given ref, so I separated <ancestor> from <refname>.
 
Show 6 quoted lines
> I wonder if
> 
> git fetch . "+refs/prefetch/remotes/origin/*:refs/remotes/origin/*"
> 
> (with or without the '+' prefix, depending) what you are really
> going after, though.
Oh, that's perfect! I didn't consider that it was possible to "fetch" from the local repo. I think the refspec 'refs/prefetch/remotes/origin/*:refs/remotes/origin/*' does what I want — fast-forwarding my remote tracking branches to their latest prefetches.
In that case, if you don't feel the forward feature is useful feel free to drop it.

Thanks, Ronan

Previous: Junio C Hamano
Message 3 of 3 in “update-ref: add forward command to safely fast-forward refs”
  1. update-ref: add forward command to safely fast-forward refsRonan Pigott, Feb 23, 2023
  2. Junio C HamanoFeb 23, 2023
  3. ronan@rjp.ieFeb 23, 2023

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.