git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Ralf Jung <post@ralfj.de>
To: git@vger.kernel.org
Subject: Add config option to make "--keep-index" the default for "git stash push"
Date: Mon, 22 Oct 2018 10:11:50 +0200	[thread overview]
Message-ID: <385edc3f-3749-0620-2275-40785b6fbe49@ralfj.de> (raw)

Hi all,

I have been repeatedly bitten by the default behavior of `git stash` to stash
not just the unstaged but also the staged changes, and then `git stash pop`
making all changes unstaged. This means `git stash && git stash pop`, per
default, loses information, and when I just spent 10min carefully selecting
hunks to be staged that's quite frustrating.

I found that for myself, I usually expect `git stash` to only stash the changes
that are not yet staged.  So I'd like to configure git such that `--keep-index`
is the default.  That would also fix the information loss I mentioned above.
(By now I am also aware of `git stash pop --index`, but (a) that's not the
default either and (b) its documentation indicates it might not always work very
well.)  However, going over the `git-config` man page, I have not found any way
to change the default behavior.  Is that possible somehow?  And if not, could
you consider this a feature request to add such an option?

Kind regards,
Ralf

             reply	other threads:[~2018-10-22  8:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-22  8:11 Ralf Jung [this message]
2018-10-24  1:50 ` Add config option to make "--keep-index" the default for "git stash push" brian m. carlson

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=385edc3f-3749-0620-2275-40785b6fbe49@ralfj.de \
    --to=post@ralfj.de \
    --cc=git@vger.kernel.org \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).