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 29, 2014, 17:43 UTC
Message-ID
<20140729174357.GA20042@peff.net>
In-Reply-To
<xmqq61ig3xsp.fsf@gitster.dls.corp.google.com>
On Tue, Jul 29, 2014 at 10:00:22AM -0700, Junio C Hamano wrote:
Show 6 quoted lines
> Jeff King <peff@peff.net> writes:
> 
> > So perhaps we could do something better on the viewing side, and
> > "simplify" combined merges for files with all-identical parents.
> 
> Or you can ask to show the difference with the first parent, no?

Yeah, though there is no way to do the other thing (--second-parent to show only the index side). I doubt anybody wants that, though. Just passing --first-parent would probably be fine (that would match "git stash show", too, though like that "stash show" it is impossible to override to see the index portion then).

But...
> I do not think giving a single-parent diff when --cc/-c is asked
> for, which is a clear indication that the caller is aware that the
> commit in question is a merge, is such a good idea.

I think that is my point, though. The user is _not_ aware that the commit in question is a merge. They stashed some stuff, and now they want to see the result. I'd like to show them a vanilla commit if the index is irrelevant, and otherwise show them something more interesting.

I definitely don't think that should be the default behavior, but I don't see a problem with it being part of stash. We pick apart the stash already in git-stash.sh, so for "git stash show" we can do it ourselves. But during a traversal, we need support from "git log", since the answer is different for each stash (and even for each path).

-Peff
Previous: Junio C HamanoNext: Junio C Hamano
Message 7 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.