From de5f2bf3612a43af074a98fd1fcdef6a403daf3f Mon Sep 17 00:00:00 2001 From: Matthias Kestenholz Date: Wed, 3 May 2006 12:51:40 +0200 Subject: [PATCH 1/5] fix various typos in documentation Signed-off-by: Matthias Kestenholz Signed-off-by: Junio C Hamano --- Documentation/git-diff-tree.txt | 2 +- Documentation/git-update-index.txt | 4 ++-- revision.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Documentation/git-diff-tree.txt b/Documentation/git-diff-tree.txt index 2169169850..906830d4bf 100644 --- a/Documentation/git-diff-tree.txt +++ b/Documentation/git-diff-tree.txt @@ -92,7 +92,7 @@ separated with a single space are given. Furthermore, it lists only files which were modified from all parents. --cc:: +--cc:: This flag changes the way a merge commit patch is displayed, in a similar way to the '-c' option. It implies the '-c' and '-p' options and further compresses the patch output diff --git a/Documentation/git-update-index.txt b/Documentation/git-update-index.txt index d4137fc87e..e01b42f445 100644 --- a/Documentation/git-update-index.txt +++ b/Documentation/git-update-index.txt @@ -10,8 +10,8 @@ SYNOPSIS -------- [verse] 'git-update-index' - [--add] [--remove | --force-remove] [--replace] - [--refresh [-q] [--unmerged] [--ignore-missing]] + [--add] [--remove | --force-remove] [--replace] + [--refresh] [-q] [--unmerged] [--ignore-missing] [--cacheinfo ]\* [--chmod=(+|-)x] [--assume-unchanged | --no-assume-unchanged] diff --git a/revision.c b/revision.c index 03dd238939..5f2f0be382 100644 --- a/revision.c +++ b/revision.c @@ -537,7 +537,7 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch revs->max_count = atoi(arg + 12); continue; } - /* accept -, like traditilnal "head" */ + /* accept -, like traditional "head" */ if ((*arg == '-') && isdigit(arg[1])) { revs->max_count = atoi(arg + 1); continue; From 060729dd7e4e7d366f09d2e13d796f05ec1734a9 Mon Sep 17 00:00:00 2001 From: Matthias Kestenholz Date: Wed, 3 May 2006 12:53:19 +0200 Subject: [PATCH 2/5] add documentation for update-index --unresolve Signed-off-by: Matthias Kestenholz Signed-off-by: Junio C Hamano --- Documentation/git-update-index.txt | 6 +++++- update-index.c | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Documentation/git-update-index.txt b/Documentation/git-update-index.txt index d4137fc87e..4bdb2b0ffa 100644 --- a/Documentation/git-update-index.txt +++ b/Documentation/git-update-index.txt @@ -15,7 +15,7 @@ SYNOPSIS [--cacheinfo ]\* [--chmod=(+|-)x] [--assume-unchanged | --no-assume-unchanged] - [--really-refresh] + [--really-refresh] [--unresolve] [--info-only] [--index-info] [-z] [--stdin] [--verbose] @@ -80,6 +80,10 @@ OPTIONS filesystem that has very slow lstat(2) system call (e.g. cifs). +--unresolve:: + Restores the 'unmerged' or 'needs updating' state of a + file during a merge if it was cleared by accident. + --info-only:: Do not create objects in the object database for all arguments that follow this flag; just insert diff --git a/update-index.c b/update-index.c index facec8d915..9fa3d2bb96 100644 --- a/update-index.c +++ b/update-index.c @@ -473,7 +473,7 @@ static void read_index_info(int line_termination) } static const char update_index_usage[] = -"git-update-index [-q] [--add] [--replace] [--remove] [--unmerged] [--refresh] [--cacheinfo] [--chmod=(+|-)x] [--info-only] [--force-remove] [--stdin] [--index-info] [--ignore-missing] [-z] [--verbose] [--] ..."; +"git-update-index [-q] [--add] [--replace] [--remove] [--unmerged] [--refresh] [--really-refresh] [--cacheinfo] [--chmod=(+|-)x] [--assume-unchanged] [--info-only] [--force-remove] [--stdin] [--index-info] [--unresolve] [--ignore-missing] [-z] [--verbose] [--] ..."; static unsigned char head_sha1[20]; static unsigned char merge_head_sha1[20]; From c8c893c62b0d9997e7dfe7bd5f636ddbf29ef619 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Wed, 3 May 2006 07:59:00 -0700 Subject: [PATCH 3/5] Fix "git-log --parents" breakage post v1.3.0 Post 1.3.0 "git log" forgets to list parent commits on the first line when --parents is given. git-cvsserver relied on it. Signed-off-by: Linus Torvalds Signed-off-by: Junio C Hamano --- log-tree.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/log-tree.c b/log-tree.c index 9634c4677f..b90ba6762a 100644 --- a/log-tree.c +++ b/log-tree.c @@ -3,6 +3,15 @@ #include "commit.h" #include "log-tree.h" +static void show_parents(struct commit *commit, int abbrev) +{ + struct commit_list *p; + for (p = commit->parents; p ; p = p->next) { + struct commit *parent = p->item; + printf(" %s", diff_unique_abbrev(parent->object.sha1, abbrev)); + } +} + void show_log(struct rev_info *opt, struct log_info *log, const char *sep) { static char this_header[16384]; @@ -14,7 +23,10 @@ void show_log(struct rev_info *opt, struct log_info *log, const char *sep) opt->loginfo = NULL; if (!opt->verbose_header) { - puts(sha1_to_hex(commit->object.sha1)); + fputs(diff_unique_abbrev(commit->object.sha1, abbrev_commit), stdout); + if (opt->parents) + show_parents(commit, abbrev_commit); + putchar('\n'); return; } @@ -40,7 +52,9 @@ void show_log(struct rev_info *opt, struct log_info *log, const char *sep) printf("%s%s", opt->commit_format == CMIT_FMT_ONELINE ? "" : "commit ", diff_unique_abbrev(commit->object.sha1, abbrev_commit)); - if (parent) + if (opt->parents) + show_parents(commit, abbrev_commit); + if (parent) printf(" (from %s)", diff_unique_abbrev(parent->object.sha1, abbrev_commit)); putchar(opt->commit_format == CMIT_FMT_ONELINE ? ' ' : '\n'); From 095acb8a2ac86c003d89886c5df7706c44912196 Mon Sep 17 00:00:00 2001 From: Martin Langhoff Date: Thu, 4 May 2006 10:53:37 +1200 Subject: [PATCH 4/5] cvsserver: use git-rev-list instead of git-log Signed-off-by: Martin Langhoff Signed-off-by: Junio C Hamano --- git-cvsserver.perl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/git-cvsserver.perl b/git-cvsserver.perl index 11d153c4cd..ffd9c66f94 100755 --- a/git-cvsserver.perl +++ b/git-cvsserver.perl @@ -2076,14 +2076,15 @@ sub update # TODO: log processing is memory bound # if we can parse into a 2nd file that is in reverse order # we can probably do something really efficient - my @git_log_params = ('--parents', '--topo-order'); + my @git_log_params = ('--pretty', '--parents', '--topo-order'); if (defined $lastcommit) { push @git_log_params, "$lastcommit..$self->{module}"; } else { push @git_log_params, $self->{module}; } - open(GITLOG, '-|', 'git-log', @git_log_params) or die "Cannot call git-log: $!"; + # git-rev-list is the backend / plumbing version of git-log + open(GITLOG, '-|', 'git-rev-list', @git_log_params) or die "Cannot call git-rev-list: $!"; my @commits; From 899707dac0c4a29b5b05a88a0017639508d48e7f Mon Sep 17 00:00:00 2001 From: Fredrik Kuivinen Date: Wed, 3 May 2006 23:28:46 +0200 Subject: [PATCH 5/5] blame: Fix path pruning This makes git-blame useable again, it has been totally broken for some time on larger repositories. Signed-off-by: Fredrik Kuivinen Signed-off-by: Junio C Hamano --- blame.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/blame.c b/blame.c index 07d2d27251..99ceea81df 100644 --- a/blame.c +++ b/blame.c @@ -515,9 +515,9 @@ static int compare_tree_path(struct rev_info* revs, paths[1] = NULL; diff_tree_setup_paths(get_pathspec(revs->prefix, paths), - &revs->diffopt); + &revs->pruning); ret = rev_compare_tree(revs, c1->tree, c2->tree); - diff_tree_release_paths(&revs->diffopt); + diff_tree_release_paths(&revs->pruning); return ret; } @@ -531,9 +531,9 @@ static int same_tree_as_empty_path(struct rev_info *revs, struct tree* t1, paths[1] = NULL; diff_tree_setup_paths(get_pathspec(revs->prefix, paths), - &revs->diffopt); + &revs->pruning); ret = rev_same_tree_as_empty(revs, t1); - diff_tree_release_paths(&revs->diffopt); + diff_tree_release_paths(&revs->pruning); return ret; } @@ -834,7 +834,7 @@ int main(int argc, const char **argv) args[0] = filename; args[1] = NULL; - diff_tree_setup_paths(args, &rev.diffopt); + diff_tree_setup_paths(args, &rev.pruning); prepare_revision_walk(&rev); process_commits(&rev, filename, &initial);