{"thread":{"id":"17397","subject":"git-am annoyance","startedAt":"2009-01-27T22:07:14Z","lastAt":"2009-01-27T22:49:35Z","messageCount":4,"participants":["Sverre Rabbelier","Junio C Hamano","Johannes Schindelin"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"102167","messageId":"bd6139dc0901271407i4406d5e6u6db1df9e5a7bdc4f@mail.gmail.com","threadId":"17397","inReplyTo":null,"subject":"git-am annoyance","fromName":"Sverre Rabbelier","fromEmail":"alturin@gmail.com","sentAt":"2009-01-27T22:07:14Z","receivedAt":"2009-01-27T22:07:14Z","isPatch":false,"sender":{"key":"alturin@gmail.com","avatar":null},"body":"Heya,\n\nObserve what happens if, on accident, rather than running a alias\n(amendall), the 'tab' didn't catch on:\n$ git am\n^C\n$ # ok, now what do I do?\n$ git status\n# On branch checker-caching\nnothing to commit (working directory clean)\n$ # looks like everything is ok, great\n$ # ... some time later\n$ # same thing happens\n$ git am\ncat: /home/sverre/code/Melange/.git/rebase-apply/next: No such file or directory\ncat: /home/sverre/code/Melange/.git/rebase-apply/utf8: No such file or directory\ncat: /home/sverre/code/Melange/.git/rebase-apply/keep: No such file or directory\ncat: /home/sverre/code/Melange/.git/rebase-apply/threeway: No such\nfile or directory\ncat: /home/sverre/code/Melange/.git/rebase-apply/apply-opt: No such\nfile or directory\ncat: /home/sverre/code/Melange/.git/rebase-apply/sign: No such file or directory\ncat: /home/sverre/code/Melange/.git/rebase-apply/next: No such file or directory\n/usr/local/libexec/git-core//git-am: line 319: test: : integer\nexpression expected\n/usr/local/libexec/git-core//git-am: line 326: test: : integer\nexpression expected\n$ # whoops?!\n\nWouldn't it be nice if \"git am\" without any arguments just prints a\nusage message? Either that, or provides you with a way to bail out? Or\nif it'd clean up after itself so that it doesn't crash?\n\n-- \nCheers,\n\nSverre Rabbelier\n"},{"id":"102171","messageId":"7vr62o1iww.fsf@gitster.siamese.dyndns.org","threadId":"17397","inReplyTo":"bd6139dc0901271407i4406d5e6u6db1df9e5a7bdc4f@mail.gmail.com","subject":"Re: git-am annoyance","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-01-27T22:30:23Z","receivedAt":"2009-01-27T22:30:23Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Sverre Rabbelier <alturin@gmail.com> writes:\n\n> Observe what happens if, on accident, rather than running a alias\n> (amendall), the 'tab' didn't catch on:\n> $ git am\n> ^C\n\nIt wants to read from the stdin as \"git am < mbox\" is a valid usage.\n\nA patch to detect that the input was killed with ^C and clean things up\nwould be welcome.  Also we may be able to detect \"-t 0\", too.\n\n> $ # ok, now what do I do?\n\nHere is one thing you could do.\n\n    $ PS1=': $(__git_ps1 \"%s\"); '\n    : master|AM/REBASE; \n    : master|AM/REBASE; git am --abort\n\nBut you are right.  We should be able to detect this.\n\nI think it was just people who often use \"am\" are so used to correctly the\ncommand that the state where no state files are created didn't happen\noften and never reported the breakage.\n"},{"id":"102181","messageId":"bd6139dc0901271437l19f1201ch867f1a7c2045e54b@mail.gmail.com","threadId":"17397","inReplyTo":"7vr62o1iww.fsf@gitster.siamese.dyndns.org","subject":"Re: git-am annoyance","fromName":"Sverre Rabbelier","fromEmail":"alturin@gmail.com","sentAt":"2009-01-27T22:37:45Z","receivedAt":"2009-01-27T22:37:45Z","isPatch":false,"sender":{"key":"alturin@gmail.com","avatar":null},"body":"On Tue, Jan 27, 2009 at 23:30, Junio C Hamano <gitster@pobox.com> wrote:\n> It wants to read from the stdin as \"git am < mbox\" is a valid usage.\n\nAh, ofcourse, that makes sense :).\n\n> A patch to detect that the input was killed with ^C and clean things up\n> would be welcome.  Also we may be able to detect \"-t 0\", too.\n\nWhat is '-t 0'? How would one detect this in bash?\n\n>> $ # ok, now what do I do?\n>\n> Here is one thing you could do.\n>\n>    $ PS1=': $(__git_ps1 \"%s\"); '\n>    : master|AM/REBASE;\n>    : master|AM/REBASE; git am --abort\n\nUgh, I couldn't even get that thing to work :P.\n\n> But you are right.  We should be able to detect this.\n\nThat would be nice indeed.\n\n> I think it was just people who often use \"am\" are so used to correctly the\n> command that the state where no state files are created didn't happen\n> often and never reported the breakage.\n\nOk, am glad I reported it then, now it's a known issue at least.\n\n-- \nCheers,\n\nSverre Rabbelier\n"},{"id":"102184","messageId":"alpine.DEB.1.00.0901272348380.3586@pacific.mpi-cbg.de","threadId":"17397","inReplyTo":"bd6139dc0901271437l19f1201ch867f1a7c2045e54b@mail.gmail.com","subject":"Re: git-am annoyance","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-01-27T22:49:35Z","receivedAt":"2009-01-27T22:49:35Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 27 Jan 2009, Sverre Rabbelier wrote:\n\n> What is '-t 0'? How would one detect this in bash?\n\nIt detects if file descriptor 0 (stdin) is a terminal.  \"man test\" to the \nrescue ;-)\n\nCiao,\nDscho\n\nP.S.: if I hadn't tried exactly that in my valgrind patches recently, I \nwould not have known either...\n"}]}