Git development
 help / color / mirror / Atom feed
* [PATCH] add "-f" option to git-commit-script to force commit withoutchanges
@ 2005-07-28 14:47 Johannes Schindelin
  2005-07-29  2:24 ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: Johannes Schindelin @ 2005-07-28 14:47 UTC (permalink / raw)
  To: git


Sometimes a failed automatic merge means that we do not want those
changes. In this case, it is desirable to commit the current HEAD (as if
actually something was merged).

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>

---

 git-commit-script |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

89e6c9495d7877e9922b22d6c87f51c6902b7056
diff --git a/git-commit-script b/git-commit-script
--- a/git-commit-script
+++ b/git-commit-script
@@ -6,12 +6,16 @@
 . git-sh-setup-script || die "Not a git archive"

 usage () {
-	die 'git commit [-m existing-commit] [<path>...]'
+	die 'git commit [-f] [-m existing-commit] [<path>...]'
 }

+force=false
 while case "$#" in 0) break ;; esac
 do
     case "$1" in
+    -f) shift
+        force=true
+        ;;
     -m) shift
         case "$#" in
 	0) usage ;;
@@ -82,7 +86,7 @@ else
 	fi >.editmsg
 	git-status-script >>.editmsg
 fi
-if [ "$?" != "0" ]
+if [ "$?" != "0" -a $force = false ]
 then
 	cat .editmsg
 	rm .editmsg

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-07-29 11:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-28 14:47 [PATCH] add "-f" option to git-commit-script to force commit withoutchanges Johannes Schindelin
2005-07-29  2:24 ` Junio C Hamano
2005-07-29 11:06   ` Johannes Schindelin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox