1. 15 4月, 2010 1 次提交
    • J
      am -3: recover the diagnostic messages for corrupt patches · 0ba17dd0
      Junio C Hamano 提交于
      "git am -3" first tries to apply the patch without any extra trick, and
      applies it to a synthesized tree for 3-way merge after the first attempt
      fails.  "git apply" exits with status 1 for a patch that is well-formed
      but is not applicable (and it dies on other errors with non-zereo, non-1
      status) and has an optimization to fall back to the 3-way merge only in
      the case.
      
      An earlier patch 3ddd1703 (am: suppress apply errors when using 3-way,
      2009-06-16) squelched diagnostic messages from the first attempt, not to
      be shown to the end user.  This worked reasonably well if the reason the
      first application failed was because the patch was made against a wrong
      version.
      
      When the patch is corrupt (e.g. line-wrapped or leading whitespaces got
      dropped), however, because the second patch application is not even
      attempted, the error message from the first application is never shown
      and is forever lost.  This message is necessary to locate where the patch
      is corrupt and fix it up.
      
      We could fix this issue by reverting 3dd170, or keeping the error message
      to somewhere and showing it, but because this is an error codepath, the
      easiest is to disable the optimization.  The second patch application is
      attempted even when the input is corrupt, and it will notice, diagnose,
      and stop with an error message.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      0ba17dd0
  2. 13 3月, 2010 2 次提交
  3. 01 3月, 2010 2 次提交
  4. 24 2月, 2010 1 次提交
  5. 15 2月, 2010 1 次提交
    • J
      am: Fix launching of pager · f6dff119
      Jonathan Nieder 提交于
      The pagination functionality in git am has some problems:
      
       - It does not check if stdout is a tty, so it always paginates.
      
       - If $GIT_PAGER uses any environment variables, they are being
         ignored, since it does not run $GIT_PAGER through eval.
      
       - If $GIT_PAGER is set to the empty string, instead of passing
         output through to stdout, it tries to run $dotest/patch.
      
      Fix them.  While at it, move the definition of git_pager() to
      git-sh-setup so authors of other commands are not tempted to
      reimplement it with the same mistakes.
      Signed-off-by: NJonathan Nieder <jrnieder@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      f6dff119
  6. 12 2月, 2010 1 次提交
  7. 26 1月, 2010 1 次提交
  8. 04 12月, 2009 1 次提交
  9. 28 11月, 2009 1 次提交
    • J
      Remove dead code from "git am" · c970a6fd
      Junio C Hamano 提交于
      Ever since the initial implementation, "git am" had kept a dead code that
      never triggered due to a typo in the variable name.  Worse yet, the code,
      if it weren't for the typo, would have attempted to add "[PATCH] " at the
      beginning of the Subject: header when "git am" is run with its "-k"
      option.  However, because "git am -k" tells mailinfo to keep such prefix
      when parsing the input, the "[PATCH] " added by this dead code would have
      really been unnecessary duplicate.
      
      Embarrassing is that we kept _maintaining_ the codepath without anybody
      noticing for four years.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      c970a6fd
  10. 24 11月, 2009 1 次提交
    • J
      Protect scripted Porcelains from GREP_OPTIONS insanity · e1622bfc
      Junio C Hamano 提交于
      If the user has exported the GREP_OPTIONS environment variable, the output
      from "grep" and "egrep" in scripted Porcelains may be different from what
      they expect.  For example, we may want to count number of matching lines,
      by "grep" piped to "wc -l", and GREP_OPTIONS=-C3 will break such use.
      
      The approach taken by this change to address this issue is to protect only
      our own use of grep/egrep.  Because we do not unset it at the beginning of
      our scripts, hook scripts run from the scripted Porcelains are exposed to
      the same insanity this environment variable causes when grep/egrep is used
      to implement logic (e.g. "grep | wc -l"), and it is entirely up to the
      hook scripts to protect themselves.
      
      On the other hand, applypatch-msg hook may want to show offending words in
      the proposed commit log message using grep to the end user, and the user
      might want to set GREP_OPTIONS=--color to paint the match more visibly.
      The approach to protect only our own use without unsetting the environment
      variable globally will allow this use case.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      e1622bfc
  11. 21 11月, 2009 1 次提交
  12. 14 11月, 2009 1 次提交
  13. 26 9月, 2009 2 次提交
  14. 27 8月, 2009 1 次提交
  15. 11 8月, 2009 2 次提交
  16. 07 8月, 2009 2 次提交
  17. 06 8月, 2009 2 次提交
  18. 19 6月, 2009 2 次提交
  19. 14 6月, 2009 1 次提交
  20. 29 5月, 2009 3 次提交
  21. 10 5月, 2009 1 次提交
  22. 19 4月, 2009 1 次提交
  23. 13 4月, 2009 1 次提交
  24. 27 2月, 2009 2 次提交
  25. 29 1月, 2009 1 次提交
    • J
      git-am: minor cleanups · 98ef23b3
      Jay Soffian 提交于
      Update usage statement to remove a no-longer supported option, and to hide two
      options (one a no-op, one internal) unless --help-all is used.
      
      Use "test -t 0" instead of "tty -s" to detect when stdin is a terminal. (test
      -t 0 is used elsewhere in git-am and in other git shell scripts, tty -s is
      not, and appears to be deprecated by POSIX)
      
      Use "test ..." instead of "[ ... ]" and "die <msg>" instead of "echo <msg>
      >&2; exit 1" to be consistent with rest of script.
      Signed-off-by: NJay Soffian <jaysoffian@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      98ef23b3
  26. 26 1月, 2009 2 次提交
  27. 24 1月, 2009 1 次提交
  28. 19 1月, 2009 1 次提交
  29. 18 1月, 2009 1 次提交