Skip to content

Commit 5a139ba

Browse files
committed
Merge branch 'maint' into bc/master-diff-hunk-header-fix
* maint: (41 commits) Clarify commit error message for unmerged files Use strchrnul() instead of strchr() plus manual workaround Use remove_path from dir.c instead of own implementation Add remove_path: a function to remove as much as possible of a path git-submodule: Fix "Unable to checkout" for the initial 'update' Clarify how the user can satisfy stash's 'dirty state' check. Remove empty directories in recursive merge Documentation: clarify the details of overriding LESS via core.pager Update release notes for 1.6.0.3 checkout: Do not show local changes when in quiet mode for-each-ref: Fix --format=%(subject) for log message without newlines git-stash.sh: don't default to refs/stash if invalid ref supplied maint: check return of split_cmdline to avoid bad config strings builtin-prune.c: prune temporary packs in <object_dir>/pack directory Do not perform cross-directory renames when creating packs Use dashless git commands in setgitperms.perl git-remote: do not use user input in a printf format string make "git remote" report multiple URLs Start draft release notes for 1.6.0.3 git-repack uses --no-repack-object, not --no-repack-delta. ... Conflicts: RelNotes
2 parents fdac669 + edb7e82 commit 5a139ba

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+600
-196
lines changed

Documentation/RelNotes-1.6.0.3.txt

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
GIT v1.6.0.3 Release Notes
2+
==========================
3+
4+
Fixes since v1.6.0.2
5+
--------------------
6+
7+
* "git archive --format=zip" did not honor core.autocrlf while
8+
--format=tar did.
9+
10+
* Continuing "git rebase -i" was very confused when the user left modified
11+
files in the working tree while resolving conflicts.
12+
13+
* Continuing "git rebase -i" was also very confused when the user left
14+
some staged changes in the index after "edit".
15+
16+
* Behaviour of "git diff --quiet" was inconsistent with "diff --exit-code"
17+
with the output redirected to /dev/null.
18+
19+
* "git stash apply sash@{1}" was fixed to error out. Prior versions
20+
would have applied stash@{0} incorrectly.
21+
22+
* "git for-each-ref --format=%(subject)" fixed for commits with no
23+
no newline in the message body.
24+
25+
* "git remote" fixed to protect printf from user input.
26+
27+
* "git checkout -q" once again suppresses the locally modified file list.
28+
29+
* Cross-directory renames are no longer used when creating packs. This
30+
allows more graceful behavior on filesystems like sshfs.
31+
32+
* Stale temporary files under $GIT_DIR/objects/pack are now cleaned up
33+
automatically by "git prune".
34+
35+
* "Git.pm" tests relied on unnecessarily more recent version of Perl.
36+
37+
* "gitweb" triggered undef warning on commits without log messages.
38+
39+
Many other documentation updates.
40+
41+
--
42+
exec >/var/tmp/1
43+
O=v1.6.0.2-41-g7fe4a72
44+
echo O=$(git describe maint)
45+
git shortlog --no-merges $O..maint

Documentation/config.txt

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,8 +363,17 @@ core.pager::
363363
variable. Note that git sets the `LESS` environment
364364
variable to `FRSX` if it is unset when it runs the
365365
pager. One can change these settings by setting the
366-
`LESS` variable to some other value or by giving the
367-
`core.pager` option a value such as "`less -+FRSX`".
366+
`LESS` variable to some other value. Alternately,
367+
these settings can be overridden on a project or
368+
global basis by setting the `core.pager` option.
369+
Setting `core.pager` has no affect on the `LESS`
370+
environment variable behaviour above, so if you want
371+
to override git's default settings this way, you need
372+
to be explicit. For example, to disable the S option
373+
in a backward compatible manner, set `core.pager`
374+
to "`less -+$LESS -FRX`". This will be passed to the
375+
shell by git, which will translate the final command to
376+
"`LESS=FRSX less -+FRSX -FRX`".
368377

369378
core.whitespace::
370379
A comma separated list of common whitespace problems to

Documentation/git-read-tree.txt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,10 @@ Here are the "carry forward" rules:
160160
0 nothing nothing nothing (does not happen)
161161
1 nothing nothing exists use M
162162
2 nothing exists nothing remove path from index
163-
3 nothing exists exists use M
163+
3 nothing exists exists, use M if "initial checkout"
164+
H == M keep index otherwise
165+
exists fail
166+
H != M
164167

165168
clean I==H I==M
166169
------------------
@@ -207,6 +210,12 @@ you picked it up via e-mail in a patch form), `git diff-index
207210
merge, but it would not show in `git diff-index --cached $M`
208211
output after two-tree merge.
209212

213+
Case #3 is slightly tricky and needs explanation. The result from this
214+
rule logically should be to remove the path if the user staged the removal
215+
of the path and then swiching to a new branch. That however will prevent
216+
the initial checkout from happening, so the rule is modified to use M (new
217+
tree) only when the contents of the index is empty. Otherwise the removal
218+
of the path is kept as long as $H and $M are the same.
210219

211220
3-Way Merge
212221
~~~~~~~~~~~

Documentation/git-repack.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ OPTIONS
6060
linkgit:git-pack-objects[1].
6161

6262
-f::
63-
Pass the `--no-reuse-delta` option to 'git-pack-objects'. See
63+
Pass the `--no-reuse-object` option to `git-pack-objects`, see
6464
linkgit:git-pack-objects[1].
6565

6666
-q::

Documentation/gitattributes.txt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -270,27 +270,27 @@ See linkgit:git[1] for details.
270270
Defining a custom hunk-header
271271
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
272272

273-
Each group of changes (called "hunk") in the textual diff output
273+
Each group of changes (called a "hunk") in the textual diff output
274274
is prefixed with a line of the form:
275275

276276
@@ -k,l +n,m @@ TEXT
277277

278-
The text is called 'hunk header', and by default a line that
279-
begins with an alphabet, an underscore or a dollar sign is used,
280-
which matches what GNU 'diff -p' output uses. This default
281-
selection however is not suited for some contents, and you can
282-
use customized pattern to make a selection.
278+
This is called a 'hunk header'. The "TEXT" portion is by default a line
279+
that begins with an alphabet, an underscore or a dollar sign; this
280+
matches what GNU 'diff -p' output uses. This default selection however
281+
is not suited for some contents, and you can use a customized pattern
282+
to make a selection.
283283

284-
First in .gitattributes, you would assign the `diff` attribute
284+
First, in .gitattributes, you would assign the `diff` attribute
285285
for paths.
286286

287287
------------------------
288288
*.tex diff=tex
289289
------------------------
290290

291-
Then, you would define "diff.tex.xfuncname" configuration to
291+
Then, you would define a "diff.tex.xfuncname" configuration to
292292
specify a regular expression that matches a line that you would
293-
want to appear as the hunk header, like this:
293+
want to appear as the hunk header "TEXT", like this:
294294

295295
------------------------
296296
[diff "tex"]

Documentation/gitdiffcore.txt

Lines changed: 22 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,25 @@ files:
3636

3737
- 'git-diff-tree' compares contents of two "tree" objects;
3838

39-
In all of these cases, the commands themselves compare
40-
corresponding paths in the two sets of files. The result of
41-
comparison is passed from these commands to what is internally
42-
called "diffcore", in a format similar to what is output when
43-
the -p option is not used. E.g.
39+
In all of these cases, the commands themselves first optionally limit
40+
the two sets of files by any pathspecs given on their command-lines,
41+
and compare corresponding paths in the two resulting sets of files.
42+
43+
The pathspecs are used to limit the world diff operates in. They remove
44+
the filepairs outside the specified sets of pathnames. E.g. If the
45+
input set of filepairs included:
46+
47+
------------------------------------------------
48+
:100644 100644 bcd1234... 0123456... M junkfile
49+
------------------------------------------------
50+
51+
but the command invocation was `git diff-files myfile`, then the
52+
junkfile entry would be removed from the list because only "myfile"
53+
is under consideration.
54+
55+
The result of comparison is passed from these commands to what is
56+
internally called "diffcore", in a format similar to what is output
57+
when the -p option is not used. E.g.
4458

4559
------------------------------------------------
4660
in-place edit :100644 100644 bcd1234... 0123456... M file0
@@ -52,48 +66,23 @@ unmerged :000000 000000 0000000... 0000000... U file6
5266
The diffcore mechanism is fed a list of such comparison results
5367
(each of which is called "filepair", although at this point each
5468
of them talks about a single file), and transforms such a list
55-
into another list. There are currently 6 such transformations:
69+
into another list. There are currently 5 such transformations:
5670

57-
- diffcore-pathspec
5871
- diffcore-break
5972
- diffcore-rename
6073
- diffcore-merge-broken
6174
- diffcore-pickaxe
6275
- diffcore-order
6376

6477
These are applied in sequence. The set of filepairs 'git-diff-{asterisk}'
65-
commands find are used as the input to diffcore-pathspec, and
66-
the output from diffcore-pathspec is used as the input to the
78+
commands find are used as the input to diffcore-break, and
79+
the output from diffcore-break is used as the input to the
6780
next transformation. The final result is then passed to the
6881
output routine and generates either diff-raw format (see Output
6982
format sections of the manual for 'git-diff-{asterisk}' commands) or
7083
diff-patch format.
7184

7285

73-
diffcore-pathspec: For Ignoring Files Outside Our Consideration
74-
---------------------------------------------------------------
75-
76-
The first transformation in the chain is diffcore-pathspec, and
77-
is controlled by giving the pathname parameters to the
78-
'git-diff-{asterisk}' commands on the command line. The pathspec is used
79-
to limit the world diff operates in. It removes the filepairs
80-
outside the specified set of pathnames. E.g. If the input set
81-
of filepairs included:
82-
83-
------------------------------------------------
84-
:100644 100644 bcd1234... 0123456... M junkfile
85-
------------------------------------------------
86-
87-
but the command invocation was `git diff-files myfile`, then the
88-
junkfile entry would be removed from the list because only "myfile"
89-
is under consideration.
90-
91-
Implementation note. For performance reasons, 'git-diff-tree'
92-
uses the pathname parameters on the command line to cull set of
93-
filepairs it feeds the diffcore mechanism itself, and does not
94-
use diffcore-pathspec, but the end result is the same.
95-
96-
9786
diffcore-break: For Splitting Up "Complete Rewrites"
9887
----------------------------------------------------
9988

builtin-apply.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include "delta.h"
1414
#include "builtin.h"
1515
#include "string-list.h"
16+
#include "dir.h"
1617

1718
/*
1819
* --check turns on checking that the working tree matches the
@@ -2735,15 +2736,7 @@ static void remove_file(struct patch *patch, int rmdir_empty)
27352736
warning("unable to remove submodule %s",
27362737
patch->old_name);
27372738
} else if (!unlink(patch->old_name) && rmdir_empty) {
2738-
char *name = xstrdup(patch->old_name);
2739-
char *end = strrchr(name, '/');
2740-
while (end) {
2741-
*end = 0;
2742-
if (rmdir(name))
2743-
break;
2744-
end = strrchr(name, '/');
2745-
}
2746-
free(name);
2739+
remove_path(patch->old_name);
27472740
}
27482741
}
27492742
}

builtin-archive.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ int cmd_archive(int argc, const char **argv, const char *prefix)
111111
{
112112
const char *remote = NULL;
113113

114+
git_config(git_default_config, NULL);
115+
114116
remote = extract_remote_arg(&argc, argv);
115117
if (remote)
116118
return run_remote_archiver(remote, argc, argv);

builtin-checkout.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,8 @@ static int merge_working_tree(struct checkout_opts *opts,
269269
}
270270

271271
/* 2-way merge to the new branch */
272+
topts.initial_checkout = (!active_nr &&
273+
(old->commit == new->commit));
272274
topts.update = 1;
273275
topts.merge = 1;
274276
topts.gently = opts->merge;
@@ -326,7 +328,7 @@ static int merge_working_tree(struct checkout_opts *opts,
326328
commit_locked_index(lock_file))
327329
die("unable to write new index file");
328330

329-
if (!opts->force)
331+
if (!opts->force && !opts->quiet)
330332
show_local_changes(&new->commit->object);
331333

332334
return 0;

builtin-clone.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ static struct option builtin_clone_options[] = {
5858
OPT_STRING(0, "reference", &option_reference, "repo",
5959
"reference repository"),
6060
OPT_STRING('o', "origin", &option_origin, "branch",
61-
"use <branch> instead or 'origin' to track upstream"),
61+
"use <branch> instead of 'origin' to track upstream"),
6262
OPT_STRING('u', "upload-pack", &option_upload_pack, "path",
6363
"path to git-upload-pack on the remote"),
6464
OPT_STRING(0, "depth", &option_depth, "depth",

0 commit comments

Comments
 (0)