Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Commits on Oct 20, 2009
  1. @trast @gitster

    Introduce new pretty formats %g[sdD] for reflog information

    trast authored gitster committed
    Add three new --pretty=format escapes:
      %gD  long  reflog descriptor (e.g. refs/stash@{0})
      %gd  short reflog descriptor (e.g. stash@{0})
      %gs  reflog message
    This is achieved by passing down the reflog info, if any, inside the
    pretty_print_context struct.
    We use the newly refactored get_reflog_selector(), and give it some
    extra functionality to extract a shortened ref.  The shortening is
    cached inside the commit_reflogs struct; the only allocation of it
    happens in read_complete_reflog(), where it is initialised to 0.  Also
    add another helper get_reflog_message() for the message extraction.
    Note that the --format="%h %gD: %gs" tests may not work in real
    repositories, as the --pretty formatter doesn't know to leave away the
    ": " on the last commit in an incomplete (because git-gc removed the
    old part) reflog.  This equivalence is nevertheless the main goal of
    this patch.
    Thanks to Jeff King for reviews, the %gd testcase and documentation.
    Signed-off-by: Thomas Rast <>
    Signed-off-by: Junio C Hamano <>
  2. @trast @gitster

    reflog-walk: refactor the branch@{num} formatting

    trast authored gitster committed
    We'll use the same output in an upcoming commit, so refactor its
    formatting (which was duplicated anyway) into a separate function.
    Signed-off-by: Thomas Rast <>
    Signed-off-by: Junio C Hamano <>
Something went wrong with that request. Please try again.