{"thread":{"id":"19335","subject":"[PATCH] Showing stash state in bash prompt","startedAt":"2009-05-13T09:44:48Z","lastAt":"2009-05-29T05:37:18Z","messageCount":13,"participants":["Daniel Trstenjak","Sverre Rabbelier","Junio C Hamano","Thomas Rast","Miles Bader","Jeff King","John Tapsell","Brian Gernhardt","Sitaram Chamarty"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"113758","messageId":"20090513094448.GC2106@bug.science-computing.de","threadId":"19335","inReplyTo":null,"subject":"[PATCH] Showing stash state in bash prompt","fromName":"Daniel Trstenjak","fromEmail":"daniel.trstenjak@science-computing.de","sentAt":"2009-05-13T09:44:48Z","receivedAt":"2009-05-13T09:44:48Z","isPatch":true,"sender":{"key":"daniel.trstenjak@science-computing.de","avatar":null},"body":"\nGreetings\nDaniel\n\n-- \n                                                                                                                                           \n Daniel Trstenjak         Tel   : +49 (0)7071-9457-264\n science + computing ag   FAX   : +49 (0)7071-9457-511\n Hagellocher Weg 73       mailto: Daniel.Trstenjak@science-computing.de\n D-72070 Tübingen         WWW   : http://www.science-computing.de/                                                                      \n-- \nVorstand/Board of Management:\nDr. Bernd Finkbeiner, Dr. Roland Niemeier, \nDr. Arno Steitz, Dr. Ingrid Zech\nVorsitzender des Aufsichtsrats/\nChairman of the Supervisory Board:\nMichel Lepert\nSitz/Registered Office: Tuebingen\nRegistergericht/Registration Court: Stuttgart\nRegisternummer/Commercial Register No.: HRB 382196 \n\n\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex 1683e6d..86e39a5 100755\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -117,6 +117,7 @@ __git_ps1 ()\n \n \t\tlocal w\n \t\tlocal i\n+\t\tlocal s\n \t\tlocal c\n \n \t\tif [ \"true\" = \"$(git rev-parse --is-inside-git-dir 2>/dev/null)\" ]; then\n@@ -136,15 +137,19 @@ __git_ps1 ()\n \t\t\t\t\telse\n \t\t\t\t\t\ti=\"#\"\n \t\t\t\t\tfi\n+\t\t\t\t\tstash_list=`git stash list`\n+\t\t\t\t\tif [ -n \"$stash_list\" ]; then\n+\t\t\t\t\t        s=\"$\"\n+\t\t\t\t        fi\n \t\t\t\tfi\n \t\t\tfi\n \t\tfi\n \n \t\tif [ -n \"$b\" ]; then\n \t\t\tif [ -n \"${1-}\" ]; then\n-\t\t\t\tprintf \"$1\" \"$c${b##refs/heads/}$w$i$r\"\n+\t\t\t\tprintf \"$1\" \"$c${b##refs/heads/}$w$i$s$r\"\n \t\t\telse\n-\t\t\t\tprintf \" (%s)\" \"$c${b##refs/heads/}$w$i$r\"\n+\t\t\t\tprintf \" (%s)\" \"$c${b##refs/heads/}$w$i$s$r\"\n \t\t\tfi\n \t\tfi\n \tfi\n"},{"id":"113770","messageId":"fabb9a1e0905130353u416086b8i5b685e750ec4b5a5@mail.gmail.com","threadId":"19335","inReplyTo":"20090513094448.GC2106@bug.science-computing.de","subject":"Re: [PATCH] Showing stash state in bash prompt","fromName":"Sverre Rabbelier","fromEmail":"srabbelier@gmail.com","sentAt":"2009-05-13T10:53:37Z","receivedAt":"2009-05-13T10:53:37Z","isPatch":true,"sender":{"key":"srabbelier@gmail.com","avatar":"https://avatars.githubusercontent.com/u/3098?v=4"},"body":"Heya,\n\nOn Wed, May 13, 2009 at 11:44, Daniel Trstenjak\n<Daniel.Trstenjak@science-computing.de> wrote:\n\nPlease have a look at Documentation/SubmittingPatches, available\nonline at [0], main points that you need to address:\n1. inline your patch rather than attaching it\n2. commit message\n3. signed-off-by line\n\nFeel free to ask if you have any questions wrt how to submit your\npatch if the document is unclear.\n\n[0] http://repo.or.cz/w/git.git?a=blob;f=Documentation/SubmittingPatches\n\n-- \nCheers,\n\nSverre Rabbelier\n"},{"id":"113771","messageId":"20090513112535.GD2106@bug.science-computing.de","threadId":"19335","inReplyTo":"fabb9a1e0905130353u416086b8i5b685e750ec4b5a5@mail.gmail.com","subject":"Re: [PATCH] Showing stash state in bash prompt","fromName":"Daniel Trstenjak","fromEmail":"daniel.trstenjak@science-computing.de","sentAt":"2009-05-13T11:25:35Z","receivedAt":"2009-05-13T11:25:35Z","isPatch":true,"sender":{"key":"daniel.trstenjak@science-computing.de","avatar":null},"body":"\nShowing stash state in bash prompt.\n\nSigned-off-by: Daniel Trstenjak <daniel.trstenjak@science-computing.de>\n---\n contrib/completion/git-completion.bash |    9 +++++++--\n 1 files changed, 7 insertions(+), 2 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex 1683e6d..86e39a5 100755\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -117,6 +117,7 @@ __git_ps1 ()\n \n \t\tlocal w\n \t\tlocal i\n+\t\tlocal s\n \t\tlocal c\n \n \t\tif [ \"true\" = \"$(git rev-parse --is-inside-git-dir 2>/dev/null)\" ]; then\n@@ -136,15 +137,19 @@ __git_ps1 ()\n \t\t\t\t\telse\n \t\t\t\t\t\ti=\"#\"\n \t\t\t\t\tfi\n+\t\t\t\t\tstash_list=`git stash list`\n+\t\t\t\t\tif [ -n \"$stash_list\" ]; then\n+\t\t\t\t\t        s=\"$\"\n+\t\t\t\t        fi\n \t\t\t\tfi\n \t\t\tfi\n \t\tfi\n \n \t\tif [ -n \"$b\" ]; then\n \t\t\tif [ -n \"${1-}\" ]; then\n-\t\t\t\tprintf \"$1\" \"$c${b##refs/heads/}$w$i$r\"\n+\t\t\t\tprintf \"$1\" \"$c${b##refs/heads/}$w$i$s$r\"\n \t\t\telse\n-\t\t\t\tprintf \" (%s)\" \"$c${b##refs/heads/}$w$i$r\"\n+\t\t\t\tprintf \" (%s)\" \"$c${b##refs/heads/}$w$i$s$r\"\n \t\t\tfi\n \t\tfi\n \tfi\n-- \n1.6.2\n\n-- \nVorstand/Board of Management:\nDr. Bernd Finkbeiner, Dr. Roland Niemeier, \nDr. Arno Steitz, Dr. Ingrid Zech\nVorsitzender des Aufsichtsrats/\nChairman of the Supervisory Board:\nMichel Lepert\nSitz/Registered Office: Tuebingen\nRegistergericht/Registration Court: Stuttgart\nRegisternummer/Commercial Register No.: HRB 382196 \n"},{"id":"113827","messageId":"7v4ovo4xyt.fsf@alter.siamese.dyndns.org","threadId":"19335","inReplyTo":"20090513112535.GD2106@bug.science-computing.de","subject":"Re: [PATCH] Showing stash state in bash prompt","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-05-13T19:14:18Z","receivedAt":"2009-05-13T19:14:18Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Daniel Trstenjak <Daniel.Trstenjak@science-computing.de> writes:\n\n> Showing stash state in bash prompt.\n\nThat's what you already said in the \"Subject:\" ;-)\n\nHere in the proposed commit message, you describe what the code after\napplying your patch does in a bit more detail, defend why such a new\nbehaviour is desirable, and defend why your implementation is superior\nthan possible alternative solutions to achieve that goal.\n\nGoing back to the \"Subject: \", we typically put the name of the affected\narea and colon to the message, and use imperative mood, as if you are\ngiving an order to the code to \"do this (instead of what you currently\ndo)\".\n\nE.g.\n\n\tSubject: [PATCH] completion: show presense of stashed changes\n\n\tUsers often forget that there are stashed changes that want to be\n\tunstashed.  Add a '$' in the prompt string to remind them.\n\n\tSigned-off-by: ...\n\nNote that I do not necessarily agree with the above justification; I am\njust illustrating the established style around here.\n\n> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\n> index 1683e6d..86e39a5 100755\n> --- a/contrib/completion/git-completion.bash\n> +++ b/contrib/completion/git-completion.bash\n> @@ -117,6 +117,7 @@ __git_ps1 ()\n>  \n>  \t\tlocal w\n>  \t\tlocal i\n> +\t\tlocal s\n>  \t\tlocal c\n>  \n>  \t\tif [ \"true\" = \"$(git rev-parse --is-inside-git-dir 2>/dev/null)\" ]; then\n\nOk.\n\n> @@ -136,15 +137,19 @@ __git_ps1 ()\n>  \t\t\t\t\telse\n>  \t\t\t\t\t\ti=\"#\"\n>  \t\t\t\t\tfi\n> +\t\t\t\t\tstash_list=`git stash list`\n\nDon't you want to localize this variable to avoid contaminating the\nnamespace?\n\n> +\t\t\t\t\tif [ -n \"$stash_list\" ]; then\n> +\t\t\t\t\t        s=\"$\"\n\nIs the presense the only thing that matters?  Notice that I reworded your\n\"stash state\" to \"presense of\" to clarify that you are giving only one bit\nof information in the counter-proposed \"Subject:\" above.\n\nI personally prefer your \"only one bit\" patch over a possible alternative\nto count the stash entries with \"git stash list | wc -l\" that would be way\nmore costly, and if you thought about such an alternative and discarded\nit, it would save other people's time if you say so in your proposed\ncommit message.  So...\n\n\tSubject: [PATCH] completion: show presense of stashed changes\n\n\tUsers often forget that there are stashed changes that want to be\n\tunstashed.  Add a '$' in the prompt string to remind them when\n\tthere is a stashed state.\n\n\tWe could count and show the number of stash entries instead, but\n        that would be more costly at runtime than it is worth.\n\n\tSigned-off-by: ...\n\nand with localization of stash_list variable I think the patch becomes\nbetter.\n\nThanks.\n"},{"id":"113948","messageId":"200905142025.02592.trast@student.ethz.ch","threadId":"19335","inReplyTo":"7v4ovo4xyt.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] Showing stash state in bash prompt","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2009-05-14T18:24:21Z","receivedAt":"2009-05-14T18:24:21Z","isPatch":true,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"Junio C Hamano wrote:\n> Daniel Trstenjak <Daniel.Trstenjak@science-computing.de> writes:\n> \n> > Showing stash state in bash prompt.\n[...]\n> \tSubject: [PATCH] completion: show presense of stashed changes\n> \n> \tUsers often forget that there are stashed changes that want to be\n> \tunstashed.  Add a '$' in the prompt string to remind them.\n\nI'd hate to see this go in without any sort of configurability, since\nI would have to patch it out again for my own builds.\n\nThe way git-stash is currently documented teaches a stash/apply\nworkflow, in which pop is not used at all.  For example, in\ngit-stash.txt itself, the description of 'apply' has all the meat\nwhile 'pop' just refers to 'apply'.  In user-manual.txt, there is an\nexample that teaches stash/apply.\n\nThis may historically be because 'git stash pop' was added later on:\n\n  bd56ff5 (git-stash: add new 'pop' subcommand, 2008-02-22)\n  f2c66ed (Add git-stash script, 2007-06-30)\n\nBut IMHO it would not be a good idea to teach people stash/pop anyway:\n'stash drop' is irreversible, because the stash is itself implemented\nthrough the reflog and thus not guarded by one.\n\nAnd unfortunately, for people who use stash/apply instead of stash/pop\n(including me :-), the proposed indicator merely shows if they have\never used stash in the current repository.\n\n-- \nThomas Rast\ntrast@{inf,student}.ethz.ch\n"},{"id":"113980","messageId":"buo1vqrqj2n.fsf@dhlpc061.dev.necel.com","threadId":"19335","inReplyTo":"200905142025.02592.trast@student.ethz.ch","subject":"Re: [PATCH] Showing stash state in bash prompt","fromName":"Miles Bader","fromEmail":"miles@gnu.org","sentAt":"2009-05-15T00:57:20Z","receivedAt":"2009-05-15T00:57:20Z","isPatch":true,"sender":{"key":"miles@gnu.org","avatar":"https://gravatar.com/avatar/01069b69593af7bff28e2f97afeb3644ae6fe2f5f56cb3a8cf34c5fb8c36efe5?d=mp&s=160"},"body":"Thomas Rast <trast@student.ethz.ch> writes:\n> But IMHO it would not be a good idea to teach people stash/pop anyway:\n> 'stash drop' is irreversible, because the stash is itself implemented\n> through the reflog and thus not guarded by one.\n\nI don't understand why you say this -- sure \"drop\" is dangerous, but\nthat's exactly why you should use \"pop\" instead, because it makes sure\nthe changes are _somewhere_.  I found with the old (pre-\"pop\") stash,\nI'd often end up in a situation where I'd lose track of whether I had\ndone a stash apply or not, and the risk of inadvertently doing a drop\n_without_ a corresponding apply was very real.\n\nstash/pop is safer, more convenient, and I think it better matches how\npeople actually work.\n\n-Miles\n\n-- \nWhat the fuck do white people have to be blue about!?  Banana Republic ran\nout of Khakis?  The Espresso Machine is jammed?  Hootie and The Blowfish\nare breaking up??!  Shit, white people oughtta understand, their job is to\nGIVE people the blues, not to get them!  -- George Carlin\n"},{"id":"113984","messageId":"20090515021105.GA19241@coredump.intra.peff.net","threadId":"19335","inReplyTo":"buo1vqrqj2n.fsf@dhlpc061.dev.necel.com","subject":"Re: [PATCH] Showing stash state in bash prompt","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-05-15T02:11:05Z","receivedAt":"2009-05-15T02:11:05Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, May 15, 2009 at 09:57:20AM +0900, Miles Bader wrote:\n\n> Thomas Rast <trast@student.ethz.ch> writes:\n> > But IMHO it would not be a good idea to teach people stash/pop anyway:\n> > 'stash drop' is irreversible, because the stash is itself implemented\n> > through the reflog and thus not guarded by one.\n> \n> I don't understand why you say this -- sure \"drop\" is dangerous, but\n> that's exactly why you should use \"pop\" instead, because it makes sure\n> the changes are _somewhere_.  I found with the old (pre-\"pop\") stash,\n> I'd often end up in a situation where I'd lose track of whether I had\n> done a stash apply or not, and the risk of inadvertently doing a drop\n> _without_ a corresponding apply was very real.\n\n\"pop\" doesn't always succeed. If you have conflicts in applying, then\nyou end up with conflict markers, and the stash remains. You then fix up\nand commit as you see fit, but your stash is still there. So this bash\nprompt will nag you, which I think is what Thomas was complaining about\n(but perhaps the nagging would then convince you to keep a cleaner stash\narea by dropping the resolved stash).\n\n-Peff\n"},{"id":"113986","messageId":"43d8ce650905142339p266c2f0fye1174036d6251ed0@mail.gmail.com","threadId":"19335","inReplyTo":"20090515021105.GA19241@coredump.intra.peff.net","subject":"Re: [PATCH] Showing stash state in bash prompt","fromName":"John Tapsell","fromEmail":"johnflux@gmail.com","sentAt":"2009-05-15T06:39:18Z","receivedAt":"2009-05-15T06:39:18Z","isPatch":true,"sender":{"key":"johnflux@gmail.com","avatar":"https://gravatar.com/avatar/25f70d4c0f96396b84a2e34bcd9bdc233462c7b4be29b5fdca8266fc53f30b0c?d=mp&s=160"},"body":">> I'd often end up in a situation where I'd lose track of whether I had\n>> done a stash apply or not, and the risk of inadvertently doing a drop\n\nWhile we're on this - would anyone else like to see a \"git unstash\" as\nan alias to \"git stash apply\" ?\nFor me it seems more natural to be able to do :\n\ngit stash\nsomething\ngit unstash\n"},{"id":"113987","messageId":"81932ACA-EE6B-4922-9506-13DB5D6EF551@silverinsanity.com","threadId":"19335","inReplyTo":"43d8ce650905142339p266c2f0fye1174036d6251ed0@mail.gmail.com","subject":"Re: [PATCH] Showing stash state in bash prompt","fromName":"Brian Gernhardt","fromEmail":"benji@silverinsanity.com","sentAt":"2009-05-15T07:01:44Z","receivedAt":"2009-05-15T07:01:44Z","isPatch":true,"sender":{"key":"benji@silverinsanity.com","avatar":"https://gravatar.com/avatar/e06c101dbc25c68114d859b4a9ec7cf8a2c52fd2b0270ef0eac0e2e63ff22311?d=mp&s=160"},"body":"\nOn May 15, 2009, at 2:39 AM, John Tapsell wrote:\n\n>>> I'd often end up in a situation where I'd lose track of whether I  \n>>> had\n>>> done a stash apply or not, and the risk of inadvertently doing a  \n>>> drop\n>\n> While we're on this - would anyone else like to see a \"git unstash\" as\n> an alias to \"git stash apply\" ?\n> For me it seems more natural to be able to do :\n>\n> git stash\n> something\n> git unstash\n\nTry this:\n\ngit config --global alias.unstash \"stash apply\"\n\n~~ B\n"},{"id":"113988","messageId":"fc339e4a0905150012t28c59a5erb3f9d9eac924ab14@mail.gmail.com","threadId":"19335","inReplyTo":"81932ACA-EE6B-4922-9506-13DB5D6EF551@silverinsanity.com","subject":"Re: [PATCH] Showing stash state in bash prompt","fromName":"Miles Bader","fromEmail":"miles@gnu.org","sentAt":"2009-05-15T07:12:10Z","receivedAt":"2009-05-15T07:12:10Z","isPatch":true,"sender":{"key":"miles@gnu.org","avatar":"https://gravatar.com/avatar/01069b69593af7bff28e2f97afeb3644ae6fe2f5f56cb3a8cf34c5fb8c36efe5?d=mp&s=160"},"body":"2009/5/15 Brian Gernhardt <benji@silverinsanity.com>:\n> git config --global alias.unstash \"stash apply\"\n\nTho it should really be \"stash pop\"\n\n-miles\n-- \nDo not taunt Happy Fun Ball.\n"},{"id":"114911","messageId":"ef178b42f4db36811e07f1bca4436ed79e550957.1243502202.git.trast@student.ethz.ch","threadId":"19335","inReplyTo":"20090515021105.GA19241@coredump.intra.peff.net","subject":"[RFC PATCH] Documentation: teach stash/pop workflow instead of stash/apply","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2009-05-28T09:40:15Z","receivedAt":"2009-05-28T09:40:15Z","isPatch":true,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"Recent discussion on the list showed some comments in favour of a\nstash/pop workflow:\n\n  http://marc.info/?l=git&m=124234911423358&w=2\n  http://marc.info/?l=git&m=124235348327711&w=2\n\nChange the stash documentation and examples to document pop in its own\nright (and apply in terms of pop), and use stash/pop in the examples.\n\nSigned-off-by: Thomas Rast <trast@student.ethz.ch>\n---\n\nI meant to write this for a while now, but never got around to it.\n\nJeff King wrote:\n> On Fri, May 15, 2009 at 09:57:20AM +0900, Miles Bader wrote:\n> > I don't understand why you say this -- sure \"drop\" is dangerous, but\n> > that's exactly why you should use \"pop\" instead, because it makes sure\n> > the changes are _somewhere_.  I found with the old (pre-\"pop\") stash,\n> > I'd often end up in a situation where I'd lose track of whether I had\n> > done a stash apply or not, and the risk of inadvertently doing a drop\n> > _without_ a corresponding apply was very real.\n> \n> \"pop\" doesn't always succeed. If you have conflicts in applying, then\n> you end up with conflict markers, and the stash remains. You then fix up\n> and commit as you see fit, but your stash is still there. So this bash\n> prompt will nag you, which I think is what Thomas was complaining about\n> (but perhaps the nagging would then convince you to keep a cleaner stash\n> area by dropping the resolved stash).\n\nActually I was mostly concerned about dropping the stashes at all.\nBut I guess if you treat the stash as a short-term stack that holds a\nchange or two while you're working on something else, stash/pop fits\nbetter.\n\nI'd still prefer some configurability in the original patch, as I\nthink nagging the user into discarding data is a bad thing, even\nthough I now agree that if the 'pop' actually went through, it's not\nreally discarded.  (Also, ISTR a discussion about automatic gc'ing of\nthe stash reflog where a few people said they expect to hit any\nreasonably short time limit in some of their repos and thus risk\nlosing work; regardless of cleanup disclipline, they would also have\nthe prompt on all the time).\n\n\nBy the way, why doesn't gmane find these mails?  I tried things like\n\n  http://search.gmane.org/?query=stash&group=gmane.comp.version-control.git&author=miles@gnu.org\n\nbut the entire thread seems to be missing from gmane.\n\n\n\n Documentation/git-stash.txt   |   30 ++++++++++++++++--------------\n Documentation/user-manual.txt |    4 ++--\n 2 files changed, 18 insertions(+), 16 deletions(-)\n\ndiff --git a/Documentation/git-stash.txt b/Documentation/git-stash.txt\nindex 051f94d..1cc24cc 100644\n--- a/Documentation/git-stash.txt\n+++ b/Documentation/git-stash.txt\n@@ -75,14 +75,22 @@ show [<stash>]::\n \tit will accept any format known to 'git-diff' (e.g., `git stash show\n \t-p stash@\\{1}` to view the second most recent stash in patch form).\n \n-apply [--index] [<stash>]::\n+pop [<stash>]::\n \n-\tRestore the changes recorded in the stash on top of the current\n-\tworking tree state.  When no `<stash>` is given, applies the latest\n-\tone.  The working directory must match the index.\n+\tRemove a single stashed state from the stash list and apply it\n+\ton top of the current working tree state, i.e., do the inverse\n+\toperation of `git stash save`. The working directory must\n+\tmatch the index.\n +\n-This operation can fail with conflicts; you need to resolve them\n-by hand in the working tree.\n+Applying the state can fail with conflicts; in this case, it is not\n+removed from the stash list. You need to resolve the conflicts by hand\n+and call `git stash drop` manually afterwards.\n++\n+When no `<stash>` is given, `stash@\\{0}` is assumed. See also `apply`.\n+\n+apply [--index] [<stash>]::\n+\n+\tLike `pop`, but do not remove the state from the stash list.\n +\n If the `--index` option is used, then tries to reinstate not only the working\n tree's changes, but also the index's ones. However, this can fail, when you\n@@ -112,12 +120,6 @@ drop [<stash>]::\n \tRemove a single stashed state from the stash list. When no `<stash>`\n \tis given, it removes the latest one. i.e. `stash@\\{0}`\n \n-pop [<stash>]::\n-\n-\tRemove a single stashed state from the stash list and apply on top\n-\tof the current working tree state. When no `<stash>` is given,\n-\t`stash@\\{0}` is assumed. See also `apply`.\n-\n create::\n \n \tCreate a stash (which is a regular commit object) and return its\n@@ -163,7 +165,7 @@ $ git pull\n file foobar not up to date, cannot merge.\n $ git stash\n $ git pull\n-$ git stash apply\n+$ git stash pop\n ----------------------------------------------------------------\n \n Interrupted workflow::\n@@ -192,7 +194,7 @@ You can use 'git-stash' to simplify the above, like this:\n $ git stash\n $ edit emergency fix\n $ git commit -a -m \"Fix in a hurry\"\n-$ git stash apply\n+$ git stash pop\n # ... continue hacking ...\n ----------------------------------------------------------------\n \ndiff --git a/Documentation/user-manual.txt b/Documentation/user-manual.txt\nindex dbbeb7e..0b88a51 100644\n--- a/Documentation/user-manual.txt\n+++ b/Documentation/user-manual.txt\n@@ -1520,10 +1520,10 @@ $ git commit -a -m \"blorpl: typofix\"\n ------------------------------------------------\n \n After that, you can go back to what you were working on with\n-`git stash apply`:\n+`git stash pop`:\n \n ------------------------------------------------\n-$ git stash apply\n+$ git stash pop\n ------------------------------------------------\n \n \n-- \n1.6.3.1.276.gb65cd\n"},{"id":"114977","messageId":"slrnh1ucqq.6ls.sitaramc@sitaramc.homelinux.net","threadId":"19335","inReplyTo":"ef178b42f4db36811e07f1bca4436ed79e550957.1243502202.git.trast@student.ethz.ch","subject":"Re: [RFC PATCH] Documentation: teach stash/pop workflow instead of stash/apply","fromName":"Sitaram Chamarty","fromEmail":"sitaramc@gmail.com","sentAt":"2009-05-29T00:59:06Z","receivedAt":"2009-05-29T00:59:06Z","isPatch":true,"sender":{"key":"sitaramc@gmail.com","avatar":"https://avatars.githubusercontent.com/u/43316?v=4"},"body":"On 2009-05-28 09:40:15, Thomas Rast <trast@student.ethz.ch> wrote:\n> Recent discussion on the list showed some comments in favour of a\n> stash/pop workflow:\n>\n>   http://marc.info/?l=git&m=124234911423358&w=2\n>   http://marc.info/?l=git&m=124235348327711&w=2\n>\n> Change the stash documentation and examples to document pop in its own\n> right (and apply in terms of pop), and use stash/pop in the examples.\n\n[snip]\n\n> +Applying the state can fail with conflicts; in this case, it is not\n> +removed from the stash list. You need to resolve the conflicts by hand\n> +and call `git stash drop` manually afterwards.\n\nFor what it is worth, when I take classes on git in $DAYJOB\nI insist on using only save/pop (and drop when needed as\ndescribed above).  My students are largely freshers with\nlittle or no dev experience, and this just seems much more\nintuitive.  Even the aspect of having to drop manually is\nlogical, because something exceptional happened.\n\nI certainly would appreciate this patch, to answer the \"RFC\"\naspect in your subject line.\n"},{"id":"114982","messageId":"7v1vq8h3ld.fsf@alter.siamese.dyndns.org","threadId":"19335","inReplyTo":"ef178b42f4db36811e07f1bca4436ed79e550957.1243502202.git.trast@student.ethz.ch","subject":"Re: [RFC PATCH] Documentation: teach stash/pop workflow instead of stash/apply","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-05-29T05:37:18Z","receivedAt":"2009-05-29T05:37:18Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"FWIW, I think the change makes sense.\n"}]}