From: Jeff Sipek Date: Tue, 13 May 2014 21:41:14 GMT Subject: Re: [GUILT v2 25/29] "guilt push" now fails when there are no more patches to push. Message-ID: <20140513214114.GI4791@meili.valhalla.31bits.net> In-Reply-To: <1400013065-27919-26-git-send-email-cederp@opera.com> On Tue, May 13, 2014 at 10:31:01PM +0200, Per Cederqvist wrote: > This makes it easier to script operations on the entire queue, for > example run the test suite on each patch in the queue: > > guilt pop -a;while guilt push; do make test||break; done > > This brings "guilt push" in line with the push operation in Mercurial > Queues (hg qpush), which fails when there are no patches to apply. > > Updated the test suite. > > "guilt push -a" still does not fail. (It successfully manages to > ensure that all patches are pushed, even if it did not have to do > anything to make it so.) > > Signed-off-by: Per Cederqvist > --- > guilt-push | 19 ++++++----- > regression/t-020.out | 89 ++++++++++++++++++++++++++++++++++++++++++++++++++++ > regression/t-020.sh | 13 +++++++- > 3 files changed, 113 insertions(+), 8 deletions(-) ... > diff --git a/regression/t-020.sh b/regression/t-020.sh > index 906aec6..0f9f85d 100755 > --- a/regression/t-020.sh > +++ b/regression/t-020.sh > @@ -26,6 +26,17 @@ guilt series | while read n ; do > done > > # > +# pushing when there is nothing to push > +# > + > +shouldfail guilt push > +cmd guilt push -a > + > +cmd list_files > + > +cmd git log -p I don't particularly care for the git-log. Otherwise it looks good. Signed-off-by: Josef 'Jeff' Sipek > + > +# > # pop all > # > cmd guilt pop --all > @@ -61,7 +72,7 @@ cmd guilt pop --all > > npatches=`guilt series | wc -l` > for n in `_seq -2 $npatches`; do > - if [ $n -ge 0 ]; then > + if [ $n -gt 0 ]; then > cmd guilt push -n $n > else > shouldfail guilt push -n $n > -- > 1.8.3.1 > -- Evolution, n.: A hypothetical process whereby infinitely improbable events occur with alarming frequency, order arises from chaos, and no one is given credit.