git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Quinn, David" <David.Quinn@cmegroup.com>
To: "git@vger.kernel.org" <git@vger.kernel.org>
Subject: Failed stash caused untracked changes to be lost
Date: Tue, 23 Oct 2018 11:02:41 +0000	[thread overview]
Message-ID: <1540292560837.94684@cmegroup.com> (raw)


Issue: While running a git stash command including the '-u' flag to include untracked files, the command failed due to arguments in the incorrect order. After this untracked files the were present had been removed and permanently lost.

Environment: Windows 10, Powershell w/ PoshGit


State before running command: 9 Modified files, 2 (new) untracked files

Note: I only wanted to commit some of the modified files (essentially all the files/changes I wanted to commit were in one directory)

Actual command run:  git stash push -u -- Directory/To/Files/* -m "My Message"

Returned:

    Saved working directory and index state WIP on [BranchName]: [Commit hash] [Commit Message]
    fatal: pathspec '-m' did not match any files
    error: unrecognized input

State after Command ran: 9 Modifed files, 0 untracked files


The command I should have ran should have been

    git stash push -u -m "My Message"? -- Directory/To/Files/*


I have found the stash that was created by running this command:

    gitk --all $(git fsck --no-reflog | Select-String "(dangling commit )(.*)" | %{ $_.Line.Split(' ')[2] })
?
and searching for the commit number that was returned from the original (paritally failed??) stash command. However there is nothing in that stash. It is empty.



I think that the fact my untracked files were lost is not correct behaviour and hence why I'm filing this bug report




________________________________
NOTICE: This message, and any attachments, are for the intended recipient(s) only, may contain information that is privileged, confidential and/or proprietary and subject to important terms and conditions available at E-Communication Disclaimer<http://www.cmegroup.com/tools-information/communications/e-communication-disclaimer.html>. If you are not the intended recipient, please delete this message. CME Group and its subsidiaries reserve the right to monitor all email communications that occur on CME Group information systems.

             reply	other threads:[~2018-10-23 11:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-23 11:02 Quinn, David [this message]
2018-11-03 15:34 ` Failed stash caused untracked changes to be lost Thomas Gummerer
2018-11-05  9:29   ` Quinn, David
2018-11-05 22:16     ` Thomas Gummerer

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=1540292560837.94684@cmegroup.com \
    --to=david.quinn@cmegroup.com \
    --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).