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

Re: stash-p broken?

From
Jeff King <peff@peff.net>
Date
Jul 31, 2014, 00:23 UTC
Message-ID
<20140731002321.GD22297@peff.net>
In-Reply-To
<xmqqwqaw2fe3.fsf@gitster.dls.corp.google.com>
On Tue, Jul 29, 2014 at 11:23:16AM -0700, Junio C Hamano wrote:
Show 8 quoted lines
> I see you added --simplify-combined-diffs to avoid breaking "log",
> so that is not too bad, but I am still unsure what should happen
> when the first parent and the result is the same and only the second
> parent is different (i.e. you have changes in the index and your
> working tree changes have been reverted---then you create a stash).
> Should it show as "single source diff, with all changes reverted"?
> Should it show as a normal "combined diff for a merge"?  Should it
> show as "no changes whatsoever"?

Interesting question. I think right now we would show nothing in the combined diff, as we simply took one side. This is really showing the weakness of the "stash is a merge" storage format. If we use it as a storage format, and pick it apart in "git stash", that's fine. But as soon as we start treating it like a real merge and expecting "git log" to behave, the cracks begin to show.

Hmph. To be honest, I am starting to wonder if implying "--first-parent" is a more sensible option for "stash list". It matches "stash show", at least, and it is not unreasonable to simply present the changes in the working tree by default, and ignore the index. People who are more clueful can pick apart the commits using "git log" themselves.

-Peff
Previous: Junio C HamanoNext: Junio C Hamano
Message 9 of 12 in “stash-p broken?”
  1. Michael MigdolJul 29, 2014
  2. Michael MigdolJul 29, 2014
  3. brian m. carlsonJul 29, 2014
  4. Øystein WalleJul 29, 2014
  5. Jeff KingJul 29, 2014
  6. Junio C HamanoJul 29, 2014
  7. Jeff KingJul 29, 2014
  8. Junio C HamanoJul 29, 2014
  9. Jeff KingJul 31, 2014
  10. Junio C HamanoJul 31, 2014
  11. Junio C HamanoJul 29, 2014
  12. Jeff KingJul 31, 2014

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.