Skip to content

Commit

Permalink
Merge branch 'bc/maint-diff-hunk-header-fix' into bc/master-diff-hunk…
Browse files Browse the repository at this point in the history
…-header-fix

* bc/maint-diff-hunk-header-fix:
  diff.*.xfuncname which uses "extended" regex's for hunk header selection
  diff.c: associate a flag with each pattern and use it for compiling regex
  diff.c: return pattern entry pointer rather than just the hunk header pattern
  Cosmetical command name fix
  Start conforming code to "git subcmd" style part 3
  t9700/test.pl: remove File::Temp requirement
  t9700/test.pl: avoid bareword 'STDERR' in 3-argument open()
  GIT 1.6.0.2
  Fix some manual typos.
  Use compatibility regex library also on FreeBSD
  Use compatibility regex library also on AIX
  Update draft release notes for 1.6.0.2
  Use compatibility regex library for OSX/Darwin
  git-svn: Fixes my() parameter list syntax error in pre-5.8 Perl
  Git.pm: Use File::Temp->tempfile instead of ->new
  t7501: always use test_cmp instead of diff
  Start conforming code to "git subcmd" style part 2
  diff: Help "less" hide ^M from the output
  checkout: do not check out unmerged higher stages randomly

Conflicts:
	Documentation/git.txt
	Documentation/gitattributes.txt
	Makefile
	diff.c
	t/t7201-co.sh
  • Loading branch information
Junio C Hamano committed Sep 19, 2008
2 parents af9ce1f + 45d9414 commit dde4af4
Show file tree
Hide file tree
Showing 37 changed files with 266 additions and 123 deletions.
24 changes: 22 additions & 2 deletions Documentation/RelNotes-1.6.0.2.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,26 @@ Fixes since v1.6.0.1
* Many commands did not use the correct working tree location when used
with GIT_WORK_TREE environment settings.

* Some systems needs to use compatibility fnmach and regex libraries
independent from each other; the compat/ area has been reorganized to
allow this.


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

* "git blame -c" did not exactly work like "git annotate" when range
boundaries are involved.

* "git checkout file" when file is still unmerged checked out contents from
a random high order stage, which was confusing.

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

* "git diff" on tracked contents with CRLF line endings did not drive "less"
intelligently when showing added or removed lines.

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

Expand All @@ -42,26 +52,36 @@ Fixes since v1.6.0.1

* "git gui" translation updates and i18n fixes.

* "git index-pack" is more careful against disk corruption while completing
a thin pack.

* "git log -i --grep=pattern" did not ignore case; neither "git log -E
--grep=pattern" triggered extended regexp.

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

* "git log --author=author" match incorrectly matched with the
timestamp part of "author " line in commit objects.

* "git log -F --author=author" did not work at all.

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

* "git stash" was fooled by a stat-dirty but otherwise unmodified paths
and refused to work until the user refreshed the index.

* "git svn" was broken on Perl before 5.8 with recent fixes to reduce
use of temporary files.

* "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-61-g1eff26c
O=v1.6.0.1-78-g3632cfc
echo O=$(git describe maint)
git shortlog --no-merges $O..maint

2 changes: 1 addition & 1 deletion Documentation/git-web--browse.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ the URLs passed as arguments.
Note about konqueror
--------------------

When 'konqueror' is specified by the a command line option or a
When 'konqueror' is specified by a command line option or a
configuration variable, we launch 'kfmclient' to try to open the HTML
man page on an already opened konqueror in a new tab if possible.

Expand Down
5 changes: 3 additions & 2 deletions Documentation/git.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,11 @@ unreleased) version of git, that is available from 'master'
branch of the `git.git` repository.
Documentation for older releases are available here:

* link:v1.6.1/git.html[documentation for release 1.6.1]
* link:v1.6.0.2/git.html[documentation for release 1.6.0.2]

* release notes for
link:RelNotes-1.6.1.txt[1.6.1],
link:RelNotes-1.6.0.2.txt[1.6.0.2],
link:RelNotes-1.6.0.1.txt[1.6.0.1],
link:RelNotes-1.6.0.txt[1.6.0].

* link:v1.5.6.5/git.html[documentation for release 1.5.6.5]
Expand Down
6 changes: 3 additions & 3 deletions Documentation/gitattributes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -288,13 +288,13 @@ for paths.
*.tex diff=tex
------------------------

Then, you would define "diff.tex.funcname" configuration to
Then, you would define "diff.tex.xfuncname" configuration to
specify a regular expression that matches a line that you would
want to appear as the hunk header, like this:

------------------------
[diff "tex"]
funcname = "^\\(\\\\\\(sub\\)*section{.*\\)$"
xfuncname = "^(\\\\(sub)*section\\{.*)$"
------------------------

Note. A single level of backslashes are eaten by the
Expand All @@ -313,7 +313,7 @@ patterns are available:

- `html` suitable for HTML/XHTML documents.

- `java` suitable for source code in the Java lanugage.
- `java` suitable for source code in the Java language.

- `pascal` suitable for source code in the Pascal/Delphi language.

Expand Down
2 changes: 1 addition & 1 deletion Documentation/merge-config.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
merge.stat::
Whether to print the diffstat between ORIG_HEAD and merge result
Whether to print the diffstat between ORIG_HEAD and the merge result
at the end of the merge. True by default.

merge.log::
Expand Down
2 changes: 1 addition & 1 deletion GIT-VERSION-GEN
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh

GVF=GIT-VERSION-FILE
DEF_VER=v1.6.0.GIT
DEF_VER=v1.6.0.2.GIT

LF='
'
Expand Down
10 changes: 8 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,8 @@ ifeq ($(uname_S),Darwin)
endif
NO_STRLCPY = YesPlease
NO_MEMMEM = YesPlease
COMPAT_CFLAGS += -Icompat/regex
COMPAT_OBJS += compat/regex/regex.o
endif
ifeq ($(uname_S),SunOS)
NEEDS_SOCKET = YesPlease
Expand Down Expand Up @@ -683,6 +685,8 @@ ifeq ($(uname_S),FreeBSD)
BASIC_LDFLAGS += -L/usr/local/lib
DIR_HAS_BSD_GROUP_SEMANTICS = YesPlease
THREADED_DELTA_SEARCH = YesPlease
COMPAT_CFLAGS += -Icompat/regex
COMPAT_OBJS += compat/regex/regex.o
endif
ifeq ($(uname_S),OpenBSD)
NO_STRCASESTR = YesPlease
Expand Down Expand Up @@ -710,6 +714,8 @@ ifeq ($(uname_S),AIX)
INTERNAL_QSORT = UnfortunatelyYes
NEEDS_LIBICONV=YesPlease
BASIC_CFLAGS += -D_LARGE_FILES
COMPAT_CFLAGS += -Icompat/regex
COMPAT_OBJS += compat/regex/regex.o
endif
ifeq ($(uname_S),GNU)
# GNU/Hurd
Expand Down Expand Up @@ -761,10 +767,10 @@ ifneq (,$(findstring MINGW,$(uname_S)))
NO_PERL_MAKEMAKER = YesPlease
NO_POSIX_ONLY_PROGRAMS = YesPlease
NO_ST_BLOCKS_IN_STRUCT_STAT = YesPlease
COMPAT_CFLAGS += -D__USE_MINGW_ACCESS -DNOGDI -Icompat
COMPAT_CFLAGS += -D__USE_MINGW_ACCESS -DNOGDI -Icompat -Icompat/regex -Icompat/fnmatch
COMPAT_CFLAGS += -DSNPRINTF_SIZE_CORR=1
COMPAT_CFLAGS += -DSTRIP_EXTENSION=\".exe\"
COMPAT_OBJS += compat/mingw.o compat/fnmatch.o compat/regex.o compat/winansi.o
COMPAT_OBJS += compat/mingw.o compat/fnmatch/fnmatch.o compat/regex/regex.o compat/winansi.o
EXTLIBS += -lws2_32
X = .exe
gitexecdir = ../libexec/git-core
Expand Down
14 changes: 7 additions & 7 deletions builtin-checkout-index.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,26 @@
*
* Careful: order of argument flags does matter. For example,
*
* git-checkout-index -a -f file.c
* git checkout-index -a -f file.c
*
* Will first check out all files listed in the cache (but not
* overwrite any old ones), and then force-checkout "file.c" a
* second time (ie that one _will_ overwrite any old contents
* with the same filename).
*
* Also, just doing "git-checkout-index" does nothing. You probably
* meant "git-checkout-index -a". And if you want to force it, you
* want "git-checkout-index -f -a".
* Also, just doing "git checkout-index" does nothing. You probably
* meant "git checkout-index -a". And if you want to force it, you
* want "git checkout-index -f -a".
*
* Intuitiveness is not the goal here. Repeatability is. The
* reason for the "no arguments means no work" thing is that
* from scripts you are supposed to be able to do things like
*
* find . -name '*.h' -print0 | xargs -0 git-checkout-index -f --
* find . -name '*.h' -print0 | xargs -0 git checkout-index -f --
*
* or:
*
* find . -name '*.h' -print0 | git-checkout-index -f -z --stdin
* find . -name '*.h' -print0 | git checkout-index -f -z --stdin
*
* which will force all existing *.h files to be replaced with
* their cached copies. If an empty command line implied "all",
Expand Down Expand Up @@ -107,7 +107,7 @@ static int checkout_file(const char *name, int prefix_length)
}

if (!state.quiet) {
fprintf(stderr, "git-checkout-index: %s ", name);
fprintf(stderr, "git checkout-index: %s ", name);
if (!has_same_name)
fprintf(stderr, "is not in the cache");
else if (checkout_stage)
Expand Down
29 changes: 28 additions & 1 deletion builtin-checkout.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,15 @@ static int read_tree_some(struct tree *tree, const char **pathspec)
return 0;
}

static int skip_same_name(struct cache_entry *ce, int pos)
{
while (++pos < active_nr &&
!strcmp(active_cache[pos]->name, ce->name))
; /* skip */
return pos;
}


static int checkout_paths(struct tree *source_tree, const char **pathspec)
{
int pos;
Expand Down Expand Up @@ -107,14 +116,32 @@ static int checkout_paths(struct tree *source_tree, const char **pathspec)
if (report_path_error(ps_matched, pathspec, 0))
return 1;

/* Any unmerged paths? */
for (pos = 0; pos < active_nr; pos++) {
struct cache_entry *ce = active_cache[pos];
if (pathspec_match(pathspec, NULL, ce->name, 0)) {
if (!ce_stage(ce))
continue;
errs = 1;
error("path '%s' is unmerged", ce->name);
pos = skip_same_name(ce, pos) - 1;
}
}
if (errs)
return 1;

/* Now we are committed to check them out */
memset(&state, 0, sizeof(state));
state.force = 1;
state.refresh_cache = 1;
for (pos = 0; pos < active_nr; pos++) {
struct cache_entry *ce = active_cache[pos];
if (pathspec_match(pathspec, NULL, ce->name, 0)) {
errs |= checkout_entry(ce, &state, NULL);
if (!ce_stage(ce)) {
errs |= checkout_entry(ce, &state, NULL);
continue;
}
pos = skip_same_name(ce, pos) - 1;
}
}

Expand Down
2 changes: 1 addition & 1 deletion builtin-commit-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ static void check_valid(unsigned char *sha1, enum object_type expect)
typename(expect));
}

static const char commit_tree_usage[] = "git-commit-tree <sha1> [-p <sha1>]* < changelog";
static const char commit_tree_usage[] = "git commit-tree <sha1> [-p <sha1>]* < changelog";

static void new_parent(struct commit *parent, struct commit_list **parents_p)
{
Expand Down
2 changes: 1 addition & 1 deletion builtin-fetch-pack.c
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,7 @@ int cmd_fetch_pack(int argc, const char **argv, const char *prefix)
if (!ret && nr_heads) {
/* If the heads to pull were given, we should have
* consumed all of them by matching the remote.
* Otherwise, 'git-fetch remote no-such-ref' would
* Otherwise, 'git fetch remote no-such-ref' would
* silently succeed without issuing an error.
*/
for (i = 0; i < nr_heads; i++)
Expand Down
6 changes: 3 additions & 3 deletions builtin-fetch.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,10 @@ static void add_merge_config(struct ref **head,
/*
* Not fetched to a tracking branch? We need to fetch
* it anyway to allow this branch's "branch.$name.merge"
* to be honored by git-pull, but we do not have to
* to be honored by 'git pull', but we do not have to
* fail if branch.$name.merge is misconfigured to point
* at a nonexisting branch. If we were indeed called by
* git-pull, it will notice the misconfiguration because
* 'git pull', it will notice the misconfiguration because
* there is no entry in the resulting FETCH_HEAD marked
* for merging.
*/
Expand Down Expand Up @@ -396,7 +396,7 @@ static int store_updated_refs(const char *url, const char *remote_name,
* The refs we are going to fetch are in to_fetch (nr_heads in
* total). If running
*
* $ git-rev-list --objects to_fetch[0] to_fetch[1] ... --not --all
* $ git rev-list --objects to_fetch[0] to_fetch[1] ... --not --all
*
* does not error out, that means everything reachable from the
* refs we are going to fetch exists and is connected to some of
Expand Down
4 changes: 2 additions & 2 deletions builtin-http-fetch.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ int cmd_http_fetch(int argc, const char **argv, const char *prefix)
arg++;
}
if (argc < arg + 2 - commits_on_stdin) {
usage("git-http-fetch [-c] [-t] [-a] [-v] [--recover] [-w ref] [--stdin] commit-id url");
usage("git http-fetch [-c] [-t] [-a] [-v] [--recover] [-w ref] [--stdin] commit-id url");
return 1;
}
if (commits_on_stdin) {
Expand Down Expand Up @@ -75,7 +75,7 @@ int cmd_http_fetch(int argc, const char **argv, const char *prefix)
fprintf(stderr,
"Some loose object were found to be corrupt, but they might be just\n"
"a false '404 Not Found' error message sent with incorrect HTTP\n"
"status code. Suggest running git-fsck.\n");
"status code. Suggest running 'git fsck'.\n");
}

walker_free(walker);
Expand Down
2 changes: 1 addition & 1 deletion builtin-init-db.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ static void copy_templates_1(char *path, int baselen,

/* Note: if ".git/hooks" file exists in the repository being
* re-initialized, /etc/core-git/templates/hooks/update would
* cause git-init to fail here. I think this is sane but
* cause "git init" to fail here. I think this is sane but
* it means that the set of templates we ship by default, along
* with the way the namespace under .git/ is organized, should
* be really carefully chosen.
Expand Down
4 changes: 2 additions & 2 deletions builtin-pack-objects.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#endif

static const char pack_usage[] = "\
git-pack-objects [{ -q | --progress | --all-progress }] \n\
git pack-objects [{ -q | --progress | --all-progress }] \n\
[--max-pack-size=N] [--local] [--incremental] \n\
[--window=N] [--window-memory=N] [--depth=N] \n\
[--no-reuse-delta] [--no-reuse-object] [--delta-base-offset] \n\
Expand Down Expand Up @@ -1872,7 +1872,7 @@ static void mark_in_pack_object(struct object *object, struct packed_git *p, str

/*
* Compare the objects in the offset order, in order to emulate the
* "git-rev-list --objects" output that produced the pack originally.
* "git rev-list --objects" output that produced the pack originally.
*/
static int ofscmp(const void *a_, const void *b_)
{
Expand Down
2 changes: 1 addition & 1 deletion builtin-read-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ static void prime_cache_tree(void)

}

static const char read_tree_usage[] = "git-read-tree (<sha> | [[-m [--trivial] [--aggressive] | --reset | --prefix=<prefix>] [-u | -i]] [--exclude-per-directory=<gitignore>] [--index-output=<file>] <sha1> [<sha2> [<sha3>]])";
static const char read_tree_usage[] = "git read-tree (<sha> | [[-m [--trivial] [--aggressive] | --reset | --prefix=<prefix>] [-u | -i]] [--exclude-per-directory=<gitignore>] [--index-output=<file>] <sha1> [<sha2> [<sha3>]])";

static struct lock_file lock_file;

Expand Down
2 changes: 1 addition & 1 deletion builtin-rev-list.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ static void finish_object(struct object_array_entry *p)
static void show_object(struct object_array_entry *p)
{
/* An object with name "foo\n0000000..." can be used to
* confuse downstream git-pack-objects very badly.
* confuse downstream "git pack-objects" very badly.
*/
const char *ep = strchr(p->name, '\n');

Expand Down
2 changes: 1 addition & 1 deletion builtin-rm.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ static int check_local_mod(unsigned char *head, int index_only)
"from both the file and the HEAD\n"
"(use -f to force removal)", name);
else if (!index_only) {
/* It's not dangerous to git-rm --cached a
/* It's not dangerous to "git rm --cached" a
* file if the index matches the file or the
* HEAD, since it means the deleted content is
* still available somewhere.
Expand Down
2 changes: 1 addition & 1 deletion builtin-send-pack.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ static int pack_objects(int fd, struct ref *refs)
po.out = fd;
po.git_cmd = 1;
if (start_command(&po))
die("git-pack-objects failed (%s)", strerror(errno));
die("git pack-objects failed (%s)", strerror(errno));

/*
* We feed the pack-objects we just spawned with revision
Expand Down
Loading

0 comments on commit dde4af4

Please sign in to comment.