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

Re: [PATCH] Ignore dirty submodule states during stash

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
May 16, 2016, 16:29 UTC
Message-ID
<alpine.DEB.2.20.1605161817590.3303@virtualbox>
In-Reply-To
<20160516154606.GA8797@gmail.com>
Hi Vasily,
On Mon, 16 May 2016, Vasily Titskiy wrote:
Show 18 quoted lines
> On Sun, May 15, 2016 at 11:37:20PM -0700, Stefan Beller wrote:
> > On Sun, May 15, 2016 at 7:07 PM, Vasily Titskiy <qehgt0@gmail.com> wrote:
> > > Do not save states of submodules as stash should ignore it.
> > 
> > Can you explain why this is a good idea?
> > (It is not obvious to me either way.)
> Actually, submodules are already ignored by stash, but not fully (it was
> introduced in commit 6848d58).
> Current behavior is counter-intuitive, for example (if one has a project
> with a submodule):
>  [...]
> 
> So, this is the issue. Instead of getting my local changes, I got a
> conflict (and stash is not poped out). The root cause is the 'stash'
> command does not know how to deal with submodules, but currently it
> tries to save the state of submodules, and even tries to re-apply the
> state (and it fails of course). The proposed solution fixes this
> behaviour.

Please make it a habit to put such information into the commit message. I have to admit that I was as puzzled as Stefan by the proposed patch. Such problems, and tedious back-and-forth discussion, can be easily avoided by providing additional background in the commit message. We even ask in our Documentation/SubmittingPatches explicitly to do that:

Show 9 quoted lines
> The body should provide a meaningful commit message, which:
>
>   . explains the problem the change tries to solve, iow, what is wrong
>     with the current code without the change.
>
>   . justifies the way the change solves the problem, iow, why the
>     result with the change is better.
>
>   . alternate solutions considered but discarded, if any.

BTW this is not something we ask to make contributors' lives harder. In fact it helps everybody, including the contributors themselves. Just imagine what kind of kick-ass commit message you would want to read in six months when you stumble over your very own commit and want to know what the heck it was about.

Ciao, Johannes

Previous: Vasily Titskiy
Message 6 of 6 in “Ignore dirty submodule states during stash”
  1. Ignore dirty submodule states during stashVasily Titskiy, May 16, 2016
  2. Stefan BellerMay 16, 2016
  3. Vasily TitskiyMay 16, 2016
  4. Stefan BellerMay 16, 2016
  5. Vasily TitskiyMay 17, 2016
  6. Johannes SchindelinMay 16, 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.