From c9fc748f84857a237f47deb91f87499e82865c83 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sat, 24 Sep 2005 15:09:48 -0700 Subject: git-grep: fix 'git grep -e $pattern' handling People typically say 'grep -e $pattern' because $pattern has a leading dash which would be mistaken as a grep flag. Make sure we pass -e in front of $pattern when we invoke grep. Signed-off-by: Junio C Hamano diff --git a/git-grep.sh b/git-grep.sh index 51924fd..e7a35eb 100755 --- a/git-grep.sh +++ b/git-grep.sh @@ -40,4 +40,4 @@ while : ; do shift done git-ls-files -z "${git_flags[@]}" "$@" | - xargs -0 grep "${flags[@]}" "$pattern" + xargs -0 grep "${flags[@]}" -e "$pattern" -- cgit v0.10.2-6-g49f6 From fbaf834de12efb43dea8d2679a040462e9d3d03d Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sat, 24 Sep 2005 23:33:02 -0700 Subject: show-branch: fix commit naming breakage. It was ignoring the generation number of the commit when naming 2nd and later parents, showing "(linus^n)^2" for any incorrectly as "linus^2". Signed-off-by: Junio C Hamano diff --git a/show-branch.c b/show-branch.c index 8cc0755..5778a59 100644 --- a/show-branch.c +++ b/show-branch.c @@ -138,7 +138,20 @@ static void name_commits(struct commit_list *list, nth++; if (p->object.util) continue; - sprintf(newname, "%s^%d", n->head_name, nth); + switch (n->generation) { + case 0: + sprintf(newname, "%s^%d", + n->head_name, nth); + break; + case 1: + sprintf(newname, "%s^^%d", + n->head_name, nth); + break; + default: + sprintf(newname, "%s~%d^%d", + n->head_name, n->generation, + nth); + } name_commit(p, strdup(newname), 0); i++; name_first_parent_chain(p); -- cgit v0.10.2-6-g49f6