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