summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2007-10-15 22:31:47 -0400
committerShawn O. Pearce <spearce@spearce.org>2007-10-15 22:31:47 -0400
commitd55e7c3acf72413563e695a19f7f66efac442064 (patch)
treeb12d163ceb3e56e36a90c82b9c075a3401cd00d3
parent03618b9df84a0e94e36fdb27060e605e85b956e9 (diff)
parent8492f00b4f28471af84d3887096257822c4d2bc9 (diff)
downloadgit-d55e7c3acf72413563e695a19f7f66efac442064.tar.gz
Merge branch 'maint'
* maint: Whip post 1.5.3.4 maintenance series into shape. rebase -i: use diff plumbing instead of porcelain Do not remove distributed configure script git-archive: document --exec git-reflog: document --verbose git-config: handle --file option with relative pathname properly clear_commit_marks(): avoid deep recursion git add -i: Remove unused variables git add -i: Fix parsing of abbreviated hunk headers git-config: don't silently ignore options after --list Clean up "git log" format with DIFF_FORMAT_NO_OUTPUT Fix embarrassing "git log --follow" bug Conflicts: RelNotes git-rebase--interactive.sh
-rw-r--r--Documentation/RelNotes-1.5.3.5.txt25
-rw-r--r--Documentation/git-archive.txt7
-rw-r--r--Documentation/git-reflog.txt5
-rw-r--r--Makefile5
-rw-r--r--builtin-config.c14
-rw-r--r--commit.c23
-rwxr-xr-xgit-add--interactive.perl27
-rwxr-xr-xgit-rebase--interactive.sh4
-rw-r--r--log-tree.c3
-rw-r--r--revision.c4
-rwxr-xr-xt/t3900-i18n-commit.sh2
-rw-r--r--t/t4013/diff.log_-SF_master1
12 files changed, 82 insertions, 38 deletions
diff --git a/Documentation/RelNotes-1.5.3.5.txt b/Documentation/RelNotes-1.5.3.5.txt
new file mode 100644
index 0000000000..6a1901a96d
--- /dev/null
+++ b/Documentation/RelNotes-1.5.3.5.txt
@@ -0,0 +1,25 @@
+GIT v1.5.3.5 Release Notes
+==========================
+
+Fixes since v1.5.3.4
+--------------------
+
+ * "git-config" silently ignored options after --list; now it wilh
+ error out with a usage message.
+
+ * "git-config --file" failed if the argument used a relative path
+ as it changed directories before opening the file.
+
+ * "git-add -i" did not handle single line hunks correctly.
+
+ * "git-log --follow" did not work unless diff generation (e.g. -p)
+ was also requested.
+
+ * "git-log" printed extra newlines between commits when a diff
+ was generated internally (e.g. -S or --follow) but not displayed.
+
+ * Documention updates for supported (but previously undocumented)
+ options of "git-archive" and "git-reflog".
+
+ * "make clean" no longer deletes the configure script that ships
+ with the git tarball, making multiple architecture builds easier.
diff --git a/Documentation/git-archive.txt b/Documentation/git-archive.txt
index e1e2d60fef..7cd6526552 100644
--- a/Documentation/git-archive.txt
+++ b/Documentation/git-archive.txt
@@ -10,7 +10,8 @@ SYNOPSIS
--------
[verse]
'git-archive' --format=<fmt> [--list] [--prefix=<prefix>/] [<extra>]
- [--remote=<repo>] <tree-ish> [path...]
+ [--remote=<repo> [--exec=<git-upload-archive>]] <tree-ish>
+ [path...]
DESCRIPTION
-----------
@@ -52,6 +53,10 @@ OPTIONS
Instead of making a tar archive from local repository,
retrieve a tar archive from a remote repository.
+--exec=<git-upload-archive>::
+ Used with --remote to specify the path to the
+ git-upload-archive executable on the remote side.
+
<tree-ish>::
The tree or commit to produce an archive for.
diff --git a/Documentation/git-reflog.txt b/Documentation/git-reflog.txt
index 5180f6810d..5c7316ceb8 100644
--- a/Documentation/git-reflog.txt
+++ b/Documentation/git-reflog.txt
@@ -16,7 +16,7 @@ The command takes various subcommands, and different options
depending on the subcommand:
[verse]
-git reflog expire [--dry-run] [--stale-fix]
+git reflog expire [--dry-run] [--stale-fix] [--verbose]
[--expire=<time>] [--expire-unreachable=<time>] [--all] <refs>...
git reflog [show] [log-options]
@@ -68,6 +68,9 @@ them.
--all::
Instead of listing <refs> explicitly, prune all refs.
+--verbose::
+ Print extra information on screen.
+
Author
------
Written by Junio C Hamano <junkio@cox.net>
diff --git a/Makefile b/Makefile
index 55fbcb73e1..d74ac93c11 100644
--- a/Makefile
+++ b/Makefile
@@ -1092,6 +1092,9 @@ dist-doc:
### Cleaning rules
+distclean: clean
+ $(RM) configure
+
clean:
$(RM) *.o mozilla-sha1/*.o arm/*.o ppc/*.o compat/*.o xdiff/*.o \
$(LIB_FILE) $(XDIFF_LIB)
@@ -1099,7 +1102,7 @@ clean:
$(RM) $(TEST_PROGRAMS)
$(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo common-cmds.h TAGS tags cscope*
$(RM) -r autom4te.cache
- $(RM) configure config.log config.mak.autogen config.mak.append config.status config.cache
+ $(RM) config.log config.mak.autogen config.mak.append config.status config.cache
$(RM) -r $(GIT_TARNAME) .doc-tmp-dir
$(RM) $(GIT_TARNAME).tar.gz git-core_$(GIT_VERSION)-*.tar.gz
$(RM) $(htmldocs).tar.gz $(manpages).tar.gz
diff --git a/builtin-config.c b/builtin-config.c
index 0a605e01ac..d98b6c2c4c 100644
--- a/builtin-config.c
+++ b/builtin-config.c
@@ -165,15 +165,18 @@ int cmd_config(int argc, const char **argv, const char *prefix)
{
int nongit = 0;
char* value;
- setup_git_directory_gently(&nongit);
+ const char *file = setup_git_directory_gently(&nongit);
while (1 < argc) {
if (!strcmp(argv[1], "--int"))
type = T_INT;
else if (!strcmp(argv[1], "--bool"))
type = T_BOOL;
- else if (!strcmp(argv[1], "--list") || !strcmp(argv[1], "-l"))
+ else if (!strcmp(argv[1], "--list") || !strcmp(argv[1], "-l")) {
+ if (argc != 2)
+ usage(git_config_set_usage);
return git_config(show_all_config);
+ }
else if (!strcmp(argv[1], "--global")) {
char *home = getenv("HOME");
if (home) {
@@ -189,7 +192,12 @@ int cmd_config(int argc, const char **argv, const char *prefix)
else if (!strcmp(argv[1], "--file") || !strcmp(argv[1], "-f")) {
if (argc < 3)
usage(git_config_set_usage);
- setenv(CONFIG_ENVIRONMENT, argv[2], 1);
+ if (!is_absolute_path(argv[2]) && file)
+ file = prefix_filename(file, strlen(file),
+ argv[2]);
+ else
+ file = argv[2];
+ setenv(CONFIG_ENVIRONMENT, file, 1);
argc--;
argv++;
}
diff --git a/commit.c b/commit.c
index 20fb2209cb..ac24266e93 100644
--- a/commit.c
+++ b/commit.c
@@ -441,17 +441,22 @@ struct commit *pop_most_recent_commit(struct commit_list **list,
void clear_commit_marks(struct commit *commit, unsigned int mark)
{
- struct commit_list *parents;
+ while (commit) {
+ struct commit_list *parents;
- commit->object.flags &= ~mark;
- parents = commit->parents;
- while (parents) {
- struct commit *parent = parents->item;
+ if (!(mark & commit->object.flags))
+ return;
- /* Have we already cleared this? */
- if (mark & parent->object.flags)
- clear_commit_marks(parent, mark);
- parents = parents->next;
+ commit->object.flags &= ~mark;
+
+ parents = commit->parents;
+ if (!parents)
+ return;
+
+ while ((parents = parents->next))
+ clear_commit_marks(parents->item, mark);
+
+ commit = commit->parents->item;
}
}
diff --git a/git-add--interactive.perl b/git-add--interactive.perl
index be6881496c..ac598f88e6 100755
--- a/git-add--interactive.perl
+++ b/git-add--interactive.perl
@@ -360,7 +360,9 @@ sub hunk_splittable {
sub parse_hunk_header {
my ($line) = @_;
my ($o_ofs, $o_cnt, $n_ofs, $n_cnt) =
- $line =~ /^@@ -(\d+)(?:,(\d+)) \+(\d+)(?:,(\d+)) @@/;
+ $line =~ /^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/;
+ $o_cnt = 1 unless defined $o_cnt;
+ $n_cnt = 1 unless defined $n_cnt;
return ($o_ofs, $o_cnt, $n_ofs, $n_cnt);
}
@@ -372,9 +374,8 @@ sub split_hunk {
# it can be split, but we would need to take care of
# overlaps later.
- my ($o_ofs, $o_cnt, $n_ofs, $n_cnt) = parse_hunk_header($text->[0]);
+ my ($o_ofs, undef, $n_ofs) = parse_hunk_header($text->[0]);
my $hunk_start = 1;
- my $next_hunk_start;
OUTER:
while (1) {
@@ -441,8 +442,8 @@ sub split_hunk {
for my $hunk (@split) {
$o_ofs = $hunk->{OLD};
$n_ofs = $hunk->{NEW};
- $o_cnt = $hunk->{OCNT};
- $n_cnt = $hunk->{NCNT};
+ my $o_cnt = $hunk->{OCNT};
+ my $n_cnt = $hunk->{NCNT};
my $head = ("@@ -$o_ofs" .
(($o_cnt != 1) ? ",$o_cnt" : '') .
@@ -457,7 +458,7 @@ sub split_hunk {
sub find_last_o_ctx {
my ($it) = @_;
my $text = $it->{TEXT};
- my ($o_ofs, $o_cnt, $n_ofs, $n_cnt) = parse_hunk_header($text->[0]);
+ my ($o_ofs, $o_cnt) = parse_hunk_header($text->[0]);
my $i = @{$text};
my $last_o_ctx = $o_ofs + $o_cnt;
while (0 < --$i) {
@@ -529,8 +530,7 @@ sub coalesce_overlapping_hunks {
for (grep { $_->{USE} } @in) {
my $text = $_->{TEXT};
- my ($o_ofs, $o_cnt, $n_ofs, $n_cnt) =
- parse_hunk_header($text->[0]);
+ my ($o_ofs) = parse_hunk_header($text->[0]);
if (defined $last_o_ctx &&
$o_ofs <= $last_o_ctx) {
merge_hunk($out[-1], $_);
@@ -697,7 +697,7 @@ sub patch_update_cmd {
@hunk = coalesce_overlapping_hunks(@hunk);
- my ($o_lofs, $n_lofs) = (0, 0);
+ my $n_lofs = 0;
my @result = ();
for (@hunk) {
my $text = $_->{TEXT};
@@ -705,9 +705,6 @@ sub patch_update_cmd {
parse_hunk_header($text->[0]);
if (!$_->{USE}) {
- if (!defined $o_cnt) { $o_cnt = 1; }
- if (!defined $n_cnt) { $n_cnt = 1; }
-
# We would have added ($n_cnt - $o_cnt) lines
# to the postimage if we were to use this hunk,
# but we didn't. So the line number that the next
@@ -719,10 +716,10 @@ sub patch_update_cmd {
if ($n_lofs) {
$n_ofs += $n_lofs;
$text->[0] = ("@@ -$o_ofs" .
- ((defined $o_cnt)
+ (($o_cnt != 1)
? ",$o_cnt" : '') .
" +$n_ofs" .
- ((defined $n_cnt)
+ (($n_cnt != 1)
? ",$n_cnt" : '') .
" @@\n");
}
@@ -807,8 +804,6 @@ sub main_loop {
}
}
-my @z;
-
refresh();
status_cmd();
main_loop();
diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index 050140d666..df4cedb859 100755
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -80,7 +80,7 @@ mark_action_done () {
make_patch () {
parent_sha1=$(git rev-parse --verify "$1"^) ||
die "Cannot get patch for $1^"
- git diff "$parent_sha1".."$1" > "$DOTEST"/patch
+ git diff-tree -p "$parent_sha1".."$1" > "$DOTEST"/patch
test -f "$DOTEST"/message ||
git cat-file commit "$1" | sed "1,/^$/d" > "$DOTEST"/message
test -f "$DOTEST"/author-script ||
@@ -325,7 +325,7 @@ do_next () {
;;
esac && {
test ! -f "$DOTEST"/verbose ||
- git diff --stat $(cat "$DOTEST"/head)..HEAD
+ git diff-tree --stat $(cat "$DOTEST"/head)..HEAD
} &&
rm -rf "$DOTEST" &&
git gc --auto &&
diff --git a/log-tree.c b/log-tree.c
index 23191543d5..62edd34455 100644
--- a/log-tree.c
+++ b/log-tree.c
@@ -304,7 +304,8 @@ int log_tree_diff_flush(struct rev_info *opt)
* output for readability.
*/
show_log(opt, opt->diffopt.msg_sep);
- if (opt->verbose_header &&
+ if ((opt->diffopt.output_format & ~DIFF_FORMAT_NO_OUTPUT) &&
+ opt->verbose_header &&
opt->commit_format != CMIT_FMT_ONELINE) {
int pch = DIFF_FORMAT_DIFFSTAT | DIFF_FORMAT_PATCH;
if ((pch & opt->diffopt.output_format) == pch)
diff --git a/revision.c b/revision.c
index 5d294be308..e76da0d448 100644
--- a/revision.c
+++ b/revision.c
@@ -1241,8 +1241,8 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch
if (revs->diffopt.output_format & ~DIFF_FORMAT_NO_OUTPUT)
revs->diff = 1;
- /* Pickaxe needs diffs */
- if (revs->diffopt.pickaxe)
+ /* Pickaxe and rename following needs diffs */
+ if (revs->diffopt.pickaxe || revs->diffopt.follow_renames)
revs->diff = 1;
if (revs->topo_order)
diff --git a/t/t3900-i18n-commit.sh b/t/t3900-i18n-commit.sh
index fcbabe8ec3..94b1c24b0a 100755
--- a/t/t3900-i18n-commit.sh
+++ b/t/t3900-i18n-commit.sh
@@ -8,7 +8,7 @@ test_description='commit and log output encodings'
. ./test-lib.sh
compare_with () {
- git show -s $1 | sed -e '1,/^$/d' -e 's/^ //' -e '$d' >current &&
+ git show -s $1 | sed -e '1,/^$/d' -e 's/^ //' >current &&
git diff current "$2"
}
diff --git a/t/t4013/diff.log_-SF_master b/t/t4013/diff.log_-SF_master
index 6162ed2018..c1599f2f52 100644
--- a/t/t4013/diff.log_-SF_master
+++ b/t/t4013/diff.log_-SF_master
@@ -4,5 +4,4 @@ Author: A U Thor <author@example.com>
Date: Mon Jun 26 00:02:00 2006 +0000
Third
-
$