summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8c1f0b4)
raw | patch | inline | side by side (parent: 8c1f0b4)
author | Junio C Hamano <junkio@cox.net> | |
Sun, 16 Apr 2006 06:46:36 +0000 (23:46 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sun, 16 Apr 2006 06:46:36 +0000 (23:46 -0700) |
Merging all three option parsers related to whatchanged is
unarguably the right thing, but the fallout was too big to scare
me away. Let's try it once again, but once step at time.
This splits out init_revisions() call from setup_revisions(), so
that the callers can set different defaults to match the
traditional benaviour.
The rev-list command is still broken in a big way, which is the
topic of next step.
Signed-off-by: Junio C Hamano <junkio@cox.net>
unarguably the right thing, but the fallout was too big to scare
me away. Let's try it once again, but once step at time.
This splits out init_revisions() call from setup_revisions(), so
that the callers can set different defaults to match the
traditional benaviour.
The rev-list command is still broken in a big way, which is the
topic of next step.
Signed-off-by: Junio C Hamano <junkio@cox.net>
commit.h | patch | blob | history | |
diff-tree.c | patch | blob | history | |
git.c | patch | blob | history | |
http-push.c | patch | blob | history | |
revision.c | patch | blob | history |
diff --git a/commit.h b/commit.h
index 918c9ab5e4eb3173c0d0a0748df40ef857fc7b8b..de142afe733a6ecd3bcec2abd9f71a358b4ae09d 100644 (file)
--- a/commit.h
+++ b/commit.h
CMIT_FMT_FULL,
CMIT_FMT_FULLER,
CMIT_FMT_ONELINE,
+
+ CMIT_FMT_UNSPECIFIED,
};
extern enum cmit_fmt get_commit_format(const char *arg);
diff --git a/diff-tree.c b/diff-tree.c
index 979f792b6758101cb490f36ba3acff5d7d4b4473..e5787985373739dee8dd8874ea9f8f6ff073af27 100644 (file)
--- a/diff-tree.c
+++ b/diff-tree.c
git_config(git_diff_config);
nr_sha1 = 0;
+ init_revisions(opt);
opt->abbrev = 0;
argc = setup_revisions(argc, argv, opt, NULL);
index 9d885569d8451d73a4aaf01fefa994b31041efee..d17262623028f7fc64288949743db6b8bd7df949 100644 (file)
--- a/git.c
+++ b/git.c
const char *commit_prefix = "commit ";
int shown = 0;
+ init_revisions(&rev);
rev.abbrev = DEFAULT_ABBREV;
argc = setup_revisions(argc, argv, &rev, "HEAD");
if (argc > 1)
diff --git a/http-push.c b/http-push.c
index 19a0f772e7bf729755c66ab38f5dfb64ae784f00..4a9dcf2bf64887735573d7c02b6b9f21ad4644f6 100644 (file)
--- a/http-push.c
+++ b/http-push.c
commit_argv[3] = old_sha1_hex;
commit_argc++;
}
+ init_revisions(&revs);
setup_revisions(commit_argc, commit_argv, &revs, NULL);
free(new_sha1_hex);
if (old_sha1_hex) {
diff --git a/revision.c b/revision.c
index bdf8005aec6428f274ad02af04366aaa5339bb18..9693b6e4c7969307e2509e4e479b05a432a52186 100644 (file)
--- a/revision.c
+++ b/revision.c
void init_revisions(struct rev_info *revs)
{
- unsigned abbrev = revs->abbrev;
-
memset(revs, 0, sizeof(*revs));
- revs->abbrev = abbrev;
+ revs->abbrev = DEFAULT_ABBREV;
revs->ignore_merges = 1;
revs->pruning.recursive = 1;
revs->pruning.add_remove = file_add_remove;
@@ -516,8 +514,6 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch
const char **unrecognized = argv + 1;
int left = 1;
- init_revisions(revs);
-
/* First, search for "--" */
seen_dashdash = 0;
for (i = 1; i < argc; i++) {