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

Re: "git subtree --squash" interacts poorly with revert, merge, and rebase

From
Matt McCutchen <matt@mattmccutchen.net>
Date
Oct 27, 2016, 02:42 UTC
Message-ID
<1477536130.1570.10.camel@mattmccutchen.net>
In-Reply-To
<CAGZ79kb1bb5e5hKpnkFqLOsPow5xt8zczWmZNxMMt5nA84tf-w@mail.gmail.com>
On Wed, 2016-10-26 at 19:03 -0700, Stefan Beller wrote:
Show 10 quoted lines
> On Wed, Oct 26, 2016 at 6:52 PM, Matt McCutchen <matt@mattmccutchen.net> wrote:
> > 4. I pushed several dangling submodule pointers before I learned I
> > could set push.recurseSubmodules = check.  This isn't the default; each
> > developer has to do it manually.  (In theory, I could put such things
> > in a setup script for them to run if they trust me.)
> 
> There is a current series in flight/for review that makes "check" default.
> (It is blocked as check has some performance issues when having lots
> of commits to be pushed, so it may take a while and not show up in the
> next release)
Great!  One other thing: IIRC, "check" does not distinguish between
different remotes.  For example, suppose I fork a project that already
has a submodule and I have a pair of repositories that pull from the
"upstream" repositories and push to "origin" repositories for my
project.  Suppose I upgrade to a new upstream version and find that I'm
(temporarily) able to use the upstream submodule without modifications.
 The "check" feature won't stop me from pushing a pointer into the
"origin" superproject that points to a commit that exists in the
"upstream" subproject but not the "origin" subproject.
Show 6 quoted lines
> > 5. Stashing changes to both the superproject and the subproject takes
> > more steps.
> 
> True, so you'd want to have a `git stash --recurse-submodules={yes,no}`
> where the command line option is configurable, so you don't have to type
> it all the time?

Sounds good.  I'm sure you realize this is not just a matter of running "git stash" in each submodule because there are many ways the stash stacks could get out of lockstep.  The submodule content needs to be incorporated into the superproject stash.

> Thanks for pointing out the issues though. they align to what
> we plan on doing for submodules, so ... the plan actually makes
> sense :)

Again, I'm thrilled you're working on this, even if I don't use it on my current project.

Matt
Previous: Stefan BellerNext: Matt McCutchen
Message 9 of 11 in “"git subtree --squash" interacts poorly with revert, merge, and rebase”
  1. Matt McCutchenOct 26, 2016
  2. Stefan BellerOct 26, 2016
  3. Junio C HamanoOct 26, 2016
  4. Peter WilliamsOct 27, 2016
  5. Junio C HamanoOct 27, 2016
  6. Junio C HamanoOct 27, 2016
  7. Matt McCutchenOct 27, 2016
  8. Stefan BellerOct 27, 2016
  9. Matt McCutchenOct 27, 2016
  10. Matt McCutchenNov 10, 2016
  11. Matt McCutchenNov 14, 2016

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.