Skip to content
Snippets Groups Projects
  1. Apr 02, 2018
  2. Apr 01, 2018
    • Ævar Arnfjörð Bjarmason's avatar
      add -p: fix 2.17.0-rc* regression due to moved code · fd2fb4aa
      Ævar Arnfjörð Bjarmason authored
      
      Fix a regression in 88f6ffc1 ("add -p: only bind search key if
      there's more than one hunk", 2018-02-13) which is present in
      2.17.0-rc*, but not 2.16.0.
      
      In Perl, regex variables like $1 always refer to the last regex
      match. When the aforementioned change added a new regex match between
      the old match and the corresponding code that was expecting $1, the $1
      variable would always be undef, since the newly inserted regex match
      doesn't have any captures.
      
      As a result the "/" feature to search for a string in a hunk by regex
      completely broke, on git.git:
      
          $ perl -pi -e 's/Git/Tig/g' README.md
          $ ./git --exec-path=$PWD add -p
          [..]
          Stage this hunk [y,n,q,a,d,j,J,g,/,s,e,?]? s
          Split into 4 hunks.
          [...]
          Stage this hunk [y,n,q,a,d,j,J,g,/,s,e,?]? /Many
          Use of uninitialized value $1 in string eq at /home/avar/g/git/git-add--interactive line 1568, <STDIN> line 1.
          search for regex? Many
      
      I.e. the initial "/regex" command wouldn't work, and would always emit
      a warning and ask again for a regex, now it works as intended again.
      
      Signed-off-by: default avatarÆvar Arnfjörð Bjarmason <avarab@gmail.com>
      Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
      fd2fb4aa
  3. Mar 31, 2018
  4. Mar 29, 2018
  5. Mar 28, 2018
  6. Mar 25, 2018
  7. Mar 23, 2018
  8. Mar 22, 2018
Loading