Skip to content

Commit

Permalink
Merge branch 'maint'
Browse files Browse the repository at this point in the history
* maint:
  Start 1.6.0.2 maintenance cycle
  tests: use "git xyzzy" form (t7200 - t9001)
  tests: use "git xyzzy" form (t7000 - t7199)
  Fix passwd(5) ref and reflect that commit doens't use commit-tree
  improve handling of sideband message display
  tests: use "git xyzzy" form (t3600 - t6999)
  tests: use "git xyzzy" form (t0000 - t3599)
  checkout: fix message when leaving detached HEAD
  clone: fix creation of explicitly named target directory
  'git foo' program identifies itself without dash in die() messages
  setup_git_directory(): fix move to worktree toplevel directory
  update-index: fix worktree setup
  Start conforming code to "git subcmd" style
  read-tree: setup worktree if merge is required
  grep: fix worktree setup
  diff*: fix worktree setup

Conflicts:
	RelNotes
	t/t3900-i18n-commit.sh
	t/t7003-filter-branch.sh
  • Loading branch information
Junio C Hamano committed Sep 3, 2008
2 parents 0191457 + de5d560 commit 9b8ae93
Show file tree
Hide file tree
Showing 110 changed files with 794 additions and 620 deletions.
50 changes: 50 additions & 0 deletions Documentation/RelNotes-1.6.0.2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
GIT v1.6.0.2 Release Notes
==========================

Fixes since v1.6.0.1
--------------------

* Installation on platforms that needs .exe suffix to git-* programs were
broken in 1.6.0.1.

* Installation on filesystems without symbolic links support did nto
work well.

* In-tree documentations and test scripts now use "git foo" form to set a
better example, instead of the "git-foo" form (which is an acceptable
form if you have "PATH=$(git --exec-path):$PATH" in your script)

* Many commands did not use the correct working tree location when used
with GIT_WORK_TREE environment settings.



* "git apply --unidiff-zero" incorrectly applied a -U0 patch that inserts
a new line before the second line.

* "git clone $there $here/" with extra trailing slashes after explicit
local directory name $here did not work as expected.

* "git diff --dirstat -M" did not add changes in subdirectories up
correctly for renamed paths.

* "git for-each-ref refs/heads/" did not work as expected.

* "git log --grep=pattern -i" did not ignore case.

* "git log --pretty="%ad" --date=short" did not use short format when
showing the timestamp.

* Build procedure for "git shell" that used stub versions of some
functions and globals was not understood by linkers on some platforms.

* "git verify-pack -v" did not work correctly when given more than one
packfile.

Also contains many documentation updates.

--
exec >/var/tmp/1
O=v1.6.0.1-49-g6a42cfe
echo O=$(git describe maint)
git shortlog --no-merges $O..maint
4 changes: 2 additions & 2 deletions Documentation/git-commit-tree.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ Diagnostics
You don't exist. Go away!::
The passwd(5) gecos field couldn't be read
Your parents must have hated you!::
The password(5) gecos field is longer than a giant static buffer.
The passwd(5) gecos field is longer than a giant static buffer.
Your sysadmin must hate you!::
The password(5) name field is longer than a giant static buffer.
The passwd(5) name field is longer than a giant static buffer.

Discussion
----------
Expand Down
6 changes: 3 additions & 3 deletions Documentation/git-var.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ OPTIONS
Cause the logical variables to be listed. In addition, all the
variables of the git configuration file .git/config are listed
as well. (However, the configuration variables listing functionality
is deprecated in favor of 'git-config -l'.)
is deprecated in favor of 'git config -l'.)

EXAMPLE
--------
Expand All @@ -41,9 +41,9 @@ Diagnostics
You don't exist. Go away!::
The passwd(5) gecos field couldn't be read
Your parents must have hated you!::
The password(5) gecos field is longer than a giant static buffer.
The passwd(5) gecos field is longer than a giant static buffer.
Your sysadmin must hate you!::
The password(5) name field is longer than a giant static buffer.
The passwd(5) name field is longer than a giant static buffer.

SEE ALSO
--------
Expand Down
2 changes: 1 addition & 1 deletion Documentation/i18n.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ project find it more convenient to use legacy encodings, git
does not forbid it. However, there are a few things to keep in
mind.

. 'git-commit-tree' (hence, 'git-commit' which uses it) issues
. 'git-commit' and 'git-commit-tree' issues
a warning if the commit log message given to it does not look
like a valid UTF-8 string, unless you explicitly say your
project uses a legacy encoding. The way to say this is to
Expand Down
8 changes: 4 additions & 4 deletions builtin-apply.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ static void say_patch_name(FILE *output, const char *pre,
static void read_patch_file(struct strbuf *sb, int fd)
{
if (strbuf_read(sb, fd, 0) < 0)
die("git-apply: read returned %s", strerror(errno));
die("git apply: read returned %s", strerror(errno));

/*
* Make sure that we have some slop in the buffer
Expand Down Expand Up @@ -506,17 +506,17 @@ static char *gitdiff_verify_name(const char *line, int isnull, char *orig_name,
name = orig_name;
len = strlen(name);
if (isnull)
die("git-apply: bad git-diff - expected /dev/null, got %s on line %d", name, linenr);
die("git apply: bad git-diff - expected /dev/null, got %s on line %d", name, linenr);
another = find_name(line, NULL, p_value, TERM_TAB);
if (!another || memcmp(another, name, len))
die("git-apply: bad git-diff - inconsistent %s filename on line %d", oldnew, linenr);
die("git apply: bad git-diff - inconsistent %s filename on line %d", oldnew, linenr);
free(another);
return orig_name;
}
else {
/* expect "/dev/null" */
if (memcmp("/dev/null", line, 9) || line[9] != '\n')
die("git-apply: bad git-diff - expected /dev/null on line %d", linenr);
die("git apply: bad git-diff - expected /dev/null on line %d", linenr);
return NULL;
}
}
Expand Down
8 changes: 4 additions & 4 deletions builtin-archive.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,18 @@ static int run_remote_archiver(const char *remote, int argc,

len = packet_read_line(fd[0], buf, sizeof(buf));
if (!len)
die("git-archive: expected ACK/NAK, got EOF");
die("git archive: expected ACK/NAK, got EOF");
if (buf[len-1] == '\n')
buf[--len] = 0;
if (strcmp(buf, "ACK")) {
if (len > 5 && !prefixcmp(buf, "NACK "))
die("git-archive: NACK %s", buf + 5);
die("git-archive: protocol error");
die("git archive: NACK %s", buf + 5);
die("git archive: protocol error");
}

len = packet_read_line(fd[0], buf, sizeof(buf));
if (len)
die("git-archive: expected a flush");
die("git archive: expected a flush");

/* Now, start reading from fd[0] and spit it out to stdout */
rv = recv_sideband("archive", fd[0], 1, 2);
Expand Down
2 changes: 1 addition & 1 deletion builtin-blame.c
Original file line number Diff line number Diff line change
Expand Up @@ -1787,7 +1787,7 @@ static int prepare_lines(struct scoreboard *sb)

/*
* Add phony grafts for use with -S; this is primarily to
* support git-cvsserver that wants to give a linear history
* support git's cvsserver that wants to give a linear history
* to its clients.
*/
static int read_ancestry(const char *graft_file)
Expand Down
4 changes: 2 additions & 2 deletions builtin-bundle.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
* Basic handler for bundle files to connect repositories via sneakernet.
* Invocation must include action.
* This function can create a bundle or provide information on an existing
* bundle supporting git-fetch, git-pull, and git-ls-remote
* bundle supporting "fetch", "pull", and "ls-remote".
*/

static const char *bundle_usage="git-bundle (create <bundle> <git-rev-list args> | verify <bundle> | list-heads <bundle> [refname]... | unbundle <bundle> [refname]... )";
static const char *bundle_usage="git bundle (create <bundle> <git rev-list args> | verify <bundle> | list-heads <bundle> [refname]... | unbundle <bundle> [refname]... )";

int cmd_bundle(int argc, const char **argv, const char *prefix)
{
Expand Down
4 changes: 2 additions & 2 deletions builtin-cat-file.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,11 @@ static int cat_one_file(int opt, const char *exp_type, const char *obj_name)
break;

default:
die("git-cat-file: unknown option: %s\n", exp_type);
die("git cat-file: unknown option: %s\n", exp_type);
}

if (!buf)
die("git-cat-file %s: bad file", obj_name);
die("git cat-file %s: bad file", obj_name);

write_or_die(1, buf, size);
return 0;
Expand Down
2 changes: 1 addition & 1 deletion builtin-check-ref-format.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
int cmd_check_ref_format(int argc, const char **argv, const char *prefix)
{
if (argc != 2)
usage("git-check-ref-format refname");
usage("git check-ref-format refname");
return !!check_ref_format(argv[1]);
}
6 changes: 3 additions & 3 deletions builtin-checkout-index.c
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,9 @@ int cmd_checkout_index(int argc, const char **argv, const char *prefix)
const char *p;

if (all)
die("git-checkout-index: don't mix '--all' and explicit filenames");
die("git checkout-index: don't mix '--all' and explicit filenames");
if (read_from_stdin)
die("git-checkout-index: don't mix '--stdin' and explicit filenames");
die("git checkout-index: don't mix '--stdin' and explicit filenames");
p = prefix_path(prefix, prefix_length, arg);
checkout_file(p, prefix_length);
if (p < arg || p > arg + strlen(arg))
Expand All @@ -271,7 +271,7 @@ int cmd_checkout_index(int argc, const char **argv, const char *prefix)
struct strbuf buf, nbuf;

if (all)
die("git-checkout-index: don't mix '--all' and '--stdin'");
die("git checkout-index: don't mix '--all' and '--stdin'");

strbuf_init(&buf, 0);
strbuf_init(&nbuf, 0);
Expand Down
10 changes: 4 additions & 6 deletions builtin-checkout.c
Original file line number Diff line number Diff line change
Expand Up @@ -386,13 +386,11 @@ static int switch_branches(struct checkout_opts *opts, struct branch_info *new)
}

/*
* If the new thing isn't a branch and isn't HEAD and we're
* not starting a new branch, and we want messages, and we
* weren't on a branch, and we're moving to a new commit,
* describe the old commit.
* If we were on a detached HEAD, but we are now moving to
* a new commit, we want to mention the old commit once more
* to remind the user that it might be lost.
*/
if (!new->path && strcmp(new->name, "HEAD") && !opts->new_branch &&
!opts->quiet && !old.path && new->commit != old.commit)
if (!opts->quiet && !old.path && new->commit != old.commit)
describe_detached_head("Previous HEAD position was", old.commit);

if (!old.commit) {
Expand Down
17 changes: 14 additions & 3 deletions builtin-clone.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,15 @@ static int is_directory(const char *path)
return !stat(path, &buf) && S_ISDIR(buf.st_mode);
}

static void strip_trailing_slashes(char *dir)
{
char *end = dir + strlen(dir);

while (dir < end - 1 && is_dir_sep(end[-1]))
end--;
*end = '\0';
}

static void setup_reference(const char *repo)
{
const char *ref_git;
Expand Down Expand Up @@ -397,6 +406,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
dir = xstrdup(argv[1]);
else
dir = guess_dir_name(repo_name, is_bundle, option_bare);
strip_trailing_slashes(dir);

if (!stat(dir, &buf))
die("destination directory '%s' already exists.", dir);
Expand All @@ -422,10 +432,11 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
if (!option_bare) {
junk_work_tree = work_tree;
if (safe_create_leading_directories_const(work_tree) < 0)
die("could not create leading directories of '%s'",
work_tree);
die("could not create leading directories of '%s': %s",
work_tree, strerror(errno));
if (mkdir(work_tree, 0755))
die("could not create work tree dir '%s'.", work_tree);
die("could not create work tree dir '%s': %s.",
work_tree, strerror(errno));
set_git_work_tree(work_tree);
}
junk_git_dir = git_dir;
Expand Down
2 changes: 1 addition & 1 deletion builtin-commit-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ int cmd_commit_tree(int argc, const char **argv, const char *prefix)
}

if (strbuf_read(&buffer, 0, 0) < 0)
die("git-commit-tree: read returned %s", strerror(errno));
die("git commit-tree: read returned %s", strerror(errno));

if (!commit_tree(buffer.buf, tree_sha1, parents, commit_sha1)) {
printf("%s\n", sha1_to_hex(commit_sha1));
Expand Down
2 changes: 2 additions & 0 deletions builtin-diff-index.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ int cmd_diff_index(int argc, const char **argv, const char *prefix)
if (rev.pending.nr != 1 ||
rev.max_count != -1 || rev.min_age != -1 || rev.max_age != -1)
usage(diff_cache_usage);
if (!cached)
setup_work_tree();
if (read_cache() < 0) {
perror("read_cache");
return -1;
Expand Down
3 changes: 3 additions & 0 deletions builtin-diff.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ static int builtin_diff_index(struct rev_info *revs,
usage(builtin_diff_usage);
argv++; argc--;
}
if (!cached)
setup_work_tree();
/*
* Make sure there is one revision (i.e. pending object),
* and there is no revision filtering parameters.
Expand Down Expand Up @@ -225,6 +227,7 @@ static int builtin_diff_files(struct rev_info *revs, int argc, const char **argv
(revs->diffopt.output_format & DIFF_FORMAT_PATCH))
revs->combine_merges = revs->dense_combined_merges = 1;

setup_work_tree();
if (read_cache() < 0) {
perror("read_cache");
return -1;
Expand Down
2 changes: 1 addition & 1 deletion builtin-fetch-pack.c
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@ static struct ref *do_fetch_pack(int fd[2],
fprintf(stderr, "warning: no common commits\n");

if (get_pack(fd, pack_lockfile))
die("git-fetch-pack: fetch failed.");
die("git fetch-pack: fetch failed.");

all_done:
return ref;
Expand Down
7 changes: 5 additions & 2 deletions builtin-grep.c
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,7 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
/* Make sure we do not get outside of paths */
for (i = 0; paths[i]; i++)
if (strncmp(prefix, paths[i], opt.prefix_length))
die("git-grep: cannot generate relative filenames containing '..'");
die("git grep: cannot generate relative filenames containing '..'");
}
}
else if (prefix) {
Expand All @@ -783,8 +783,11 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
paths[1] = NULL;
}

if (!list.nr)
if (!list.nr) {
if (!cached)
setup_work_tree();
return !grep_cache(&opt, paths, cached);
}

if (cached)
die("both --cached and trees are given.");
Expand Down
6 changes: 3 additions & 3 deletions builtin-ls-files.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ static void show_dir_entry(const char *tag, struct dir_entry *ent)
int offset = prefix_offset;

if (len >= ent->len)
die("git-ls-files: internal error - directory entry not superset of prefix");
die("git ls-files: internal error - directory entry not superset of prefix");

if (pathspec && !pathspec_match(pathspec, ps_matched, ent->name, len))
return;
Expand Down Expand Up @@ -183,7 +183,7 @@ static void show_ce_entry(const char *tag, struct cache_entry *ce)
int offset = prefix_offset;

if (len >= ce_namelen(ce))
die("git-ls-files: internal error - cache entry not superset of prefix");
die("git ls-files: internal error - cache entry not superset of prefix");

if (pathspec && !pathspec_match(pathspec, ps_matched, ce->name, len))
return;
Expand Down Expand Up @@ -319,7 +319,7 @@ static const char *verify_pathspec(const char *prefix)
}

if (prefix_offset > max || memcmp(prev, prefix, prefix_offset))
die("git-ls-files: cannot generate relative filenames containing '..'");
die("git ls-files: cannot generate relative filenames containing '..'");

prefix_len = max;
return max ? xmemdupz(prev, max) : NULL;
Expand Down
2 changes: 2 additions & 0 deletions builtin-read-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,8 @@ int cmd_read_tree(int argc, const char **argv, const char *unused_prefix)
usage(read_tree_usage);
if ((opts.dir && !opts.update))
die("--exclude-per-directory is meaningless unless -u");
if (opts.merge && !opts.index_only)
setup_work_tree();

if (opts.merge) {
if (stage < 2)
Expand Down
4 changes: 2 additions & 2 deletions builtin-rm.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ int cmd_rm(int argc, const char **argv, const char *prefix)
printf("rm '%s'\n", path);

if (remove_file_from_cache(path))
die("git-rm: unable to remove %s", path);
die("git rm: unable to remove %s", path);
}

if (show_only)
Expand All @@ -244,7 +244,7 @@ int cmd_rm(int argc, const char **argv, const char *prefix)
continue;
}
if (!removed)
die("git-rm: %s: %s", path, strerror(errno));
die("git rm: %s: %s", path, strerror(errno));
}
}

Expand Down
Loading

0 comments on commit 9b8ae93

Please sign in to comment.