git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Phillip Wood <phillip.wood123@gmail.com>
Cc: MithicSpirit <rpc01234@gmail.com>,  git@vger.kernel.org
Subject: Re: [PATCH] builtin/stash: configs keepIndex, includeUntracked
Date: Mon, 19 Feb 2024 18:52:44 -0800	[thread overview]
Message-ID: <xmqq34tnyhhf.fsf@gitster.g> (raw)
In-Reply-To: <99346639-5a36-4c2e-a5d7-035c3c1fda8b@gmail.com> (Phillip Wood's message of "Sun, 18 Feb 2024 10:32:22 +0000")

Phillip Wood <phillip.wood123@gmail.com> writes:

> How does "stash.keepIndex" interact with "git rebase --autostash" and
> "git merge --autostash"? I think both those commands expect a clean
> index after running "git stash". They could just override the config
> setting but it might get a bit confusing if some commands respect the
> config and others don't.

The "autostash" feature fundamentally should not respect such
configuration variables, as the reason why they exist is not to
create a stash of any unusual kind the user expresses preference to
by the configuration variable(s), but to clear the slate and bring
both the working tree and the index pristine with respect to HEAD.
Also, when able, they would automatically unstash after the main
operation to rebase or merge is done, right?  IOW, normally the use
of the stash ought to be invisible to the end users.  I would not
worry too much about the "confusion" factor for these reasons.

You are however right that this will confuse the toolchain.  These
two commands we provide may not be affected (or we can make them not
affected by changing their implementation if needed, while we add
such configuration variables at the same time), but third-party
tools and end-user scripts that has trusted that when they write
"git stash", the command will give them a clean index and working
tree will be broken big time.

So, I am somewhat negative on the patch in the current form, until I
see how the plan to help third-party tools and end-user scripts that
rely on the promise we have given them looks like.

Thanks.

  parent reply	other threads:[~2024-02-20  2:52 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-18  3:30 [PATCH] builtin/stash: configs keepIndex, includeUntracked MithicSpirit
2024-02-18 10:32 ` Phillip Wood
2024-02-18 17:54   ` Ricardo C
2024-02-20 11:01     ` Phillip Wood
2024-02-20 17:47       ` Junio C Hamano
2024-02-21 19:13         ` Ricardo C
2024-02-21 20:09           ` Junio C Hamano
2024-02-21 23:14             ` Ricardo C
2024-02-21 23:53             ` Junio C Hamano
2024-02-20  2:52   ` Junio C Hamano [this message]
2024-02-20  3:30     ` Ricardo C
2024-02-20  3:44       ` Junio C Hamano
2024-02-20  3:59         ` Ricardo C
2024-02-20 19:30           ` Kristoffer Haugsbakk
2024-02-19  8:04 ` Jean-Noël Avila
2024-02-19 21:41   ` Ricardo C

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqq34tnyhhf.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=phillip.wood123@gmail.com \
    --cc=rpc01234@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).