--- oslo-series-v2/v2-0028-Added-guilt.reusebranch-configuration-option.patch +++ oslo-series-v3/v3-0029-Added-guilt.reusebranch-configuration-option.patch @@ -1,26 +1,28 @@ -From b06d1c8083d412ecc4bbbfdf8b7e8b1afa232893 Mon Sep 17 00:00:00 2001 +From 5dc04b0b3915087ec95c1440c0c9185ad28a2f37 Mon Sep 17 00:00:00 2001 From: Per Cederqvist -Date: Tue, 13 May 2014 21:40:23 +0200 -Subject: [GUILT v2 28/29] Added guilt.reusebranch configuration option. +Date: Fri, 16 May 2014 11:53:30 +0200 +Subject: [GUILT v3 29/31] Added guilt.reusebranch configuration option. To: Jeff Sipek Cc: git@vger.kernel.org -When the option is true (the default), Guilt does not create a new Git -branch when patches are applied. This way, you can switch between -Guilt 0.35 and the current version of Guilt with no issues. +When the option is true, Guilt does not create a new Git branch when +patches are applied. This way, you can switch between Guilt 0.35 and +the current version of Guilt with no issues. -At a future time, maybe a year after Guilt with guilt.reusebranch -support is released, the default should be changed to "false" to take -advantage of the ability to use a separate Git branch when patches are -applied. +By default, the option is false, so that all users will immediately +get the added protection against pushing a branch upstream with a +patch applied. While this might break guilt if a user is running both +version 0.35 and the current version against the same local +repository, it will not lead to data loss, and that situation is +probably rare. Signed-off-by: Per Cederqvist --- - guilt | 28 +++- + guilt | 24 ++- regression/scaffold | 1 + - regression/t-062.out | 441 +++++++++++++++++++++++++++++++++++++++++++++++++++ - regression/t-062.sh | 137 ++++++++++++++++ - 4 files changed, 601 insertions(+), 6 deletions(-) + regression/t-062.out | 420 +++++++++++++++++++++++++++++++++++++++++++++++++++ + regression/t-062.sh | 130 ++++++++++++++++ + 4 files changed, 569 insertions(+), 6 deletions(-) create mode 100644 regression/t-062.out create mode 100755 regression/t-062.sh diff --git a/guilt b/guilt index 9947acc..7c830eb 100755 --- a/guilt +++ b/guilt @@ -853,6 +853,9 @@ guilt_push_diff_context=1 # default diffstat value: true or false DIFFSTAT_DEFAULT="false" - +# default old_style_prefix value: true or false - +REUSE_BRANCH_DEFAULT="true" + +# default guilt.reusebranch value: true or false + +REUSE_BRANCH_DEFAULT="false" + # Prefix for guilt branches. GUILT_PREFIX=guilt/ - @@ -928,13 +935,22 @@ else + @@ -928,13 +935,18 @@ else die "Unsupported operating system: $UNAME_S" fi [...] + fi else - old_style_prefix=false - + if $reuse_branch; then - + old_style_prefix=true - + else - + old_style_prefix=false - + fi + + old_style_prefix="$reuse_branch" fi _main "$@" diff --git a/regression/t-062.out b/regression/t-062.out new file mode 100644 index 0000000..727b436 --- /dev/null +++ b/regression/t-062.out - @@ -0,0 +1,441 @@ + @@ -0,0 +1,420 @@ +% setup_repo +% git config guilt.reusebranch true +% guilt push -a [...] +ccd56089d1b5305a9d35617cb7f6f4b06ffa68ba commit refs/patches/master/mode +33633e7a1aa31972f125878baf7807be57b1672d commit refs/patches/master/modify +ffb7faa126a6d91bcdd44a494f76b96dd860b8b9 commit refs/patches/master/remove - +% git for-each-ref - +ccd56089d1b5305a9d35617cb7f6f4b06ffa68ba commit refs/heads/master - +37d588cc39848368810e88332bd03b083f2ce3ac commit refs/patches/master/add - +ccd56089d1b5305a9d35617cb7f6f4b06ffa68ba commit refs/patches/master/mode - +33633e7a1aa31972f125878baf7807be57b1672d commit refs/patches/master/modify - +ffb7faa126a6d91bcdd44a494f76b96dd860b8b9 commit refs/patches/master/remove - +% list_files - +d .git/patches - +d .git/patches/master - +d .git/refs/patches - +d .git/refs/patches/master - +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode - +f 413390f3906f16f30b054a4fb86c1e014b964504 .git/patches/master/remove - +f 71596bf71b72c2717e1aee378aabefbfa19ab7c8 .git/patches/master/status - +f 9c18cc7abe6b87f18503714a80a677b4094eb457 .git/patches/master/add - +f bacb4aad8a55fe4e7aa58a9ae169990bb764069f .git/patches/master/series - +f bc9ab2e0f5db99d483961e956e814d963f0309f8 .git/patches/master/modify - +r 33633e7a1aa31972f125878baf7807be57b1672d .git/refs/patches/master/modify - +r 37d588cc39848368810e88332bd03b083f2ce3ac .git/refs/patches/master/add - +r ccd56089d1b5305a9d35617cb7f6f4b06ffa68ba .git/refs/patches/master/mode - +r ffb7faa126a6d91bcdd44a494f76b96dd860b8b9 .git/refs/patches/master/remove +% guilt pop +Now at remove. +% git for-each-ref [...] +% git branch +* master +% guilt series diff --git a/regression/t-062.sh b/regression/t-062.sh new file mode 100755 index 0000000..85596ca --- /dev/null +++ b/regression/t-062.sh - @@ -0,0 +1,137 @@ + @@ -0,0 +1,130 @@ +#!/bin/bash +# - +# Test the branch-switching upgrade code + +# Test that the guilt.reusebranch=true setting works. +# + +source $REG_DIR/scaffold [...] +cmd list_files +cmd git for-each-ref + - +cmd git for-each-ref - + - +cmd list_files - + +for i in `seq 5`; do + if [ $i -ge 5 ]; then + shouldfail guilt pop [...] + cmd git for-each-ref +done + - +# Check that "pop -a" does the right thing. + +# Check that "pop -a" properly pops all patches. +cmd guilt push -a - + +cmd git for-each-ref - + +cmd guilt pop -a - + +cmd git for-each-ref + +# Check that pushing two patches converts the repo to now-style (since [...] +cmd git branch +cmd guilt series --