Re: [RFC PATCH 0/1] push: introduce '--heads' option
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Dec 5, 2022, 23:35 UTC
- Message-ID
- <xmqqilippgp2.fsf@gitster.g>
- In-Reply-To
- <20221205133525.60464-1-tenglong.tl@alibaba-inc.com>
Teng Long <dyroneteng@gmail.com> writes:
Show 7 quoted lines
> From: Teng Long <dyroneteng@gmail.com> > > This RFC patch try to introduce a new option '--heads' in 'git-push' subcmd. The > value of this patch may come from my personal point of view, and the patch might > not have enough tests so far. It's pleasure to hear any suggestion, test > scenario which need to be covered or any test method which need to be noticed if > it's worthy.
My knee-jerk reaction is to avoid "--heads" and instead use "--branches", if this is about pushing all local branches. The option "--heads" may still remain in some commands added to the system in the earliest part of our history, but soon we started to use "branch" over "head", as it is a more commonly used word.
How should it interact with --follow-tags? Just as if you listed all local branch names on the command line? I.e. is
git push $URL --heads
equivalent to the long-hand
git push $URL $(git for-each-ref --format='%(refname)' refs/heads/\*)
and because of that, does
git push $URL --any --other --option --heads
behave identically to the long-hand with these other options added?