{"thread":{"id":"26973","subject":"[ANNOUNCE] Git 1.7.4.3","startedAt":"2011-04-03T08:36:24Z","lastAt":"2011-04-06T21:36:18Z","messageCount":6,"participants":["Junio C Hamano","Arnaud Lacombe"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"164986","messageId":"7v4o6fg29j.fsf@alter.siamese.dyndns.org","threadId":"26973","inReplyTo":null,"subject":"[ANNOUNCE] Git 1.7.4.3","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-04-03T08:36:24Z","receivedAt":"2011-04-03T08:36:24Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"The latest maintenance release Git 1.7.4.3 is available at the\nusual places:\n\n  http://www.kernel.org/pub/software/scm/git/\n\n  git-1.7.4.3.tar.{gz,bz2}\t\t\t(source tarball)\n  git-htmldocs-1.7.4.3.tar.{gz,bz2}\t\t(preformatted docs)\n  git-manpages-1.7.4.3.tar.{gz,bz2}\t\t(preformatted docs)\n\nThe RPM binary packages for a few architectures are found in:\n\n  RPMS/$arch/git-*-1.7.4.3-1.fc13.$arch.rpm\t(RPM)\n\nGit v1.7.4.3 Release Notes\n==========================\n\nFixes since v1.7.4.2\n--------------------\n\n * \"git apply\" used to confuse lines updated by previous hunks as lines\n   that existed before when applying a hunk, contributing misapplication\n   of patches with offsets.\n\n * \"git branch --track\" (and \"git checkout --track --branch\") used to\n   allow setting up a random non-branch that does not make sense to follow\n   as the \"upstream\".  The command correctly diagnoses it as an error.\n\n * \"git checkout $other_branch\" silently removed untracked symbolic links\n   in the working tree that are in the way in order to check out paths\n   under it from the named branch.\n\n * \"git cvsimport\" did not bail out immediately when the cvs server cannot\n   be reached, spewing unnecessary error messages that complain about the\n   server response that it never got.\n\n * \"git diff --quiet\" did not work very well with the \"--diff-filter\"\n   option.\n\n * \"git grep -n\" lacked a long-hand synonym --line-number.\n\n * \"git stash apply\" reported the result of its operation by running\n   \"git status\" from the top-level of the working tree; it should (and\n   now does) run it from the user's working directory.\n\nAnd other minor fixes and documentation updates.\n\n----------------------------------------------------------------\n\nChanges since v1.7.4.2 are as follows:\n\nAlex Riesen (1):\n      HOME must be set before calling git-init when creating test repositories\n\nCarlos Martín Nieto (1):\n      Documentation/config.txt: make truth value of numbers more explicit\n\nClemens Buchacher (1):\n      do not overwrite untracked symlinks\n\nFabian Keil (1):\n      git-cvsimport.perl: Bail out right away when reading from the server fails\n\nJeff King (1):\n      docs: fix filter-branch subdir example for exotic repo names\n\nJoe Ratterman (1):\n      grep: Add the option '--line-number'\n\nJohan Herland (1):\n      branch/checkout --track: Ensure that upstream branch is indeed a branch\n\nJohannes Sixt (3):\n      Demonstrate breakage: checkout overwrites untracked symlink with directory\n      stash: fix incorrect quoting in cleanup of temporary files\n      stash: copy the index using --index-output instead of cp -p\n\nJunio C Hamano (9):\n      checkout: fix bug with ambiguous refs\n      apply: do not patch lines that were already patched\n      apply -v: show offset count when patch did not apply exactly\n      diff --quiet: disable optimization when --diff-filter=X is used\n      doc: technical details about the index file format\n      t8001: check the exit status of the command being tested\n      parse-remote: typofix\n      Doc: mention --delta-base-offset is the default for Porcelain commands\n      Git 1.7.4.3\n\nMaxin john (1):\n      contrib/thunderbird-patch-inline: do not require bash to run the script\n\nMichael J Gruber (2):\n      git-bisect.txt: streamline run presentation\n      git-bisect.txt: example for bisecting with hot-fix\n\nMichael Witten (3):\n      git tag documentation grammar fixes and readability updates\n      Typos: t/README\n      strbuf.h: remove a tad stale docs-in-comment and reference api-doc instead\n\nNguyễn Thái Ngọc Duy (1):\n      doc: technical details about the index file format\n\nPiotr Krukowiecki (2):\n      git stash: show status relative to current directory\n      Add test: git stash shows status relative to current dir\n\nStephen Boyd (2):\n      parse-remote: replace unnecessary sed invocation\n      git-pack-objects.txt: fix grammatical errors\n"},{"id":"165297","messageId":"BANLkTimh+--iRNEpr2XOFf4jXoVhmHUnoA@mail.gmail.com","threadId":"26973","inReplyTo":"7v4o6fg29j.fsf@alter.siamese.dyndns.org","subject":"Re: [ANNOUNCE] Git 1.7.4.3","fromName":"Arnaud Lacombe","fromEmail":"lacombar@gmail.com","sentAt":"2011-04-06T18:40:29Z","receivedAt":"2011-04-06T18:40:29Z","isPatch":false,"sender":{"key":"lacombar@gmail.com","avatar":"https://gravatar.com/avatar/411d40b6ba69fff936664b1ff7cff65f3ca23f236700f0f0d0313b6b43abd344?d=mp&s=160"},"body":"Hi Julio,,\n\nOn Sun, Apr 3, 2011 at 4:36 AM, Junio C Hamano <gitster@pobox.com> wrote:\n> Junio C Hamano (9):\n>      apply: do not patch lines that were already patched\n>\nThis commit introduces a regression when editing splithunks using \"git\nadd -p\". Reverting the patch fix the regression.\n\nConsidering the following checked-in code:\n\nint\nmain(int argc, char **argv)\n{\n        int a;\n\n        return 0;\n}\n\nmodified the following way:\n\nint\nmain(int argc, char **argv)\n{\n        int c;\n        int a;\n        int d;\n        int e;\n        int f;\n\n        return 0;\n}\n\nif you 'git add -p' on the file, you'll get:\n\ndiff --git a/main.c b/main.c\nindex f9f4197..7fb483f 100644\n--- a/main.c\n+++ b/main.c\n@@ -9,7 +9,11 @@\n int\n main(int argc, char **argv)\n {\n+       int c;\n        int a;\n+       int d;\n+       int e;\n+       int f;\n\n        return 0;\n }\n\nNow, I only want the first part, so I reduce the context by typing\n's', which lead to:\n\nSplit into 2 hunks.\n@@ -9,4 +9,5 @@\n int\n main(int argc, char **argv)\n {\n+       int c;\n        int a;\n\nIf I edit this hunk and make _no_modification_, \"git apply\" fails with:\n\nerror: patch failed: main.c:12\nerror: main.c: patch does not apply\nYour edited hunk does not apply. Edit again (saying \"no\" discards!) [y/n]?\n\nThis hunk does _apply_, as it could be staged and committed as-is if I\ndid not edit it.\n\nThis was just a way to reproduce the regression. If you change the\ncode in a way that would still apply, git-apply would still fails to\napply the hunk. Editing the whole original hunk (ie. not split) works\nfine.\n\n - Arnaud\n"},{"id":"165306","messageId":"7voc4ji23p.fsf@alter.siamese.dyndns.org","threadId":"26973","inReplyTo":"BANLkTimh+--iRNEpr2XOFf4jXoVhmHUnoA@mail.gmail.com","subject":"Re: [ANNOUNCE] Git 1.7.4.3","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-04-06T19:58:18Z","receivedAt":"2011-04-06T19:58:18Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Arnaud Lacombe <lacombar@gmail.com> writes:\n\n> This commit introduces a regression when editing splithunks using \"git\n> add -p\". Reverting the patch fix the regression.\n\nThanks for a report.  I don't have a time to look at this now; help from\n\"add -p\" people would be appreciated.\n\nI have a suspicion that the symptom may be a bug in \"add -p\" exposed by\nthe change; \"add -p\" which used to count the patch lines carefully itself,\nbut was modified to use 'apply --recount' in more recent versions.\n"},{"id":"165310","messageId":"7v4o6bi1lm.fsf_-_@alter.siamese.dyndns.org","threadId":"26973","inReplyTo":"7voc4ji23p.fsf@alter.siamese.dyndns.org","subject":"\"add -p\" breakage","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-04-06T20:09:09Z","receivedAt":"2011-04-06T20:09:09Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Arnaud Lacombe <lacombar@gmail.com> writes:\n>\n>> This commit introduces a regression when editing splithunks using \"git\n>> add -p\". Reverting the patch fix the regression.\n>\n> Thanks for a report.  I don't have a time to look at this now; help from\n> \"add -p\" people would be appreciated.\n>\n> I have a suspicion that the symptom may be a bug in \"add -p\" exposed by\n> the change; \"add -p\" which used to count the patch lines carefully itself,\n> but was modified to use 'apply --recount' in more recent versions.\n\nSorry, not that one, but what \"add -p\" used to carefully do but punts\nthese days is to combine adjacent hunks correctly.  I suspect that\nlaziness is coming back and haunt us, and if that is the case, we should\nfix it there, and should not work it around by breaking the normal patch\napplication codepath.\n"},{"id":"165313","messageId":"7vy63ngj7a.fsf_-_@alter.siamese.dyndns.org","threadId":"26973","inReplyTo":"7v4o6bi1lm.fsf_-_@alter.siamese.dyndns.org","subject":"[PATCH] add--interactive.perl: factor out repeated --recount option","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-04-06T21:31:53Z","receivedAt":"2011-04-06T21:31:53Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Depending on the direction and the target of patch application, we would\nneed to pass --cached and --reverse to underlying \"git apply\".  Also we\nonly pass --check when we are not applying but just checking.\n\nBut we always pass --recount since 8cbd431 (git-add--interactive: replace\nhunk recounting with apply --recount, 2008-07-02).  Instead of repeating\nthe same --recount over and over again, move it to a single place that\nactually runs the command, namely, \"run_git_apply\" subroutine.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n\n * Applies on top of 9d15860.  I tried to be careful but may have missed\n   some calls.  Extra set of eyeballs appreciated.\n\n git-add--interactive.perl |   16 ++++++++--------\n 1 files changed, 8 insertions(+), 8 deletions(-)\n\ndiff --git a/git-add--interactive.perl b/git-add--interactive.perl\nindex a329c5a..6a439db 100755\n--- a/git-add--interactive.perl\n+++ b/git-add--interactive.perl\n@@ -705,7 +705,7 @@ sub add_untracked_cmd {\n sub run_git_apply {\n \tmy $cmd = shift;\n \tmy $fh;\n-\topen $fh, '| git ' . $cmd;\n+\topen $fh, '| git ' . $cmd . \" --recount\";\n \tprint $fh @_;\n \treturn close $fh;\n }\n@@ -1050,7 +1050,7 @@ sub edit_hunk_manually {\n \n sub diff_applies {\n \tmy $fh;\n-\treturn run_git_apply($patch_mode_flavour{APPLY_CHECK} . ' --recount --check',\n+\treturn run_git_apply($patch_mode_flavour{APPLY_CHECK} . ' --check',\n \t\t\t     map { @{$_->{TEXT}} } @_);\n }\n \n@@ -1139,7 +1139,7 @@ sub help_patch_cmd {\n \n sub apply_patch {\n \tmy $cmd = shift;\n-\tmy $ret = run_git_apply $cmd . ' --recount', @_;\n+\tmy $ret = run_git_apply $cmd, @_;\n \tif (!$ret) {\n \t\tprint STDERR @_;\n \t}\n@@ -1148,17 +1148,17 @@ sub apply_patch {\n \n sub apply_patch_for_checkout_commit {\n \tmy $reverse = shift;\n-\tmy $applies_index = run_git_apply 'apply '.$reverse.' --cached --recount --check', @_;\n-\tmy $applies_worktree = run_git_apply 'apply '.$reverse.' --recount --check', @_;\n+\tmy $applies_index = run_git_apply 'apply '.$reverse.' --cached --check', @_;\n+\tmy $applies_worktree = run_git_apply 'apply '.$reverse.' --check', @_;\n \n \tif ($applies_worktree && $applies_index) {\n-\t\trun_git_apply 'apply '.$reverse.' --cached --recount', @_;\n-\t\trun_git_apply 'apply '.$reverse.' --recount', @_;\n+\t\trun_git_apply 'apply '.$reverse.' --cached', @_;\n+\t\trun_git_apply 'apply '.$reverse, @_;\n \t\treturn 1;\n \t} elsif (!$applies_index) {\n \t\tprint colored $error_color, \"The selected hunks do not apply to the index!\\n\";\n \t\tif (prompt_yesno \"Apply them to the worktree anyway? \") {\n-\t\t\treturn run_git_apply 'apply '.$reverse.' --recount', @_;\n+\t\t\treturn run_git_apply 'apply '.$reverse, @_;\n \t\t} else {\n \t\t\tprint colored $error_color, \"Nothing was applied.\\n\";\n \t\t\treturn 0;\n-- \n1.7.5.rc1\n"},{"id":"165315","messageId":"7vsjtvgizx.fsf_-_@alter.siamese.dyndns.org","threadId":"26973","inReplyTo":"7vy63ngj7a.fsf_-_@alter.siamese.dyndns.org","subject":"[PATCH] \"add -p\": work-around an old laziness that does not coalesce hunks","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-04-06T21:36:18Z","receivedAt":"2011-04-06T21:36:18Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Since 0beee4c (git-add--interactive: remove hunk coalescing, 2008-07-02),\n\"git add--interactive\" passes overlapping hunks to \"git apply\" without\ncoalescing adjacent hunks.  This was partially corrected by 7a26e65 (its\npartial revert, 2009-05-16), but overlapping hunks are still passed when\nthe patch is edited.\n\nTeach the --allow-overlap option to \"git apply\" to disable the recent\nsafety feature that avoids misapplication of patches by not applying\npatches to overlapping hunks (Cf.  9d15860 (apply: do not patch lines that\nwere already patched, 2011-03-04), and pass this option from \"add -p\".\n\nDo not even advertise the option, as this is a workaround; the correct fix\nought to be to make \"add -p\" correctly coalesce adjacent patch hunks.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n builtin/apply.c           |    9 ++++++---\n git-add--interactive.perl |    2 +-\n 2 files changed, 7 insertions(+), 4 deletions(-)\n\ndiff --git a/builtin/apply.c b/builtin/apply.c\nindex 04f56f8..8be1ce5 100644\n--- a/builtin/apply.c\n+++ b/builtin/apply.c\n@@ -43,6 +43,7 @@ static int apply = 1;\n static int apply_in_reverse;\n static int apply_with_reject;\n static int apply_verbosely;\n+static int allow_overlap;\n static int no_add;\n static const char *fake_ancestor;\n static int line_termination = '\\n';\n@@ -2430,9 +2431,9 @@ static void update_image(struct image *img,\n \tmemcpy(img->line + applied_pos,\n \t       postimage->line,\n \t       postimage->nr * sizeof(*img->line));\n-\tfor (i = 0; i < postimage->nr; i++)\n-\t\timg->line[applied_pos + i].flag |= LINE_PATCHED;\n-\n+\tif (!allow_overlap)\n+\t\tfor (i = 0; i < postimage->nr; i++)\n+\t\t\timg->line[applied_pos + i].flag |= LINE_PATCHED;\n \timg->nr = nr;\n }\n \n@@ -3877,6 +3878,8 @@ int cmd_apply(int argc, const char **argv, const char *prefix_)\n \t\t\t\"don't expect at least one line of context\"),\n \t\tOPT_BOOLEAN(0, \"reject\", &apply_with_reject,\n \t\t\t\"leave the rejected hunks in corresponding *.rej files\"),\n+\t\tOPT_BOOLEAN(0, \"allow-overlap\", &allow_overlap,\n+\t\t\t\"allow overlapping hunks\"),\n \t\tOPT__VERBOSE(&apply_verbosely, \"be verbose\"),\n \t\tOPT_BIT(0, \"inaccurate-eof\", &options,\n \t\t\t\"tolerate incorrectly detected missing new-line at the end of file\",\ndiff --git a/git-add--interactive.perl b/git-add--interactive.perl\nindex 6a439db..8de96d9 100755\n--- a/git-add--interactive.perl\n+++ b/git-add--interactive.perl\n@@ -705,7 +705,7 @@ sub add_untracked_cmd {\n sub run_git_apply {\n \tmy $cmd = shift;\n \tmy $fh;\n-\topen $fh, '| git ' . $cmd . \" --recount\";\n+\topen $fh, '| git ' . $cmd . \" --recount --allow-overlap\";\n \tprint $fh @_;\n \treturn close $fh;\n }\n-- \n1.7.5.rc1\n"}]}