git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Bug with deleted files and stash-push --keep-idex
@ 2019-07-11 12:55 Martin Nicolay
  2019-07-11 17:48 ` [PATCH] stash: fix handling removed files with --keep-index Thomas Gummerer
  0 siblings, 1 reply; 7+ messages in thread
From: Martin Nicolay @ 2019-07-11 12:55 UTC (permalink / raw)
  To: git

[-- Attachment #1: Type: text/plain, Size: 2710 bytes --]

Hi!

I don't know if this is a software or documentation bug.

man git-stash says about --keep-index:
     If the --keep-index option is used, all changes already added to
     the index are left intact.

If a file is deleted and this deletion is in the index a following
     $ git stash push --keep-index
keeps this deletion in the index but not in the working-tree.

If a file is changed and this change is in the index a following
     $ git stash push --keep-index
keeps this change in the index and also in the working-tree.

This is inconsistent.

------------- deletion -------------
$ git status
On branch master
Changes to be committed:
   (use "git reset HEAD <file>..." to unstage)

         deleted:    test-file

$ git stash push --keep-index
Saved working directory and index state WIP on master: a3171f887b new test-file
$ git status
On branch master
Changes to be committed:
   (use "git reset HEAD <file>..." to unstage)

         deleted:    test-file

Untracked files:
   (use "git add <file>..." to include in what will be committed)

         test-file

------------- change -------------
$ git status
On branch master
Your branch is up to date with 'origin/master'.

Changes to be committed:
   (use "git reset HEAD <file>..." to unstage)

         modified:   test-file

$ git stash push --keep-index
Saved working directory and index state WIP on master: a3171f887b new test-file
$ git status
On branch master
Your branch is up to date with 'origin/master'.

Changes to be committed:
   (use "git reset HEAD <file>..." to unstage)

         modified:   test-file

--------------------------

My expectation was that the deletion would be preserved within the
working-tree because this is a change added to the index and should be
left intact.

Best regards
Martin Nicolay

-- 

No MS-Word attachments (http://www.gnu.org/philosophy/no-word-attachments.html)
_______________________________________________________________________________
OSM AG | Ruhrallee 191 | 45136 Essen | Fon: 0201-89 555 | Fax: 0201-89 55 400
web: www.osm-ag.de | e-mail: info@osm-ag.de
IBAN: DE67 4325 0030 0001 0059 82 | BIC: WELADED1HRN
USt-ldNr.: DE163337313 | HRB: 28171 Essen
Aufsichtsratsvorsitzende: Dipl.-Kff. Sabine Elsas
Vorstand: Johannes Kuhn (Vorsitzender), Christian Damsky, Axel Roland

--
Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen.
Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten
haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail.
Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht
gestattet.
_______________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-07-16 20:09 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-11 12:55 Bug with deleted files and stash-push --keep-idex Martin Nicolay
2019-07-11 17:48 ` [PATCH] stash: fix handling removed files with --keep-index Thomas Gummerer
2019-07-11 21:23   ` Junio C Hamano
2019-07-16 13:35     ` Thomas Gummerer
2019-07-16 20:08       ` Junio C Hamano
2019-07-16 14:23   ` [PATCH v2] " Thomas Gummerer
2019-07-16 20:08     ` Junio C Hamano

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).