Skip to content

Commit

Permalink
Merge branch 'maint'
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
Junio C Hamano committed Sep 6, 2008
2 parents 80d12c2 + aaefbfa commit 4a09bc9
Show file tree
Hide file tree
Showing 10 changed files with 477 additions and 388 deletions.
23 changes: 20 additions & 3 deletions Documentation/RelNotes-1.6.0.2.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,33 +18,50 @@ Fixes since v1.6.0.1
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 blame -c" did not exactly work like "git annotate" when range
boundaries are involved.

* "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 diff --cumulative" did not imply "--dirstat".

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

* "git log --grep=pattern -i" did not ignore case.
* "git gui" allowed users to feed patch without any context to be applied.

* "git gui" botched parsing "diff" output when a line that begins with two
dashes and a space gets removed or a line that begins with two pluses
and a space gets added.

* "git gui" translation updates and i18n fixes.

* "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.

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

5 changes: 5 additions & 0 deletions Documentation/git-annotate.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ DESCRIPTION
Annotates each line in the given file with information from the commit
which introduced the line. Optionally annotate from a given revision.

The only difference between this command and linkgit:git-blame[1] is that
they use slightly different output formats, and this command exists only
for backward compatibility to support existing scripts, and provide more
familiar command name for people coming from other SCM systems.

OPTIONS
-------
include::blame-options.txt[]
Expand Down
9 changes: 5 additions & 4 deletions builtin-blame.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ static int show_root;
static int reverse;
static int blank_boundary;
static int incremental;
static int cmd_is_annotate;
static int xdl_opts = XDF_NEED_MINIMAL;
static struct string_list mailmap;

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

struct parse_opt_ctx_t ctx;

cmd_is_annotate = !strcmp(argv[0], "annotate");
int cmd_is_annotate = !strcmp(argv[0], "annotate");

git_config(git_blame_config, NULL);
init_revisions(&revs, NULL);
Expand Down Expand Up @@ -2342,6 +2340,9 @@ int cmd_blame(int argc, const char **argv, const char *prefix)
parse_done:
argc = parse_options_end(&ctx);

if (cmd_is_annotate)
output_option |= OUTPUT_ANNOTATE_COMPAT;

if (DIFF_OPT_TST(&revs.diffopt, FIND_COPIES_HARDER))
opt |= (PICKAXE_BLAME_COPY | PICKAXE_BLAME_MOVE |
PICKAXE_BLAME_COPY_HARDER);
Expand Down
2 changes: 1 addition & 1 deletion git-gui/git-gui.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1932,7 +1932,7 @@ proc show_more_context {} {
proc show_less_context {} {
global repo_config
if {$repo_config(gui.diffcontext) >= 1} {
if {$repo_config(gui.diffcontext) > 1} {
incr repo_config(gui.diffcontext) -1
reshow_diff
}
Expand Down
20 changes: 12 additions & 8 deletions git-gui/lib/diff.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ proc show_diff {path w {lno {}} {scroll_pos {}}} {

lappend cmd -p
lappend cmd --no-color
if {$repo_config(gui.diffcontext) >= 0} {
if {$repo_config(gui.diffcontext) >= 1} {
lappend cmd "-U$repo_config(gui.diffcontext)"
}
if {$w eq $ui_index} {
Expand All @@ -192,6 +192,7 @@ proc show_diff {path w {lno {}} {scroll_pos {}}} {
return
}

set ::current_diff_inheader 1
fconfigure $fd \
-blocking 0 \
-encoding binary \
Expand All @@ -207,18 +208,21 @@ proc read_diff {fd scroll_pos} {
while {[gets $fd line] >= 0} {
# -- Cleanup uninteresting diff header lines.
#
if { [string match {diff --git *} $line]
|| [string match {diff --cc *} $line]
|| [string match {diff --combined *} $line]
|| [string match {--- *} $line]
|| [string match {+++ *} $line]} {
append current_diff_header $line "\n"
continue
if {$::current_diff_inheader} {
if { [string match {diff --git *} $line]
|| [string match {diff --cc *} $line]
|| [string match {diff --combined *} $line]
|| [string match {--- *} $line]
|| [string match {+++ *} $line]} {
append current_diff_header $line "\n"
continue
}
}
if {[string match {index *} $line]} continue
if {$line eq {deleted file mode 120000}} {
set line "deleted symlink"
}
set ::current_diff_inheader 0

# -- Automatically detect if this is a 3 way diff.
#
Expand Down
2 changes: 1 addition & 1 deletion git-gui/lib/option.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ proc do_options {} {
{b gui.matchtrackingbranch {mc "Match Tracking Branches"}}
{b gui.fastcopyblame {mc "Blame Copy Only On Changed Files"}}
{i-20..200 gui.copyblamethreshold {mc "Minimum Letters To Blame Copy On"}}
{i-0..99 gui.diffcontext {mc "Number of Diff Context Lines"}}
{i-1..99 gui.diffcontext {mc "Number of Diff Context Lines"}}
{i-0..99 gui.commitmsgwidth {mc "Commit Message Text Width"}}
{t gui.newbranchtemplate {mc "New Branch Name Template"}}
} {
Expand Down
Loading

0 comments on commit 4a09bc9

Please sign in to comment.