Skip to content
Snippets Groups Projects
  1. Mar 22, 2018
  2. Feb 27, 2018
    • Junio C Hamano's avatar
      Merge branch 'ys/bisect-object-id-missing-conversion-fix' into maint · 38e79b1f
      Junio C Hamano authored
      Fix for a commented-out code to adjust it to a rather old API change.
      
      * ys/bisect-object-id-missing-conversion-fix:
        bisect: debug: convert struct object to object_id
      38e79b1f
    • Junio C Hamano's avatar
      Merge branch 'sb/submodule-update-reset-fix' into maint · 14890e91
      Junio C Hamano authored
      When resetting the working tree files recursively, the working tree
      of submodules are now also reset to match.
      
      * sb/submodule-update-reset-fix:
        submodule: submodule_move_head omits old argument in forced case
        unpack-trees: oneway_merge to update submodules
        t/lib-submodule-update.sh: fix test ignoring ignored files in submodules
        t/lib-submodule-update.sh: clarify test
      14890e91
    • Junio C Hamano's avatar
      Merge branch 'ab/commit-m-with-fixup' into maint · c1ab3b8a
      Junio C Hamano authored
      "git commit --fixup" did not allow "-m<message>" option to be used
      at the same time; allow it to annotate resulting commit with more
      text.
      
      * ab/commit-m-with-fixup:
        commit: add support for --fixup <commit> -m"<extra message>"
        commit doc: document that -c, -C, -F and --fixup with -m error
      c1ab3b8a
    • Junio C Hamano's avatar
      Merge branch 'nd/ita-wt-renames-in-status' into maint · 12accdc0
      Junio C Hamano authored
      "git status" after moving a path in the working tree (hence making
      it appear "removed") and then adding with the -N option (hence
      making that appear "added") detected it as a rename, but did not
      report the  old and new pathnames correctly.
      
      * nd/ita-wt-renames-in-status:
        wt-status.c: handle worktree renames
        wt-status.c: rename rename-related fields in wt_status_change_data
        wt-status.c: catch unhandled diff status codes
        wt-status.c: coding style fix
        Use DIFF_DETECT_RENAME for detect_rename assignments
        t2203: test status output with porcelain v2 format
      12accdc0
  3. Feb 15, 2018
  4. Feb 08, 2018
    • SZEDER Gábor's avatar
      t: make 'test_i18ngrep' more informative on failure · 63b1a175
      SZEDER Gábor authored
      
      When 'test_i18ngrep' can't find the expected pattern, it exits
      completely silently; when its negated form does find the pattern that
      shouldn't be there, it prints the matching line(s) but otherwise exits
      without any error message.  This leaves the developer puzzled about
      what could have gone wrong.
      
      Make 'test_i18ngrep' more informative on failure by printing an error
      message including the invoked 'grep' command and the contents of the
      file it had to scan through.
      
      Note that this "dump the scanned file" part is not quite perfect, as
      it dumps only the file specified as the function's last positional
      parameter, thus assuming that there is only a single file parameter.
      I think that's a reasonable assumption to make, one that holds true in
      the current code base.  And even if someone were to scan multiple
      files at once in the future, the worst thing that could happen is that
      the verbose error message won't include the contents of all those
      files, only the last one.  Alas, we can't really do any better than
      this, because checking whether the other positional parameters match a
      filename can result in false positives: 't3400-rebase.sh' and
      't3404-rebase-interactive.sh' contain one test each, where the
      'test_i18ngrep's pattern verbatimly matches a file in the trash
      directory.
      
      Signed-off-by: default avatarSZEDER Gábor <szeder.dev@gmail.com>
      Reviewed-by: default avatarJeff King <peff@peff.net>
      Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
      63b1a175
    • SZEDER Gábor's avatar
      t: validate 'test_i18ngrep's parameters · fd29d7b9
      SZEDER Gábor authored
      
      Some of the previous patches in this series fixed bogus
      'test_i18ngrep' invocations:
      
        - Two invocations where the tested git command's standard output is
          directly piped into 'test_i18ngrep'.  While convenient, this is an
          antipattern, because the pipe hides the git command's exit code,
          and the test could continue even if the command exited with error.
      
        - Two invocations that had neither a filename parameter nor anything
          piped into their standard input, yet both managed to remain
          unnoticed for years.  A third similarly bogus invocation is
          currently lurking in 'pu' for a couple of weeks now.
      
      Prevent similar mistakes in the future by validating 'test_i18ngrep's
      parameters requiring that
      
        - The last parameter names an existing file to be read, effectively
          forbidding piping into 'test_i18ngrep'.
      
          Note that this change will also forbid cases where 'test_i18ngrep'
          would legitimately read its standard input, e.g. when its standard
          input is redirected from a file, or when a git command's standard
          output is first written to an intermediate file, which is then
          preprocessed by a non-git command before the results are piped
          into 'test_i18ngrep'.  See two of the previous patches for the
          only such cases we had in our test suite.  However, reliably
          preventing the piping antipattern is arguably more important than
          supporting these cases, which can be easily worked around by
          opening the file directly or using an intermediate file anyway.
      
        - There are at least two parameters, not including the optional '!'
          to negate the pattern.  This ought to catch corner cases when
          'test_i18ngrep' looks for the name of an existing file on its
          standard input; the above check would miss this case becase the
          filename as pattern would be the last parameter.
      
          Note that this is not quite perfect, as it doesn't account for any
          'grep --options' given as parameters.  However, doing so would be
          far too complicated, considering that patterns can start with
          dashes as well, and in the majority of the cases we don't use any
          such options anyway.
      
      Signed-off-by: default avatarSZEDER Gábor <szeder.dev@gmail.com>
      Reviewed-by: default avatarJeff King <peff@peff.net>
      Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
      fd29d7b9
    • SZEDER Gábor's avatar
      t: move 'test_i18ncmp' and 'test_i18ngrep' to 'test-lib-functions.sh' · 0f59128f
      SZEDER Gábor authored
      
      Both 'test_i18ncmp' and 'test_i18ngrep' helper functions are supposed
      to be called from our test scripts, so they should be in
      'test-lib-functions.sh'.
      
      Signed-off-by: default avatarSZEDER Gábor <szeder.dev@gmail.com>
      Reviewed-by: default avatarJeff King <peff@peff.net>
      Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
      0f59128f
    • SZEDER Gábor's avatar
      t5536: let 'test_i18ngrep' read the file without redirection · 93b4b031
      SZEDER Gábor authored
      
      Redirecting 'test_i18ngrep's standard input from a file will interfere
      with the linting that will be added in a later patch.
      
      Signed-off-by: default avatarSZEDER Gábor <szeder.dev@gmail.com>
      Reviewed-by: default avatarJeff King <peff@peff.net>
      Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
      93b4b031
    • SZEDER Gábor's avatar
      t5510: consolidate 'grep' and 'test_i18ngrep' patterns · 927c1a64
      SZEDER Gábor authored
      
      One of the tests in 't5510-fetch.sh' checks the output of 'git fetch'
      using 'test_i18ngrep', and while doing so it prefilters the output
      with 'grep' before piping the result into 'test_i18ngrep'.
      
      This prefiltering is unnecessary, with the appropriate pattern
      'test_i18ngrep' can do it all by itself.  Furthermore, piping data
      into 'test_i18ngrep' will interfere with the linting that will be
      added in a later patch.
      
      Signed-off-by: default avatarSZEDER Gábor <szeder.dev@gmail.com>
      Reviewed-by: default avatarJeff King <peff@peff.net>
      Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
      927c1a64
    • SZEDER Gábor's avatar
      t4001: don't run 'git status' upstream of a pipe · 3b85ec34
      SZEDER Gábor authored
      
      The primary purpose of three tests in 't4001-diff-rename.sh' is to
      check rename detection in 'git status', but all three do so by running
      'git status' upstream of a pipe, hiding its exit code.  Consequently,
      the test could continue even if 'git status' exited with error.
      
      Use an intermediate file between 'git status' and 'test_i18ngrep' to
      catch a potential failure of the former.
      
      Signed-off-by: default avatarSZEDER Gábor <szeder.dev@gmail.com>
      Reviewed-by: default avatarJeff King <peff@peff.net>
      Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
      3b85ec34
Loading