Git development
 help / color / mirror / Atom feed
* git stash push/save/create all return exit code 0, even if no object was created
@ 2020-03-22 15:09 Σταύρος Ντέντος
  2020-03-22 15:50 ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: Σταύρος Ντέντος @ 2020-03-22 15:09 UTC (permalink / raw)
  To: git

Hello there,

I am trying to run a `git checkout` command on a repository, without
the possibility of getting any error message about files interfering
with the checkout process.
I thought a safe way to do this was to run `git-stash`, similarly to
`rebase.autoStash = true`

However, I find two issues with those:
1) Exit code is 0, even if no object/stash was created.

It feels weird to parse stdout/stderr to decide "what happened".

2) `git stash create` (which sounds more like what I need), does not
clear what it was stored.
I can "take the pain" of printing the object-sha1 to be traceable if
something happens (even though I would prefer more if it was
"securely" stored in `refs/stash` i.e. `git stash push`), but then
`git stash` won't clean what it just stored.
Is the solution to also run `git reset --hard` there?

With regards,
Ntentos Stavros

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

end of thread, other threads:[~2020-03-22 16:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-22 15:09 git stash push/save/create all return exit code 0, even if no object was created Σταύρος Ντέντος
2020-03-22 15:50 ` Junio C Hamano
2020-03-22 16:15   ` Σταύρος Ντέντος

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox