[PATCH] merge: default to @{upstream}

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



So 'git merge' is 'git merge @{upstream}' instead of 'git merge -h';
it's better to do something useful.

Signed-off-by: Felipe Contreras <felipe.contreras@xxxxxxxxx>
---
 builtin/merge.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/builtin/merge.c b/builtin/merge.c
index 42fff38..f23d669 100644
--- a/builtin/merge.c
+++ b/builtin/merge.c
@@ -983,9 +983,11 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
 	if (!allow_fast_forward && fast_forward_only)
 		die("You cannot combine --no-ff with --ff-only.");
 
-	if (!argc)
-		usage_with_options(builtin_merge_usage,
-			builtin_merge_options);
+	if (!argc) {
+		/* argv[argc] should be NULL, so we can hijack it */
+		argv[0] = "@{u}";
+		argc = 1;
+	}
 
 	/*
 	 * This could be traditional "merge <msg> HEAD <commit>..."  and
-- 
1.7.4.rc3

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]