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

Re: [PATCH] stash: tighten IS_STASH_LIKE logic

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 18, 2013, 22:20 UTC
Message-ID
<7vk3nz4h20.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1366270717-19929-1-git-send-email-artagnon@gmail.com>
Ramkumar Ramachandra <artagnon@gmail.com> writes:
Show 5 quoted lines
> Currently, 'git stash show' and 'git stash apply' can show/apply any
> merge commit, as the test for setting IS_STASH_LIKE simply asserts if
> the commit is a merge.  Improve the situation by asserting if the
> index_commit and the worktree_commit are based off the same commit, by
> checking that $REV^1 is equal to $REV^2^1.
When was the last time you tried to run "git stash apply next"?

The current code parses the ancestors and trees because the real work needs them, and the 'does this look like a stash?' is a side effect, but reading it^2^1 and comparing with it^1 is a pure overhead for the sake of checking. It looks like a futile mental masturbation to solve theoretical non-issue to me.

Is it worth it?
Previous: Ramkumar RamachandraNext: Ramkumar Ramachandra
Message 2 of 6 in “stash: tighten IS_STASH_LIKE logic”
  1. stash: tighten IS_STASH_LIKE logicRamkumar Ramachandra, Apr 18, 2013
  2. Junio C HamanoApr 18, 2013
  3. Ramkumar RamachandraApr 19, 2013
  4. Junio C HamanoApr 19, 2013
  5. Ramkumar RamachandraApr 19, 2013
  6. Junio C HamanoApr 19, 2013

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.