From ce8f34eb0c377b329dc59a7990cb2c2957fedf8b Mon Sep 17 00:00:00 2001 From: Josef 'Jeff' Sipek Date: Sat, 19 Oct 2013 17:34:52 -0400 Subject: [PATCH] commit: don't lose commits $ guilt push -n 4 $ guilt commit -n 2 $ guilt pop -a Would result in the guilt-commit'd patches not being on the git branch and not being in the series. Signed-off-by: Josef 'Jeff' Sipek --- guilt-commit | 6 +++++- regression/t-061.out | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/guilt-commit b/guilt-commit index 0486ae6..6ee1f16 100755 --- a/guilt-commit +++ b/guilt-commit @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright (c) Josef "Jeff" Sipek, 2008-2011 +# Copyright (c) Josef "Jeff" Sipek, 2008-2013 # USAGE="-n | -a | --all" @@ -35,6 +35,10 @@ esac # remove patch refs for what's being committed, and update series sed -n -e "${pat_commit}" "$applied" | while read pname; do + # update the base branch to the last committed patch + $old_style_prefix || git update-ref refs/heads/$branch \ + refs/patches/$branch/$pname + series_remove_patch "$pname" echo "$pname" | remove_patch_refs done diff --git a/regression/t-061.out b/regression/t-061.out index 8365236..ef0f335 100644 --- a/regression/t-061.out +++ b/regression/t-061.out @@ -454,7 +454,7 @@ fefbdcef61022d473838926619f31e030dd04fdc commit refs/patches/master/mode % guilt commit -n 2 % git for-each-ref fefbdcef61022d473838926619f31e030dd04fdc commit refs/heads/guilt/master -25465dc1687f3833ecbd4e8bca437e522d7026db commit refs/heads/master +5effcbeb303e8433935151d8c69f3bf63db1e8ef commit refs/heads/master fefbdcef61022d473838926619f31e030dd04fdc commit refs/patches/master/mode 9cbe2fc643b1a9e2179a8738f80424a1c2aa202d commit refs/patches/master/remove % git branch