# [PATCH 0/5] Trivial cleanups

6 messages from 2013-09-14 to 2013-09-14. Participants: Felipe Contreras.
Thread: https://gitlist.dev/t/34932

## Felipe Contreras, 2013-09-14 06:38

Subject: [PATCH 0/5] Trivial cleanups
Message-ID: <1379140717-12940-1-git-send-email-felipe.contreras@gmail.com>
URL: https://gitlist.dev/e/1379140717-12940-1-git-send-email-felipe.contreras%40gmail.com

```
Felipe Contreras (5):
  branch: trivial style fix
  sha1-name: trivial style cleanup
  merge: simplify ff-only option
  t: replace pulls with merges
  pull: cleanup documentation

 Documentation/git-pull.txt             |  4 ++--
 builtin/branch.c                       |  3 +--
 builtin/merge.c                        | 11 ++---------
 sha1_name.c                            |  1 -
 t/annotate-tests.sh                    |  2 +-
 t/t4200-rerere.sh                      |  2 +-
 t/t9114-git-svn-dcommit-merge.sh       |  2 +-
 t/t9500-gitweb-standalone-no-errors.sh |  2 +-
 8 files changed, 9 insertions(+), 18 deletions(-)

-- 
1.8.4-fc

```

## Felipe Contreras, 2013-09-14 06:38

Subject: [PATCH 1/5] branch: trivial style fix
Message-ID: <1379140717-12940-2-git-send-email-felipe.contreras@gmail.com>
URL: https://gitlist.dev/e/1379140717-12940-2-git-send-email-felipe.contreras%40gmail.com
In-Reply-To: <1379140717-12940-1-git-send-email-felipe.contreras@gmail.com>

```
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 builtin/branch.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/builtin/branch.c b/builtin/branch.c
index 0836890..c5aa0ba 100644
--- a/builtin/branch.c
+++ b/builtin/branch.c
@@ -968,9 +968,8 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
 			die(_("no such branch '%s'"), argv[0]);
 		}
 
-		if (!branch_has_merge_config(branch)) {
+		if (!branch_has_merge_config(branch))
 			die(_("Branch '%s' has no upstream information"), branch->name);
-		}
 
 		strbuf_addf(&buf, "branch.%s.remote", branch->name);
 		git_config_set_multivar(buf.buf, NULL, NULL, 1);
-- 
1.8.4-fc

```

## Felipe Contreras, 2013-09-14 06:38

Subject: [PATCH 2/5] sha1-name: trivial style cleanup
Message-ID: <1379140717-12940-3-git-send-email-felipe.contreras@gmail.com>
URL: https://gitlist.dev/e/1379140717-12940-3-git-send-email-felipe.contreras%40gmail.com
In-Reply-To: <1379140717-12940-1-git-send-email-felipe.contreras@gmail.com>

```
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 sha1_name.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/sha1_name.c b/sha1_name.c
index 65ad066..9f3e340 100644
--- a/sha1_name.c
+++ b/sha1_name.c
@@ -343,7 +343,6 @@ static int get_short_sha1(const char *name, int len, unsigned char *sha1,
 	return status;
 }
 
-
 int for_each_abbrev(const char *prefix, each_abbrev_fn fn, void *cb_data)
 {
 	char hex_pfx[40];
-- 
1.8.4-fc

```

## Felipe Contreras, 2013-09-14 06:38

Subject: [PATCH 3/5] merge: simplify ff-only option
Message-ID: <1379140717-12940-4-git-send-email-felipe.contreras@gmail.com>
URL: https://gitlist.dev/e/1379140717-12940-4-git-send-email-felipe.contreras%40gmail.com
In-Reply-To: <1379140717-12940-1-git-send-email-felipe.contreras@gmail.com>

```
No functional changes.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 builtin/merge.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/builtin/merge.c b/builtin/merge.c
index 34a6166..da9fc08 100644
--- a/builtin/merge.c
+++ b/builtin/merge.c
@@ -186,13 +186,6 @@ static int option_parse_n(const struct option *opt,
 	return 0;
 }
 
-static int option_parse_ff_only(const struct option *opt,
-			  const char *arg, int unset)
-{
-	fast_forward = FF_ONLY;
-	return 0;
-}
-
 static struct option builtin_merge_options[] = {
 	{ OPTION_CALLBACK, 'n', NULL, NULL, NULL,
 		N_("do not show a diffstat at the end of the merge"),
@@ -210,9 +203,9 @@ static struct option builtin_merge_options[] = {
 	OPT_BOOL('e', "edit", &option_edit,
 		N_("edit message before committing")),
 	OPT_SET_INT(0, "ff", &fast_forward, N_("allow fast-forward (default)"), FF_ALLOW),
-	{ OPTION_CALLBACK, 0, "ff-only", NULL, NULL,
+	{ OPTION_SET_INT, 0, "ff-only", &fast_forward, NULL,
 		N_("abort if fast-forward is not possible"),
-		PARSE_OPT_NOARG | PARSE_OPT_NONEG, option_parse_ff_only },
+		PARSE_OPT_NOARG | PARSE_OPT_NONEG, NULL, FF_ONLY },
 	OPT_RERERE_AUTOUPDATE(&allow_rerere_auto),
 	OPT_BOOL(0, "verify-signatures", &verify_signatures,
 		N_("Verify that the named commit has a valid GPG signature")),
-- 
1.8.4-fc

```

## Felipe Contreras, 2013-09-14 06:38

Subject: [PATCH 4/5] t: replace pulls with merges
Message-ID: <1379140717-12940-5-git-send-email-felipe.contreras@gmail.com>
URL: https://gitlist.dev/e/1379140717-12940-5-git-send-email-felipe.contreras%40gmail.com
In-Reply-To: <1379140717-12940-1-git-send-email-felipe.contreras@gmail.com>

```
This is what the code intended.

No functional changes.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 t/annotate-tests.sh                    | 2 +-
 t/t4200-rerere.sh                      | 2 +-
 t/t9114-git-svn-dcommit-merge.sh       | 2 +-
 t/t9500-gitweb-standalone-no-errors.sh | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/t/annotate-tests.sh b/t/annotate-tests.sh
index d4e7f47..01deece 100644
--- a/t/annotate-tests.sh
+++ b/t/annotate-tests.sh
@@ -92,7 +92,7 @@ test_expect_success 'blame 2 authors + 1 branch2 author' '
 '
 
 test_expect_success 'merge branch1 & branch2' '
-	git pull . branch1
+	git merge branch1
 '
 
 test_expect_success 'blame 2 authors + 2 merged-in authors' '
diff --git a/t/t4200-rerere.sh b/t/t4200-rerere.sh
index 7f6666f..cf19eb7 100755
--- a/t/t4200-rerere.sh
+++ b/t/t4200-rerere.sh
@@ -172,7 +172,7 @@ test_expect_success 'first postimage wins' '
 	git show second^:a1 | sed "s/To die: t/To die! T/" >a1 &&
 	git commit -q -a -m third &&
 
-	test_must_fail git pull . first &&
+	test_must_fail git merge first &&
 	# rerere kicked in
 	! grep "^=======\$" a1 &&
 	test_cmp expect a1
diff --git a/t/t9114-git-svn-dcommit-merge.sh b/t/t9114-git-svn-dcommit-merge.sh
index f524d2f..d33d714 100755
--- a/t/t9114-git-svn-dcommit-merge.sh
+++ b/t/t9114-git-svn-dcommit-merge.sh
@@ -62,7 +62,7 @@ test_expect_success 'setup git mirror and merge' '
 	echo friend > README &&
 	cat tmp >> README &&
 	git commit -a -m "friend" &&
-	git pull . merge
+	git merge merge
 	'
 
 test_debug 'gitk --all & sleep 1'
diff --git a/t/t9500-gitweb-standalone-no-errors.sh b/t/t9500-gitweb-standalone-no-errors.sh
index 6fca193..3864388 100755
--- a/t/t9500-gitweb-standalone-no-errors.sh
+++ b/t/t9500-gitweb-standalone-no-errors.sh
@@ -328,7 +328,7 @@ test_expect_success \
 	 git add b &&
 	 git commit -a -m "On branch" &&
 	 git checkout master &&
-	 git pull . b &&
+	 git merge b &&
 	 git tag merge_commit'
 
 test_expect_success \
-- 
1.8.4-fc

```

## Felipe Contreras, 2013-09-14 06:38

Subject: [PATCH 5/5] pull: cleanup documentation
Message-ID: <1379140717-12940-6-git-send-email-felipe.contreras@gmail.com>
URL: https://gitlist.dev/e/1379140717-12940-6-git-send-email-felipe.contreras%40gmail.com
In-Reply-To: <1379140717-12940-1-git-send-email-felipe.contreras@gmail.com>

```
'origin/master' is very clear, no need to specify the 'remotes/' prefix,
or babysit the user.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 Documentation/git-pull.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Documentation/git-pull.txt b/Documentation/git-pull.txt
index 6ef8d59..4dd941d 100644
--- a/Documentation/git-pull.txt
+++ b/Documentation/git-pull.txt
@@ -39,7 +39,7 @@ Assume the following history exists and the current branch is
 "`master`":
 
 ------------
-	  A---B---C master on origin
+	  A---B---C origin/master
 	 /
     D---E---F---G master
 ------------
@@ -51,7 +51,7 @@ result in a new commit along with the names of the two parent commits
 and a log message from the user describing the changes.
 
 ------------
-	  A---B---C remotes/origin/master
+	  A---B---C origin/master
 	 /         \
     D---E---F---G---H master
 ------------
-- 
1.8.4-fc

```
