From: Theodore Ts'o Date: Wed, 22 May 2013 12:11:17 GMT Subject: [PATCH -v2] guilt: force the use of bare branches Message-ID: <1369224677-16404-1-git-send-email-tytso@mit.edu> In-Reply-To: <20130522032946.GA101217@meili.valhalla.31bits.net> To make it harder to accidentally do "git push" with a guilt patch applied, "guilt push" changes branch from e.g. "master" to "guilt/master" starting with commit 67d3af63f422. This is a feature which I use for ext4 development; I actually *do* want to be able to push patches to the dev branch, which is a rewindable branch much like git's "pu" branch. Allow the use of the environment variable GUILT_FORCE_BARE_BRANCH which disables the new behavior introduced by commit 67d3af63f422. Signed-off-by: "Theodore Ts'o" Cc: Per Cederqvist --- guilt | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/guilt b/guilt index e9b2aab..35a84dc 100755 --- a/guilt +++ b/guilt @@ -914,13 +914,22 @@ else die "Unsupported operating system: $UNAME_S" fi -if [ "$branch" = "$raw_git_branch" ] && [ -n "`get_top 2>/dev/null`" ] -then - # This is for compat with old repositories that still have a - # pushed patch without the new-style branch prefix. +if [ -n "`get_top 2>/dev/null`" ]; then + # + # If we have repositories patches pushed, then use whatever scheme + # is currently in use + # + if [ "$branch" = "$raw_git_branch" ]; then old_style_prefix=true + else + old_style_prefix=false + fi else + if [ "$(git config --bool --get guilt.bareBranch)" = "true" ]; then + old_style_prefix=true + else old_style_prefix=false + fi fi _main "$@" -- 1.7.12.rc0.22.gcdd159b