git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / Atom feed
From: Edmundo Carmona Antoranz <eantoranz@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Git List <git@vger.kernel.org>
Subject: Re: [PATCH] [RFC PATCH] stash save/push: add --index-only option
Date: Thu, 13 Feb 2020 07:21:54 -0600
Message-ID: <CAOc6etYA79mTHB595cCVphmYmFECYvgPgV09SNo-pdEPEVD37w@mail.gmail.com> (raw)
In-Reply-To: <xmqqblq3t6w1.fsf@gitster-ct.c.googlers.com>

On Wed, Feb 12, 2020 at 11:04 PM Junio C Hamano <gitster@pobox.com> wrote:
>
> I am not sure if you explained how useful the "feature" being
> proposed is, which is a very important skill to exercise to entice
> readers to start reading and helping your code.
>
> Why is it useful to be able to do this?  It is unclear at least to
> me.

Fair enough. It's ok to explain here, right? There's no simple way to stash only
what you have on index while retaining your working tree state.

I would do this to achieve it:
save what I have on the index somehow
$ git commit -m "will drop this revision later"

that revision I just created has what I want to stash, actually

$ git stash save -m "want to keep this on working tree when I finish"

my work tree is now clean (perhaps with untracked files)

$ git reset soft HEAD~1 # get what I had on index before

now I can stash... this is what I originally intended

$ git stash save -m "what I really meant to stash"

and now I need to get the working tree the way I had it when I started:

git stash pop stash@{1}


All of that with git stash push --index-only... well, git stash push --cached

>
> By the way, per "git help cli", the name for this new option that is
> more in line with the rest of the system would be "--cached"; it
> would tell Git to work only on the data in the index (as opposed to
> the working tree files).
> .
>

  reply	other threads:[~2020-02-13 13:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-12 23:50 Edmundo Carmona Antoranz
2020-02-12 23:52 ` Edmundo Carmona Antoranz
2020-02-13  5:04   ` Junio C Hamano
2020-02-13 13:21     ` Edmundo Carmona Antoranz [this message]
2020-02-13 16:55       ` Junio C Hamano
2020-02-13 17:12         ` Edmundo Carmona Antoranz

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=CAOc6etYA79mTHB595cCVphmYmFECYvgPgV09SNo-pdEPEVD37w@mail.gmail.com \
    --to=eantoranz@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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

git@vger.kernel.org list mirror (unofficial, one of many)

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://public-inbox.org/git
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 git git/ https://public-inbox.org/git \
		git@vger.kernel.org
	public-inbox-index git

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.version-control.git
	nntp://ou63pmih66umazou.onion/inbox.comp.version-control.git
	nntp://czquwvybam4bgbro.onion/inbox.comp.version-control.git
	nntp://hjrcffqmbrq6wope.onion/inbox.comp.version-control.git
	nntp://news.gmane.io/gmane.comp.version-control.git
 note: .onion URLs require Tor: https://www.torproject.org/

code repositories for the project(s) associated with this inbox:

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

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git