Skip to content

Commit 4a09bc9

Browse files
committed
Merge branch 'maint'
* maint: Update draft release notes for 1.6.0.2 stash: refresh the index before deciding if the work tree is dirty Mention the fact that 'git annotate' is only for backward compatibility. "blame -c" should be compatible with "annotate" git-gui: Fix diff parsing for lines starting with "--" or "++" git-gui: Fix string escaping in po2msg.sh git gui: show diffs with a minimum of 1 context line git-gui: update all remaining translations to French. git-gui: Update french translation
2 parents 80d12c2 + aaefbfa commit 4a09bc9

File tree

10 files changed

+477
-388
lines changed

10 files changed

+477
-388
lines changed

Documentation/RelNotes-1.6.0.2.txt

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,33 +18,50 @@ Fixes since v1.6.0.1
1818
with GIT_WORK_TREE environment settings.
1919

2020

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

24+
* "git blame -c" did not exactly work like "git annotate" when range
25+
boundaries are involved.
26+
2527
* "git clone $there $here/" with extra trailing slashes after explicit
2628
local directory name $here did not work as expected.
2729

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

33+
* "git diff --cumulative" did not imply "--dirstat".
34+
3135
* "git for-each-ref refs/heads/" did not work as expected.
3236

33-
* "git log --grep=pattern -i" did not ignore case.
37+
* "git gui" allowed users to feed patch without any context to be applied.
38+
39+
* "git gui" botched parsing "diff" output when a line that begins with two
40+
dashes and a space gets removed or a line that begins with two pluses
41+
and a space gets added.
42+
43+
* "git gui" translation updates and i18n fixes.
44+
45+
* "git log -i --grep=pattern" did not ignore case; neither "git log -E
46+
--grep=pattern" triggered extended regexp.
3447

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

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

54+
* "git stash" was fooled by a stat-dirty but otherwise unmodified paths
55+
and refused to work until the user refreshed the index.
56+
4157
* "git verify-pack -v" did not work correctly when given more than one
4258
packfile.
4359

4460
Also contains many documentation updates.
4561

4662
--
4763
exec >/var/tmp/1
48-
O=v1.6.0.1-49-g6a42cfe
64+
O=v1.6.0.1-61-g1eff26c
4965
echo O=$(git describe maint)
5066
git shortlog --no-merges $O..maint
67+

Documentation/git-annotate.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ DESCRIPTION
1414
Annotates each line in the given file with information from the commit
1515
which introduced the line. Optionally annotate from a given revision.
1616

17+
The only difference between this command and linkgit:git-blame[1] is that
18+
they use slightly different output formats, and this command exists only
19+
for backward compatibility to support existing scripts, and provide more
20+
familiar command name for people coming from other SCM systems.
21+
1722
OPTIONS
1823
-------
1924
include::blame-options.txt[]

builtin-blame.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ static int show_root;
3838
static int reverse;
3939
static int blank_boundary;
4040
static int incremental;
41-
static int cmd_is_annotate;
4241
static int xdl_opts = XDF_NEED_MINIMAL;
4342
static struct string_list mailmap;
4443

@@ -1682,7 +1681,7 @@ static void emit_other(struct scoreboard *sb, struct blame_entry *ent, int opt)
16821681
if (suspect->commit->object.flags & UNINTERESTING) {
16831682
if (blank_boundary)
16841683
memset(hex, ' ', length);
1685-
else if (!cmd_is_annotate) {
1684+
else if (!(opt & OUTPUT_ANNOTATE_COMPAT)) {
16861685
length--;
16871686
putchar('^');
16881687
}
@@ -2313,8 +2312,7 @@ int cmd_blame(int argc, const char **argv, const char *prefix)
23132312
};
23142313

23152314
struct parse_opt_ctx_t ctx;
2316-
2317-
cmd_is_annotate = !strcmp(argv[0], "annotate");
2315+
int cmd_is_annotate = !strcmp(argv[0], "annotate");
23182316

23192317
git_config(git_blame_config, NULL);
23202318
init_revisions(&revs, NULL);
@@ -2342,6 +2340,9 @@ int cmd_blame(int argc, const char **argv, const char *prefix)
23422340
parse_done:
23432341
argc = parse_options_end(&ctx);
23442342

2343+
if (cmd_is_annotate)
2344+
output_option |= OUTPUT_ANNOTATE_COMPAT;
2345+
23452346
if (DIFF_OPT_TST(&revs.diffopt, FIND_COPIES_HARDER))
23462347
opt |= (PICKAXE_BLAME_COPY | PICKAXE_BLAME_MOVE |
23472348
PICKAXE_BLAME_COPY_HARDER);

git-gui/git-gui.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1932,7 +1932,7 @@ proc show_more_context {} {
19321932
19331933
proc show_less_context {} {
19341934
global repo_config
1935-
if {$repo_config(gui.diffcontext) >= 1} {
1935+
if {$repo_config(gui.diffcontext) > 1} {
19361936
incr repo_config(gui.diffcontext) -1
19371937
reshow_diff
19381938
}

git-gui/lib/diff.tcl

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ proc show_diff {path w {lno {}} {scroll_pos {}}} {
175175

176176
lappend cmd -p
177177
lappend cmd --no-color
178-
if {$repo_config(gui.diffcontext) >= 0} {
178+
if {$repo_config(gui.diffcontext) >= 1} {
179179
lappend cmd "-U$repo_config(gui.diffcontext)"
180180
}
181181
if {$w eq $ui_index} {
@@ -192,6 +192,7 @@ proc show_diff {path w {lno {}} {scroll_pos {}}} {
192192
return
193193
}
194194

195+
set ::current_diff_inheader 1
195196
fconfigure $fd \
196197
-blocking 0 \
197198
-encoding binary \
@@ -207,18 +208,21 @@ proc read_diff {fd scroll_pos} {
207208
while {[gets $fd line] >= 0} {
208209
# -- Cleanup uninteresting diff header lines.
209210
#
210-
if { [string match {diff --git *} $line]
211-
|| [string match {diff --cc *} $line]
212-
|| [string match {diff --combined *} $line]
213-
|| [string match {--- *} $line]
214-
|| [string match {+++ *} $line]} {
215-
append current_diff_header $line "\n"
216-
continue
211+
if {$::current_diff_inheader} {
212+
if { [string match {diff --git *} $line]
213+
|| [string match {diff --cc *} $line]
214+
|| [string match {diff --combined *} $line]
215+
|| [string match {--- *} $line]
216+
|| [string match {+++ *} $line]} {
217+
append current_diff_header $line "\n"
218+
continue
219+
}
217220
}
218221
if {[string match {index *} $line]} continue
219222
if {$line eq {deleted file mode 120000}} {
220223
set line "deleted symlink"
221224
}
225+
set ::current_diff_inheader 0
222226

223227
# -- Automatically detect if this is a 3 way diff.
224228
#

git-gui/lib/option.tcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ proc do_options {} {
125125
{b gui.matchtrackingbranch {mc "Match Tracking Branches"}}
126126
{b gui.fastcopyblame {mc "Blame Copy Only On Changed Files"}}
127127
{i-20..200 gui.copyblamethreshold {mc "Minimum Letters To Blame Copy On"}}
128-
{i-0..99 gui.diffcontext {mc "Number of Diff Context Lines"}}
128+
{i-1..99 gui.diffcontext {mc "Number of Diff Context Lines"}}
129129
{i-0..99 gui.commitmsgwidth {mc "Commit Message Text Width"}}
130130
{t gui.newbranchtemplate {mc "New Branch Name Template"}}
131131
} {

0 commit comments

Comments
 (0)