Skip to content

Commit c336bc1

Browse files
committed
Sync with 1.7.11.7
2 parents e70d163 + bafc478 commit c336bc1

File tree

13 files changed

+147
-14
lines changed

13 files changed

+147
-14
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@
189189
/test-mktemp
190190
/test-parse-options
191191
/test-path-utils
192+
/test-regex
192193
/test-revision-walking
193194
/test-run-command
194195
/test-sha1

Documentation/RelNotes/1.7.11.7.txt

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
Git v1.7.11.7 Release Notes
2+
===========================
3+
4+
Fixes since v1.7.11.6
5+
---------------------
6+
7+
* The synopsis said "checkout [-B branch]" to make it clear the
8+
branch name is a parameter to the option, but the heading for the
9+
option description was "-B::", not "-B branch::", making the
10+
documentation misleading.
11+
12+
* Git ships with a fall-back regexp implementation for platforms with
13+
buggy regexp library, but it was easy for people to keep using their
14+
platform regexp. A new test has been added to check this.
15+
16+
* "git apply -p0" did not parse pathnames on "diff --git" line
17+
correctly. This caused patches that had pathnames in no other
18+
places to be mistakenly rejected (most notably, binary patch that
19+
does not rename nor change mode). Textual patches, renames or mode
20+
changes have preimage and postimage pathnames in different places
21+
in a form that can be parsed unambiguously and did not suffer from
22+
this problem.
23+
24+
* After "gitk" showed the contents of a tag, neither "Reread
25+
references" nor "Reload" did not update what is shown as the
26+
contents of it, when the user overwrote the tag with "git tag -f".
27+
28+
* "git for-each-ref" did not currectly support more than one --sort
29+
option.
30+
31+
* "git log .." errored out saying it is both rev range and a path
32+
when there is no disambiguating "--" is on the command line.
33+
Update the command line parser to interpret ".." as a path in such
34+
a case.
35+
36+
* Pushing to smart HTTP server with recent Git fails without having
37+
the username in the URL to force authentication, if the server is
38+
configured to allow GET anonymously, while requiring authentication
39+
for POST.
40+
41+
* "git show --format='%ci'" did not give timestamp correctly for
42+
commits created without human readable name on "committer" line.
43+
(merge e27ddb6 jc/maint-ident-missing-human-name later to maint).
44+
45+
* "git show --quiet" ought to be a synonym for "git show -s", but
46+
wasn't.

Documentation/git-checkout.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,18 @@ $ git checkout hello.c <3>
367367
<2> take a file out of another commit
368368
<3> restore hello.c from the index
369369
+
370+
If you want to check out _all_ C source files out of the index,
371+
you can say
372+
+
373+
------------
374+
$ git checkout -- '*.c'
375+
------------
376+
+
377+
Note the quotes around `*.c`. The file `hello.c` will also be
378+
checked out, even though it is no longer in the working tree,
379+
because the file globbing is used to match entries in the index
380+
(not in the working tree by the shell).
381+
+
370382
If you have an unfortunate branch that is named `hello.c`, this
371383
step would be confused as an instruction to switch to that branch.
372384
You should instead write:

Documentation/git.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,10 @@ Documentation for older releases are available here:
4848
* release notes for
4949
link:RelNotes/1.7.12.txt[1.7.12].
5050

51-
* link:v1.7.11.6/git.html[documentation for release 1.7.11.6]
51+
* link:v1.7.11.7/git.html[documentation for release 1.7.11.7]
5252

5353
* release notes for
54+
link:RelNotes/1.7.11.7.txt[1.7.11.7],
5455
link:RelNotes/1.7.11.6.txt[1.7.11.6],
5556
link:RelNotes/1.7.11.5.txt[1.7.11.5],
5657
link:RelNotes/1.7.11.4.txt[1.7.11.4],

Documentation/gitcli.txt

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,28 @@ arguments. Here are the rules:
3737
file called HEAD in your work tree, `git diff HEAD` is ambiguous, and
3838
you have to say either `git diff HEAD --` or `git diff -- HEAD` to
3939
disambiguate.
40-
40+
+
4141
When writing a script that is expected to handle random user-input, it is
4242
a good practice to make it explicit which arguments are which by placing
4343
disambiguating `--` at appropriate places.
4444

45+
* Many commands allow wildcards in paths, but you need to protect
46+
them from getting globbed by the shell. These two mean different
47+
things:
48+
+
49+
--------------------------------
50+
$ git checkout -- *.c
51+
$ git checkout -- \*.c
52+
--------------------------------
53+
+
54+
The former lets your shell expand the fileglob, and you are asking
55+
the dot-C files in your working tree to be overwritten with the version
56+
in the index. The latter passes the `*.c` to Git, and you are asking
57+
the paths in the index that match the pattern to be checked out to your
58+
working tree. After running `git add hello.c; rm hello.c`, you will _not_
59+
see `hello.c` in your working tree with the former, but with the latter
60+
you will.
61+
4562
Here are the rules regarding the "flags" that you should follow when you are
4663
scripting git:
4764

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,7 @@ TEST_PROGRAMS_NEED_X += test-mergesort
496496
TEST_PROGRAMS_NEED_X += test-mktemp
497497
TEST_PROGRAMS_NEED_X += test-parse-options
498498
TEST_PROGRAMS_NEED_X += test-path-utils
499+
TEST_PROGRAMS_NEED_X += test-regex
499500
TEST_PROGRAMS_NEED_X += test-revision-walking
500501
TEST_PROGRAMS_NEED_X += test-run-command
501502
TEST_PROGRAMS_NEED_X += test-scrap-cache-tree

builtin/commit.c

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,20 @@ static void export_one(const char *var, const char *s, const char *e, int hack)
478478
strbuf_release(&buf);
479479
}
480480

481+
static int sane_ident_split(struct ident_split *person)
482+
{
483+
if (!person->name_begin || !person->name_end ||
484+
person->name_begin == person->name_end)
485+
return 0; /* no human readable name */
486+
if (!person->mail_begin || !person->mail_end ||
487+
person->mail_begin == person->mail_end)
488+
return 0; /* no usable mail */
489+
if (!person->date_begin || !person->date_end ||
490+
!person->tz_begin || !person->tz_end)
491+
return 0;
492+
return 1;
493+
}
494+
481495
static void determine_author_info(struct strbuf *author_ident)
482496
{
483497
char *name, *email, *date;
@@ -530,7 +544,8 @@ static void determine_author_info(struct strbuf *author_ident)
530544
if (force_date)
531545
date = force_date;
532546
strbuf_addstr(author_ident, fmt_ident(name, email, date, IDENT_STRICT));
533-
if (!split_ident_line(&author, author_ident->buf, author_ident->len)) {
547+
if (!split_ident_line(&author, author_ident->buf, author_ident->len) &&
548+
sane_ident_split(&author)) {
534549
export_one("GIT_AUTHOR_NAME", author.name_begin, author.name_end, 0);
535550
export_one("GIT_AUTHOR_EMAIL", author.mail_begin, author.mail_end, 0);
536551
export_one("GIT_AUTHOR_DATE", author.date_begin, author.tz_end, '@');

builtin/log.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,9 @@ static void cmd_log_init_finish(int argc, const char **argv, const char *prefix,
109109
PARSE_OPT_KEEP_ARGV0 | PARSE_OPT_KEEP_UNKNOWN |
110110
PARSE_OPT_KEEP_DASHDASH);
111111

112-
argc = setup_revisions(argc, argv, rev, opt);
113112
if (quiet)
114113
rev->diffopt.output_format |= DIFF_FORMAT_NO_OUTPUT;
114+
argc = setup_revisions(argc, argv, rev, opt);
115115

116116
/* Any arguments at this point are not recognized */
117117
if (argc > 1)

gitk-git/gitk

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2038,7 +2038,7 @@ proc makewindow {} {
20382038
set file {
20392039
mc "File" cascade {
20402040
{mc "Update" command updatecommits -accelerator F5}
2041-
{mc "Reload" command reloadcommits -accelerator Meta1-F5}
2041+
{mc "Reload" command reloadcommits -accelerator Shift-F5}
20422042
{mc "Reread references" command rereadrefs}
20432043
{mc "List references" command showrefs -accelerator F2}
20442044
{xx "" separator}
@@ -2495,7 +2495,7 @@ proc makewindow {} {
24952495
bindkey ? {dofind -1 1}
24962496
bindkey f nextfile
24972497
bind . <F5> updatecommits
2498-
bind . <$M1B-F5> reloadcommits
2498+
bind . <Shift-F5> reloadcommits
24992499
bind . <F2> showrefs
25002500
bind . <Shift-F4> {newview 0}
25012501
catch { bind . <Shift-Key-XF86_Switch_VT_4> {newview 0} }
@@ -10599,7 +10599,7 @@ proc movedhead {hid head} {
1059910599
}
1060010600

1060110601
proc changedrefs {} {
10602-
global cached_dheads cached_dtags cached_atags
10602+
global cached_dheads cached_dtags cached_atags cached_tagcontent
1060310603
global arctags archeads arcnos arcout idheads idtags
1060410604

1060510605
foreach id [concat [array names idheads] [array names idtags]] {
@@ -10611,6 +10611,7 @@ proc changedrefs {} {
1061110611
}
1061210612
}
1061310613
}
10614+
catch {unset cached_tagcontent}
1061410615
catch {unset cached_dtags}
1061510616
catch {unset cached_atags}
1061610617
catch {unset cached_dheads}
@@ -10663,7 +10664,7 @@ proc listrefs {id} {
1066310664
}
1066410665

1066510666
proc showtag {tag isnew} {
10666-
global ctext tagcontents tagids linknum tagobjid
10667+
global ctext cached_tagcontent tagids linknum tagobjid
1066710668

1066810669
if {$isnew} {
1066910670
addtohistory [list showtag $tag 0] savectextpos
@@ -10672,13 +10673,13 @@ proc showtag {tag isnew} {
1067210673
clear_ctext
1067310674
settabs 0
1067410675
set linknum 0
10675-
if {![info exists tagcontents($tag)]} {
10676+
if {![info exists cached_tagcontent($tag)]} {
1067610677
catch {
10677-
set tagcontents($tag) [exec git cat-file tag $tag]
10678+
set cached_tagcontent($tag) [exec git cat-file tag $tag]
1067810679
}
1067910680
}
10680-
if {[info exists tagcontents($tag)]} {
10681-
set text $tagcontents($tag)
10681+
if {[info exists cached_tagcontent($tag)]} {
10682+
set text $cached_tagcontent($tag)
1068210683
} else {
1068310684
set text "[mc "Tag"]: $tag\n[mc "Id"]: $tagids($tag)"
1068410685
}

ident.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,10 @@ int split_ident_line(struct ident_split *split, const char *line, int len)
210210
split->name_end = cp + 1;
211211
break;
212212
}
213-
if (!split->name_end)
214-
return status;
213+
if (!split->name_end) {
214+
/* no human readable name */
215+
split->name_end = split->name_begin;
216+
}
215217

216218
for (cp = split->mail_begin; cp < line + len; cp++)
217219
if (*cp == '>') {

0 commit comments

Comments
 (0)