1. 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
  2. 30 8月, 2006 1 次提交
  3. 29 8月, 2006 1 次提交
  4. 14 8月, 2006 1 次提交
  5. 08 8月, 2006 1 次提交
  6. 25 7月, 2006 1 次提交
  7. 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
  8. 15 7月, 2006 1 次提交
  9. 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
  10. 27 6月, 2006 2 次提交
  11. 02 6月, 2006 1 次提交
  12. 01 6月, 2006 1 次提交
  13. 21 5月, 2006 1 次提交
  14. 06 5月, 2006 2 次提交
  15. 04 5月, 2006 1 次提交
  16. 19 4月, 2006 1 次提交
  17. 18 4月, 2006 3 次提交
    • L
      Log message printout cleanups (#3): fix --pretty=oneline · a4d34e2d
      Linus Torvalds 提交于
      This option is very special, since pretty_print_commit() will _remove_
      the newline at the end of it, so we want to have an extra separator
      between the things.
      
      I added a honking big comment this time, so that (a) I don't forget this
      _again_ (I broke "oneline" several times during this printout cleanup),
      and so that people can understand _why_ the code does what it does.
      
      Now, arguably the alternate fix is to always have the '\n' at the end in
      pretty-print-commit, but git-rev-list depends on the current behaviour
      (but we could have git-rev-list remove it, whatever).
      
      With the big comment, the code hopefully doesn't get broken again. And now
      things like
      
      	git log --pretty=oneline --cc --patch-with-stat
      
      works (even if that is admittedly a totally insane combination: if you
      want the patch, having the "oneline" log format is just crazy, but hey,
      it _works_. Even insane people are people).
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      a4d34e2d
    • L
      Log message printout cleanups (#2) · eab144ac
      Linus Torvalds 提交于
      Here's a further patch on top of the previous one with cosmetic
      improvements (no "real" code changes, just trivial updates):
      
       - it gets the "---" before a diffstat right, including for the combined
         merge case. Righ now the logic is that we always use "---" when we have
         a diffstat, and an empty line otherwise. That's how I visually prefer
         it, but hey, it can be tweaked later.
      
       - I made "diff --cc/combined" add the "---/+++" header lines too. The
         thing won't be mistaken for a valid diff, since the "@@" lines have too
         many "@" characters (three or more), but it just makes it visually
         match a real diff, which at least to me makes a big difference in
         readability. Without them, it just looks very "wrong".
      
         I guess I should have taken the filename from each individual entry
         (and had one "---" file per parent), but I didn't even bother to try to
         see how that works, so this was the simple thing.
      
      With this, doing a
      
      	git log --cc --patch-with-stat
      
      looks quite readable, I think. The only nagging issue - as far as I'm
      concerned - is that diffstats for merges are pretty questionable the way
      they are done now. I suspect it would be better to just have the _first_
      diffstat, and always make the merge diffstat be the one for "result
      against first parent".
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      eab144ac
    • L
      Log message printout cleanups · 91539833
      Linus Torvalds 提交于
      On Sun, 16 Apr 2006, Junio C Hamano wrote:
      >
      > In the mid-term, I am hoping we can drop the generate_header()
      > callchain _and_ the custom code that formats commit log in-core,
      > found in cmd_log_wc().
      
      Ok, this was nastier than expected, just because the dependencies between
      the different log-printing stuff were absolutely _everywhere_, but here's
      a patch that does exactly that.
      
      The patch is not very easy to read, and the "--patch-with-stat" thing is
      still broken (it does not call the "show_log()" thing properly for
      merges). That's not a new bug. In the new world order it _should_ do
      something like
      
      	if (rev->logopt)
      		show_log(rev, rev->logopt, "---\n");
      
      but it doesn't. I haven't looked at the --with-stat logic, so I left it
      alone.
      
      That said, this patch removes more lines than it adds, and in particular,
      the "cmd_log_wc()" loop is now a very clean:
      
      	while ((commit = get_revision(rev)) != NULL) {
      		log_tree_commit(rev, commit);
      		free(commit->buffer);
      		commit->buffer = NULL;
      	}
      
      so it doesn't get much prettier than this. All the complexity is entirely
      hidden in log-tree.c, and any code that needs to flush the log literally
      just needs to do the "if (rev->logopt) show_log(...)" incantation.
      
      I had to make the combined_diff() logic take a "struct rev_info" instead
      of just a "struct diff_options", but that part is pretty clean.
      
      This does change "git whatchanged" from using "diff-tree" as the commit
      descriptor to "commit", and I changed one of the tests to reflect that new
      reality. Otherwise everything still passes, and my other tests look fine
      too.
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      91539833
  18. 17 4月, 2006 1 次提交
  19. 16 4月, 2006 2 次提交
    • J
      log/whatchanged/show - log formatting cleanup. · cb8f64b4
      Junio C Hamano 提交于
      This moves the decision to print the log message, while diff
      options are in effect, to log-tree.  It gives behaviour closer
      to the traditional one.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      cb8f64b4
    • L
      Tentative built-in "git show" · c5ccd8be
      Linus Torvalds 提交于
      This uses the "--no-walk" flag that I never actually implemented (but I'm
      sure I mentioned it) to make "git show" be essentially the same thing as
      "git whatchanged --no-walk".
      
      It just refuses to add more interesting parents to the revision walking
      history, so you don't actually get any history, you just get the commit
      you asked for.
      
      I was going to add "--no-walk" as a real argument flag to git-rev-list
      too, but I'm not sure anybody actually needs it. Although it might be
      useful for porcelain, so I left the door open.
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      c5ccd8be
  20. 15 4月, 2006 3 次提交
    • J
      Extract "log [diff options]" parser out. · f4235f8b
      Junio C Hamano 提交于
      Merging of the log-tree-opt structure with rev-info structure
      did not work out very well and it broke things that did not want
      diff options and/or rev options.
      
      This is an alternative approach to define a combined interface
      that can be used by commands that wants both.  The use of it is
      opt-in to reduce the risk of breaking existing programs.
      
      We might want to slurp "setup_revisions() places things in
      pending objects list" part from Linus's earlier attempt.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      f4235f8b
    • J
      Revert all the rev-list option parsing changes. · 183df639
      Junio C Hamano 提交于
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      183df639
    • L
      Common option parsing for "git log --diff" and friends · cd2bdc53
      Linus Torvalds 提交于
      This basically does a few things that are sadly somewhat interdependent,
      and nontrivial to split out
      
       - get rid of "struct log_tree_opt"
      
         The fields in "log_tree_opt" are moved into "struct rev_info", and all
         users of log_tree_opt are changed to use the rev_info struct instead.
      
       - add the parsing for the log_tree_opt arguments to "setup_revision()"
      
       - make setup_revision set a flag (revs->diff) if the diff-related
         arguments were used. This allows "git log" to decide whether it wants
         to show diffs or not.
      
       - make setup_revision() also initialize the diffopt part of rev_info
         (which we had from before, but we just didn't initialize it)
      
       - make setup_revision() do all the "finishing touches" on it all (it will
         do the proper flag combination logic, and call "diff_setup_done()")
      
      Now, that was the easy and straightforward part.
      
      The slightly more involved part is that some of the programs that want to
      use the new-and-improved rev_info parsing don't actually want _commits_,
      they may want tree'ish arguments instead. That meant that I had to change
      setup_revision() to parse the arguments not into the "revs->commits" list,
      but into the "revs->pending_objects" list.
      
      Then, when we do "prepare_revision_walk()", we walk that list, and create
      the sorted commit list from there.
      
      This actually cleaned some stuff up, but it's the less obvious part of the
      patch, and re-organized the "revision.c" logic somewhat. It actually paves
      the way for splitting argument parsing _entirely_ out of "revision.c",
      since now the argument parsing really is totally independent of the commit
      walking: that didn't use to be true, since there was lots of overlap with
      get_commit_reference() handling etc, now the _only_ overlap is the shared
      (and trivial) "add_pending_object()" thing.
      
      However, I didn't do that file split, just because I wanted the diff
      itself to be smaller, and show the actual changes more clearly. If this
      gets accepted, I'll do further cleanups then - that includes the file
      split, but also using the new infrastructure to do a nicer "git diff" etc.
      
      Even in this form, it actually ends up removing more lines than it adds.
      
      It's nice to note how simple and straightforward this makes the built-in
      "git log" command, even though it continues to support all the diff flags
      too. It doesn't get much simpler that this.
      
      I think this is worth merging soonish, because it does allow for future
      cleanup and even more sharing of code. However, it obviously touches
      "revision.c", which is subtle. I've tested that it passes all the tests we
      have, and it passes my "looks sane" detector, but somebody else should
      also give it a good look-over.
      
      [jc: squashed the original and three "oops this too" updates, with
       another fix-up.]
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      cd2bdc53
  21. 09 4月, 2006 1 次提交
    • J
      log-tree: separate major part of diff-tree. · 5f1c3f07
      Junio C Hamano 提交于
      This separates out the part that deals with one-commit diff-tree
      (and --stdin form) into a separate log-tree module.
      
      There are two goals with this.  The more important one is to be
      able to make this part available to "git log --diff", so that we
      can have a native "git whatchanged" command.  Another is to
      simplify the commit log generation part simpler.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      5f1c3f07