* 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
This commit is contained in:
Shawn O. Pearce 2007-10-15 22:31:47 -04:00
Родитель 03618b9df8 8492f00b4f
Коммит d55e7c3acf
12 изменённых файлов: 82 добавлений и 38 удалений

Просмотреть файл

@ -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.

Просмотреть файл

@ -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.

Просмотреть файл

@ -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>

Просмотреть файл

@ -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

Просмотреть файл

@ -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++;
}

Просмотреть файл

@ -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;
}
}

Просмотреть файл

@ -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();

Просмотреть файл

@ -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 &&

Просмотреть файл

@ -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)

Просмотреть файл

@ -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)

Просмотреть файл

@ -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"
}

Просмотреть файл

@ -4,5 +4,4 @@ Author: A U Thor <author@example.com>
Date: Mon Jun 26 00:02:00 2006 +0000
Third
$