threads / patch / 23096

patchAuto-correct git pull -ff to git pull --ff.

Subject: [PATCH] Auto-correct git pull -ff to git pull --ff.

## tl;dr

One message between Mar 20, 2010 and Mar 20, 2010. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

tsuna· Mar 20, 2010, 01:59 UTC · lore

Hi there, I attached a trivial patch that auto-corrects a frequent typo does not trigger any error with git pull. I find it useful so I hope others will too.

-- 
Benoit "tsuna" Sigoure


From e4d43640d80fca93fda45d13e02f3fedf09f639a Mon Sep 17 00:00:00 2001
From: Benoit Sigoure <tsunanet@gmail.com>
Date: Wed, 17 Mar 2010 17:11:44 -0700
Subject: [PATCH] Auto-correct git pull -ff to git pull --ff.

This frequent typo does not trigger any error because git pull doesn't
recognize -ff and passes it through to git fetch, which parses it as a
short option, as if the option -f was simply specified twice.
---
 git-pull.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/git-pull.sh b/git-pull.sh
index d45b50c..be85032 100755
--- a/git-pull.sh
+++ b/git-pull.sh
@@ -66,7 +66,7 @@ do
 		squash=--squash ;;
 	--no-sq|--no-squ|--no-squa|--no-squas|--no-squash)
 		squash=--no-squash ;;
-	--ff)
+	-ff|--ff)
 		no_ff=--ff ;;
 	--no-ff)
 		no_ff=--no-ff ;;
-- 
1.7.0.2.279.gf1ba1c

← back to recent threads