1. 10 4月, 2008 1 次提交
    • J
      log: teach "terminator" vs "separator" mode to "--pretty=format" · 4da45bef
      Junio C Hamano 提交于
      This attached patch introduces a single bit "use_terminator" in "struct
      rev_info", which is normally false (i.e. most formats use separator
      semantics) but by flipping it to true, you can ask for terminator
      semantics just like oneline format does.
      
      The function get_commit_format(), which is what parses "--pretty=" option,
      now takes a pointer to "struct rev_info" and updates its commit_format and
      use_terminator fields.  It used to return the value of type "enum
      cmit_fmt", but all the callers assigned it to rev->commit_format.
      
      There are only two cases the code turns use_terminator on.  Obviously, the
      traditional oneline format (--pretty=oneline) is one of them, and the new
      case is --pretty=tformat:... that acts like --pretty=format:... but flips
      the bit on.
      
      With this, "--pretty=tformat:%H %s" acts like --pretty=oneline.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      4da45bef
  2. 23 3月, 2008 1 次提交
  3. 15 3月, 2008 1 次提交
    • J
      format-patch: generate MIME header as needed even when there is format.header · 6bf4f1b4
      Junio C Hamano 提交于
      Earlier, the callchain from pretty_print_commit() down to pp_title_line()
      had an unwarranted assumption that the presense of "after_subject"
      parameter, means the caller has already output MIME headers for
      attachments.  The parameter's primary purpose is to give extra header
      lines the caller wants to place after pp_title_line() generates the
      "Subject: " line.
      
      This assumption does not hold when the user used the format.header
      configuration variable to pass extra headers, and caused a message with
      non-ASCII character to lack proper MIME headers (e.g.  8-bit CTE header).
      The earlier logic also failed to suppress duplicated MIME headers when
      "format-patch -s --attach" is asked for and the signer's name demanded
      8-bit clean transport.
      
      This patch fixes the logic by introducing a separate need_8bit_cte
      parameter passed down the callchain.  This can have one of these values:
      
       -1 : we've already done MIME crap and we do not want to add extra header
            to say this is 8bit in pp_title_line();
      
        0 : we haven't done MIME and we have not seen anything that is 8bit yet;
      
        1 : we haven't done MIME and we have seen something that is 8bit;
            pp_title_line() must add MIME header.
      
      It adds two tests by Jeff King who independently diagnosed this issue.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      6bf4f1b4
  4. 19 2月, 2008 1 次提交
  5. 14 2月, 2008 1 次提交
    • L
      Add "--show-all" revision walker flag for debugging · 3131b713
      Linus Torvalds 提交于
      It's really not very easy to visualize the commit walker, because - on
      purpose - it obvously doesn't show the uninteresting commits!
      
      This adds a "--show-all" flag to the revision walker, which will make
      it show uninteresting commits too, and they'll have a '^' in front of
      them (it also fixes a logic error for !verbose_header for boundary
      commits - we should show the '-' even if left_right isn't shown).
      
      A separate patch to gitk to teach it the new '^' was sent
      to paulus.  With the change in place, it actually is interesting
      even for the cases that git doesn't have any problems with, ie
      for the kernel you can do:
      
      	gitk -d --show-all v2.6.24..
      
      and you see just how far down it has to parse things to see it all. The
      use of "-d" is a good idea, since the date-ordered toposort is much better
      at showing why it goes deep down (ie the date of some of those commits
      after 2.6.24 is much older, because they were merged from trees that
      weren't rebased).
      
      So I think this is a useful feature even for non-debugging - just to
      visualize what git does internally more.
      
      When it actually breaks out due to the "everybody_uninteresting()"
      case, it adds the uninteresting commits (both the one it's looking at
      now, and the list of pending ones) to the list
      
      This way, we really list *all* the commits we've looked at.
      
      Because we now end up listing commits we may not even have been parsed
      at all "show_log" and "show_commit" need to protect against commits
      that don't have a commit buffer entry.
      
      That second part is debatable just how it should work. Maybe we shouldn't
      show such entries at all (with this patch those entries do get shown, they
      just don't get any message shown with them). But I think this is a useful
      case.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      3131b713
  6. 12 11月, 2007 1 次提交
  7. 08 11月, 2007 1 次提交
    • J
      format-patch -s: add MIME encoding header if signer's name requires so · acef41c9
      Junio C Hamano 提交于
      When the body of the commit log message contains a non-ASCII character,
      format-patch correctly emitted the encoding header to mark the resulting
      message as such.  However, if the original message was fully ASCII, the
      command line switch "-s" was given to add a new sign-off, and
      the signer's name was not ASCII only, the resulting message would have
      contained non-ASCII character but was not marked as such.
      
      This was cherry-picked from the fix in 'master'
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      acef41c9
  8. 02 11月, 2007 1 次提交
    • J
      format-patch -s: add MIME encoding header if signer's name requires so · 4593fb84
      Junio C Hamano 提交于
      When the body of the commit log message contains a non-ASCII character,
      format-patch correctly emitted the encoding header to mark the resulting
      message as such.  However, if the original message was fully ASCII, the
      command line switch "-s" was given to add a new sign-off, and
      the signer's name was not ASCII only, the resulting message would have
      contained non-ASCII character but was not marked as such.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      4593fb84
  9. 27 10月, 2007 1 次提交
  10. 16 10月, 2007 1 次提交
  11. 26 9月, 2007 1 次提交
  12. 11 9月, 2007 1 次提交
  13. 14 8月, 2007 1 次提交
  14. 05 7月, 2007 1 次提交
  15. 01 7月, 2007 1 次提交
    • T
      Don't fflush(stdout) when it's not helpful · 06f59e9f
      Theodore Ts'o 提交于
      This patch arose from a discussion started by Jim Meyering's patch
      whose intention was to provide better diagnostics for failed writes.
      Linus proposed a better way to do things, which also had the added
      benefit that adding a fflush() to git-log-* operations and incremental
      git-blame operations could improve interactive respose time feel, at
      the cost of making things a bit slower when we aren't piping the
      output to a downstream program.
      
      This patch skips the fflush() calls when stdout is a regular file, or
      if the environment variable GIT_FLUSH is set to "0".  This latter can
      speed up a command such as:
      
      GIT_FLUSH=0 strace -c -f -e write time git-rev-list HEAD | wc -l
      
      a tiny amount.
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      Acked-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      06f59e9f
  16. 13 6月, 2007 1 次提交
    • J
      Lift 16kB limit of log message output · 80583c0e
      Junio C Hamano 提交于
      Traditionally we had 16kB limit when formatting log messages for
      output, because it was easier to arrange for the caller to have
      a reasonably big buffer and pass it down without ever worrying
      about reallocating.
      
      This changes the calling convention of pretty_print_commit() to
      lift this limit.  Instead of the buffer and remaining length, it
      now takes a pointer to the pointer that points at the allocated
      buffer, and another pointer to the location that stores the
      allocated length, and reallocates the buffer as necessary.
      
      To support the user format, the error return of interpolate()
      needed to be changed.  It used to return a bool telling "Ok the
      result fits", or "Sorry, I had to truncate it".  Now it returns
      0 on success, and returns the size of the buffer it wants in
      order to fit the whole result.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      80583c0e
  17. 06 5月, 2007 1 次提交
  18. 26 4月, 2007 1 次提交
    • J
      Add --date={local,relative,default} · a7b02ccf
      Junio C Hamano 提交于
      This adds --date={local,relative,default} option to log family of commands,
      to allow displaying timestamps in user's local timezone, relative time, or
      the default format.
      
      Existing --relative-date option is a synonym of --date=relative; we could
      probably deprecate it in the long run.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      a7b02ccf
  19. 17 4月, 2007 1 次提交
  20. 12 4月, 2007 1 次提交
  21. 05 3月, 2007 2 次提交
  22. 23 2月, 2007 1 次提交
    • J
      pretty-formats: add 'format:<string>' · e52a5de4
      Johannes Schindelin 提交于
      With this patch,
      
      $ git show -s \
      	--pretty=format:'  Ze komit %h woss%n  dunn buy ze great %an'
      
      shows something like
      
        Ze komit 04c5c88 woss
        dunn buy ze great Junio C Hamano
      
      The supported placeholders are:
      
      	'%H': commit hash
      	'%h': abbreviated commit hash
      	'%T': tree hash
      	'%t': abbreviated tree hash
      	'%P': parent hashes
      	'%p': abbreviated parent hashes
      	'%an': author name
      	'%ae': author email
      	'%ad': author date
      	'%aD': author date, RFC2822 style
      	'%ar': author date, relative
      	'%at': author date, UNIX timestamp
      	'%cn': committer name
      	'%ce': committer email
      	'%cd': committer date
      	'%cD': committer date, RFC2822 style
      	'%cr': committer date, relative
      	'%ct': committer date, UNIX timestamp
      	'%e': encoding
      	'%s': subject
      	'%b': body
      	'%Cred': switch color to red
      	'%Cgreen': switch color to green
      	'%Cblue': switch color to blue
      	'%Creset': reset color
      	'%n': newline
      Signed-off-by: NJohannes Schindelin <johannes.schindelin@gmx.de>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      e52a5de4
  23. 09 2月, 2007 2 次提交
  24. 08 2月, 2007 1 次提交
    • L
      Fix "git log -z" behaviour · abd4e222
      Linus Torvalds 提交于
      For commit messages, we should really put the "line_termination" when we
      output the character in between different commits, *not* between the
      commit and the diff. The diff goes hand-in-hand with the commit, it
      shouldn't be separated from it with the termination character.
      
      So this:
       - uses the termination character for true inter-commit spacing
       - uses a regular newline between the commit log and the diff
      
      We had it the other way around.
      
      For the normal case where the termination character is '\n', this
      obviously doesn't change anything at all, since we just switched two
      identical characters around. So it's very safe - it doesn't change any
      normal usage, but it definitely fixes "git log -z".
      
      By fixing "git log -z", you can now also do insane things like
      
      	git log -p -z |
      		grep -z "some patch expression" |
      		tr '\0' '\n' |
      		less -S
      
      and you will see only those commits that have the "some patch expression"
      in their commit message _or_ their patches.
      
      (This is slightly different from 'git log -S"some patch expression"',
      since the latter requires the expression to literally *change* in the
      patch, while the "git log -p -z | grep .." approach will see it if it's
      just an unchanged _part_ of the patch context)
      
      Of course, if you actually do something like the above, you're probably
      insane, but hey, it works!
      
      Try the above command line for a demonstration (of course, you need to
      change the "some patch expression" to be something relevant). The old
      behaviour of "git log -p -z" was useless (and got things completely wrong
      for log entries without patches).
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      abd4e222
  25. 28 1月, 2007 1 次提交
  26. 21 1月, 2007 2 次提交
  27. 18 12月, 2006 1 次提交
  28. 27 10月, 2006 1 次提交
    • R
      Make git-cherry handle root trees · 2b60356d
      Rene Scharfe 提交于
      This patch on top of 'next' makes built-in git-cherry handle root
      commits.
      
      It moves the static function log-tree.c::diff_root_tree() to
      tree-diff.c and makes it more similar to diff_tree_sha1() by
      shuffling around arguments and factoring out the call to
      log_tree_diff_flush().  Consequently the name is changed to
      diff_root_tree_sha1().  It is a version of diff_tree_sha1() that
      compares the empty tree (= root tree) against a single 'real' tree.
      
      This function is then used in get_patch_id() to compute patch IDs
      for initial commits instead of SEGFAULTing, as the current code
      does if confronted with parentless commits.
      Signed-off-by: NRene Scharfe <rene.scharfe@lsrfire.ath.cx>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      2b60356d
  29. 30 8月, 2006 1 次提交
  30. 29 8月, 2006 1 次提交
  31. 14 8月, 2006 1 次提交
  32. 08 8月, 2006 1 次提交
  33. 25 7月, 2006 1 次提交
  34. 24 7月, 2006 1 次提交
    • J
      Colorize 'commit' lines in log ui · ce436973
      Jeff King 提交于
      When paging through the output of git-whatchanged, the color cues help to
      visually navigate within a diff. However, it is difficult to notice when a
      new commit starts, because the commit and log are shown in the "normal"
      color. This patch colorizes the 'commit' line, customizable through
      diff.colors.commit and defaulting to yellow.
      
      As a side effect, some of the diff color engine (slot enum, get_color) has
      become accessible outside of diff.c.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      ce436973
  35. 15 7月, 2006 1 次提交
  36. 28 6月, 2006 1 次提交
    • J
      Fix some more diff options changes. · 3969cf7d
      Junio C Hamano 提交于
      This fixes various problems in the new diff options code.
      
       - Fix --cc/-c --patch; it showed two-tree diff used internally.
      
       - Use "---\n" only where it matters -- that is, use it
         immediately after the commit log text when we show a
         commit log and something else before the patch text.
      
       - Do not output spurious extra "\n"; have an extra newline
         after the commit log text always when we have diff output and
         we are not doing oneline.
      
       - When running a pickaxe you need to go recursive.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      3969cf7d
  37. 27 6月, 2006 1 次提交