summaryrefslogtreecommitdiff
path: root/rev-list.c
diff options
context:
space:
mode:
authorJohannes Schindelin <Johannes.Schindelin@gmx.de>2005-08-08 09:37:21 (GMT)
committerJunio C Hamano <junkio@cox.net>2005-08-10 05:28:21 (GMT)
commit76cd8eb619cf2896b5171d46d6bbf8e97d19e728 (patch)
tree18a4a1c7c0fcc3f136a3622dc584ea411a9df24c /rev-list.c
parent4852f7232b7a83fbd1b745520181bd67bf95911b (diff)
downloadgit-76cd8eb619cf2896b5171d46d6bbf8e97d19e728.zip
git-76cd8eb619cf2896b5171d46d6bbf8e97d19e728.tar.gz
git-76cd8eb619cf2896b5171d46d6bbf8e97d19e728.tar.bz2
[PATCH] add *--no-merges* flag to suppress display of merge commits
As requested by Junio (who suggested --single-parents-only, but this could forget a no-parent root). Also, adds a few missing options to the usage string. Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'rev-list.c')
-rw-r--r--rev-list.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/rev-list.c b/rev-list.c
index fae30a2..1a03bf7 100644
--- a/rev-list.c
+++ b/rev-list.c
@@ -15,12 +15,15 @@ static const char rev_list_usage[] =
" --max-count=nr\n"
" --max-age=epoch\n"
" --min-age=epoch\n"
+ " --parents\n"
" --bisect\n"
" --objects\n"
" --unpacked\n"
" --header\n"
" --pretty\n"
- " --merge-order [ --show-breaks ]";
+ " --no-merges\n"
+ " --merge-order [ --show-breaks ]\n"
+ " --topo-order";
static int unpacked = 0;
static int bisect_list = 0;
@@ -39,6 +42,7 @@ static int merge_order = 0;
static int show_breaks = 0;
static int stop_traversal = 0;
static int topo_order = 0;
+static int no_merges = 0;
static void show_commit(struct commit *commit)
{
@@ -82,6 +86,8 @@ static int filter_commit(struct commit * commit)
}
if (max_count != -1 && !max_count--)
return STOP;
+ if (no_merges && (commit->parents && commit->parents->next))
+ return CONTINUE;
return DO;
}
@@ -500,6 +506,10 @@ int main(int argc, char **argv)
prefix = "commit ";
continue;
}
+ if (!strncmp(arg, "--no-merges", 11)) {
+ no_merges = 1;
+ continue;
+ }
if (!strcmp(arg, "--parents")) {
show_parents = 1;
continue;