Commits on Aug 18, 2009
  1. git-log: allow --decorate[=short|full]

    hjemli authored and gitster committed Aug 15, 2009
    Commit de435ac changed the behavior of --decorate from printing the
    full ref (e.g., "refs/heads/master") to a shorter, more human-readable
    version (e.g., just "master"). While this is nice for human readers,
    external tools using the output from "git log" may prefer the full
    This patch introduces an extension to --decorate to allow the caller to
    specify either the short or the full versions.
    Signed-off-by: Lars Hjemli <>
    Acked-by: Jeff King <>
    Signed-off-by: Junio C Hamano <>
Commits on Mar 23, 2009
  1. format-patch: --attach/inline uses filename instead of SHA1

    bebarino authored and gitster committed Mar 23, 2009
    Currently when format-patch is used with --attach or --inline the patch
    attachment has the SHA1 of the commit for its filename.  This replaces
    the SHA1 with the filename used by format-patch when outputting to
    Fix tests relying on the SHA1 output and add a test showing how the
    --suffix option affects the attachment filename output.
    Signed-off-by: Stephen Boyd <>
    Signed-off-by: Junio C Hamano <>
  2. format-patch: move get_patch_filename() into log-tree

    bebarino authored and gitster committed Mar 23, 2009
    Signed-off-by: Stephen Boyd <>
    Signed-off-by: Junio C Hamano <>
Commits on Nov 4, 2008
  1. Add a 'source' decorator for commits

    torvalds authored and gitster committed Oct 27, 2008
    We already support decorating commits by tags or branches that point to
    them, but especially when we are looking at multiple branches together,
    we sometimes want to see _how_ we reached a particular commit.
    We can abuse the '->util' field in the commit to keep track of that as
    we walk the commit lists, and get a reasonably useful view into which
    branch or tag first reaches that commit.
    Of course, if the commit is reachable through multiple sources (which is
    common), our particular choice of "first" reachable is entirely random
    and depends on the particular path we happened to follow.
    Signed-off-by: Linus Torvalds <>
    Signed-off-by: Junio C Hamano <>
Commits on Sep 5, 2008
  1. move load_ref_decorations() to log-tree.c and export it

    René Scharfe authored and gitster committed Sep 4, 2008
    log-tree.c is the ideal place for load_ref_decorations() and its
    helper functions to live in, because the variable name_decoration
    they're operating on is already located there, so move them thither.
    Signed-off-by: Rene Scharfe <>
    Signed-off-by: Junio C Hamano <>
Commits on May 3, 2008
  1. Remove dead code: show_log() sep argument and diff_options.msg_sep

    simpkins authored and gitster committed Apr 29, 2008
    These variables were made unnecessary by commit
    Signed-off-by: Adam Simpkins <>
    Signed-off-by: Junio C Hamano <>
Commits on Mar 15, 2008
  1. Merge branch 'maint'

    gitster committed Mar 15, 2008
    * maint:
      format-patch: generate MIME header as needed even when there is format.header
Commits on Feb 19, 2008
  1. Export some email and pretty-printing functions

    Daniel Barkalow authored and gitster committed Feb 19, 2008
    These will be used for generating the cover letter in addition to the
    patch emails.
    Signed-off-by: Daniel Barkalow <>
    Signed-off-by: Junio C Hamano <>
Commits on Oct 27, 2007
  1. rev-list: implement --bisect-all

    chriscool authored and gitster committed Oct 22, 2007
    This is Junio's patch with some stuff to make --bisect-all
    compatible with --bisect-vars.
    This option makes it possible to see all the potential
    bisection points. The best ones are displayed first.
    Signed-off-by: Christian Couder <>
    Signed-off-by: Shawn O. Pearce <>
Commits on Jun 26, 2006
  1. Add msg_sep to diff_options

    tihirvon authored and Junio C Hamano committed Jun 25, 2006
    Add msg_sep variable to struct diff_options.  msg_sep is printed after
    commit message.  Default is "\n", format-patch sets it to "---\n".
    This also removes the second argument from show_log() because all
    callers derived it from the first argument:
        show_log(rev, rev->loginfo, ...
    Signed-off-by: Timo Hirvonen <>
    Signed-off-by: Junio C Hamano <>
Commits on Apr 17, 2006
  1. Log message printout cleanups

    Linus Torvalds Junio C Hamano
    Linus Torvalds authored and Junio C Hamano committed Apr 17, 2006
    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
    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);
    		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
    Signed-off-by: Linus Torvalds <>
    Signed-off-by: Junio C Hamano <>
Commits on Apr 15, 2006
  1. Common option parsing for "git log --diff" and friends

    Linus Torvalds Junio C Hamano
    Linus Torvalds authored and Junio C Hamano committed Apr 14, 2006
    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: Linus Torvalds <>
    Signed-off-by: Junio C Hamano <>
Commits on Apr 9, 2006
  1. log-tree: separate major part of diff-tree.

    Junio C Hamano
    Junio C Hamano committed Apr 9, 2006
    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: Junio C Hamano <>