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

Re: [PATCH] submodule--helper: teach push-check to handle HEAD

From
Stefan Beller <sbeller@google.com>
Date
Jun 23, 2017, 20:26 UTC
Message-ID
<CAGZ79kZqjaXSrqawgDnxu58sSPWVm8kAhRxn69Sbo8_aP4rr6w@mail.gmail.com>
In-Reply-To
<20170623200427.26803-1-bmwill@google.com>
On Fri, Jun 23, 2017 at 1:04 PM, Brandon Williams <bmwill@google.com> wrote:
Show 12 quoted lines
> In 06bf4ad1d (push: propagate remote and refspec with
> --recurse-submodules) push was taught how to propagate a refspec down to
> submodules when the '--recurse-submodules' flag is given.  The only refspecs
> that are allowed to be propagated are ones which name a ref which exists
> in both the superproject and the submodule, with the caveat that 'HEAD'
> was disallowed.
>
> This patch teaches push-check (the submodule helper which determines if
> a refspec can be propagated to a submodule) to permit propagating 'HEAD'
> if and only if the superproject and the submodule both have the same
> named branch checked out and the submodule is not in a detached head
> state.
cont'd:

We need this use case because Gerrit's documentation ingrains this workflow in its users to use

    git push <remote> HEAD:refs/for/<target-branch>

And when both the submodule as well as the superproject are still on a branch with the same name (and not detached) we'd not be misunderstood by the user on the syntax.

More on the code later.
Previous: Brandon WilliamsNext: Junio C Hamano
Message 2 of 5 in “submodule--helper: teach push-check to handle HEAD”
  1. submodule--helper: teach push-check to handle HEADBrandon Williams, Jun 23, 2017
  2. Stefan BellerJun 23, 2017
  3. Junio C HamanoJun 23, 2017
  4. Brandon WilliamsJun 26, 2017
  5. 1/1 submodule--helper: teach push-check to handle HEADBrandon Williams, Jul 20, 2017

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.