Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Jul 07, 2010

  1. setup_revisions(): Allow walking history in a submodule

    By passing the path to a submodule in opt->submodule, the function can
    be used to walk history in the named submodule repository, instead of
    the toplevel repository.
    
    Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    Heiko Voigt authored gitster committed

Jun 12, 2010

  1. trast

    log_ref_setup: don't return stack-allocated array

    859c301 (refs: split log_ref_write logic into log_ref_setup,
    2010-05-21) refactors the stack allocation of the log_file array into
    the new log_ref_setup() function, but passes it back to the caller.
    
    Since the original intent seems to have been to split the work between
    log_ref_setup and log_ref_write, make it the caller's responsibility
    to allocate the buffer.
    
    Signed-off-by: Thomas Rast <trast@student.ethz.ch>
    Reported-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    trast authored gitster committed

Jun 02, 2010

  1. Erick Mattos

    refs: split log_ref_write logic into log_ref_setup

    Separation of the logic for testing and preparing the reflogs from
    function log_ref_write to a new non static new function: log_ref_setup.
    
    This allows to be performed from outside the first all reasonable checks
    and procedures for writing reflogs.
    
    Signed-off-by: Erick Mattos <erick.mattos@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    erickmattos authored gitster committed

Mar 13, 2010

  1. trast

    Support showing notes from more than one notes tree

    With this patch, you can set notes.displayRef to a glob that points at
    your favourite notes refs, e.g.,
    
    [notes]
    	displayRef = refs/notes/*
    
    Then git-log and friends will show notes from all trees.
    
    Thanks to Junio C Hamano for lots of feedback, which greatly
    influenced the design of the entire series and this commit in
    particular.
    
    Signed-off-by: Thomas Rast <trast@student.ethz.ch>
    Acked-by: Johan Herland <johan@herland.net>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    trast authored gitster committed

Jan 20, 2010

  1. rev-parse --branches/--tags/--remotes=pattern

    Since local branch, tags and remote tracking branch namespaces are
    most often used, add shortcut notations for globbing those in
    manner similar to --glob option.
    
    With this, one can express the "what I have but origin doesn't?"
    as:
    
    'git log --branches --not --remotes=origin'
    
    Original-idea-by: Johannes Sixt <j6t@kdbg.org>
    Signed-off-by: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    Ilari Liusvaara authored gitster committed
  2. rev-parse --glob

    Add --glob=<glob-pattern> option to rev-parse and everything that
    accepts its options. This option matches all refs that match given
    shell glob pattern (complete with some DWIM logic).
    
    Example:
    
    'git log --branches --not --glob=remotes/origin'
    
    To show what you have that origin doesn't.
    
    Signed-off-by: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    Ilari Liusvaara authored gitster committed

Nov 10, 2009

  1. Jay Soffian

    teach warn_dangling_symref to take a FILE argument

    Different callers of warn_dangling_symref() may want to control whether its
    output goes to stdout or stderr so let it take a FILE argument.
    
    Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    jaysoffian authored gitster committed

Jun 01, 2009

  1. Christian Couder

    refs: add a "for_each_replace_ref" function

    This is some preparation work for the following patches that are using
    the "refs/replace/" ref namespace.
    
    Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    chriscool authored gitster committed

May 14, 2009

  1. Felipe Contreras

    Change prettify_ref to prettify_refname

    In preparation to be used when the ref object is not available
    
    Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
    Acked-by: Jeff King <peff@peff.net>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    felipec authored gitster committed

Apr 13, 2009

  1. Bert Wesarg

    shorten_unambiguous_ref(): add strict mode

    Add the strict mode of abbreviation to shorten_unambiguous_ref(), i.e. the
    resulting ref won't trigger the ambiguous ref warning.
    
    All users of shorten_unambiguous_ref() still use the loose mode.
    
    Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    bertwesarg authored gitster committed

Apr 12, 2009

  1. Junio C Hamano

    Merge branch 'jk/show-upstream'

    * jk/show-upstream:
      branch: show upstream branch when double verbose
      make get_short_ref a public function
      for-each-ref: add "upstream" format field
      for-each-ref: refactor refname handling
      for-each-ref: refactor get_short_ref function
    gitster authored

Apr 08, 2009

  1. Jeff King

    make get_short_ref a public function

    Often we want to shorten a full ref name to something "prettier"
    to show a user. For example, "refs/heads/master" is often shown
    simply as "master", or "refs/remotes/origin/master" is shown as
    "origin/master".
    
    Many places in the code use a very simple formula: skip common
    prefixes like refs/heads, refs/remotes, etc. This is codified in
    the prettify_ref function.
    
    for-each-ref has a more correct (but more expensive) approach:
    consider the ref lookup rules, and try shortening as much as
    possible while remaining unambiguous.
    
    This patch makes the latter strategy globally available as
    shorten_unambiguous_ref.
    
    Signed-off-by: Jeff King <peff@peff.net>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    peff authored gitster committed

Apr 05, 2009

  1. Junio C Hamano

    Merge branch 'cc/sha1-bsearch' into HEAD

    * cc/sha1-bsearch: (95 commits)
      patch-ids: use the new generic "sha1_pos" function to lookup sha1
      sha1-lookup: add new "sha1_pos" function to efficiently lookup sha1
      Update draft release notes to 1.6.3
      GIT 1.6.2.2
      send-email: ensure quoted addresses are rfc2047 encoded
      send-email: correct two tests which were going interactive
      Documentation: git-svn: fix trunk/fetch svn-remote key typo
      Mailmap: Allow empty email addresses to be mapped
      Cleanup warning about known issues in cvsimport documentation
      Documentation: Remove an odd "instead"
      send-email: ask_default should apply to all emails, not just the first
      send-email: don't attempt to prompt if tty is closed
      fix portability problem with IS_RUN_COMMAND_ERR
      Documentation: use "spurious .sp" XSLT if DOCBOOK_SUPPRESS_SP is set
      mailmap: resurrect lower-casing of email addresses
      builtin-clone.c: no need to strdup for setenv
      builtin-clone.c: make junk_pid static
      git-svn: add a double quiet option to hide git commits
      Update draft release notes to 1.6.2.2
      Documentation: push.default applies to all remotes
      ...
    gitster authored

Mar 30, 2009

  1. Christian Couder

    refs: add "for_each_ref_in" function to refactor "for_each_*_ref" fun…

    …ctions
    
    The "for_each_{tag,branch,remote,replace,}_ref" functions are
    redefined in terms of "for_each_ref_in" so that we can lose the
    hardcoded length of prefix strings from the code.
    
    Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
    chriscool authored gitster committed

Mar 09, 2009

  1. Use a common function to get the pretty name of refs

    The result should be consistent between fetch and push, so we ought to
    use the same code in both cases, even though it's short.
    
    Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    Daniel Barkalow authored gitster committed

Feb 11, 2009

  1. Junio C Hamano

    remote prune: warn dangling symrefs

    If you prune from the remote "frotz" that deleted the ref your tracking
    branch remotes/frotz/HEAD points at, the symbolic ref will become
    dangling.  We used to detect this as an error condition and issued a
    message every time refs are enumerated.
    
    This stops the error message, but moves the warning to "remote prune".
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    gitster authored

Jan 20, 2009

  1. Junio C Hamano

    Introduce for_each_recent_reflog_ent().

    This can be used to scan only the last few kilobytes of a reflog, as a
    cheap optimization when the data you are looking for is likely to be
    found near the end of it.  The caller is expected to fall back to the
    full scan if that is not the case.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    gitster authored

May 05, 2008

  1. Allow for having for_each_ref() list extra refs

    These refs can be anything, but they are most likely useful as
    pointing to objects that you know are in the object database but don't
    have any regular refs for. For example, when cloning with --reference,
    the refs in this repository should be listed as objects that we have,
    even though we don't have refs in our newly-created repository for
    them yet.
    
    Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    Daniel Barkalow authored gitster committed

Feb 23, 2008

  1. refs.c: make close_ref() and commit_ref() non-static

    This is in preparation to the reflog-expire changes which will
    allow updating the ref after expiring the reflog.
    
    Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    Brandon Casey authored gitster committed

Jan 02, 2008

  1. Junio C Hamano

    lock_any_ref_for_update(): reject wildcard return from check_ref_format

    Recent check_ref_format() returns -3 as well as -1 (general
    error) and -2 (less than two levels).  The caller was explicitly
    checking for -1, to allow "HEAD" but still needed to disallow
    bogus refs.
    
    This introduces symbolic constants for the return values from
    check_ref_format() to make them read better and more
    meaningful.  Normal ref creation codepath can still treat
    non-zero return values as errors.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    gitster authored

Nov 16, 2007

  1. refs.c: Remove unused get_ref_sha1()

    Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    Johannes Sixt authored gitster committed

Sep 05, 2007

  1. jasampler

    Function for updating refs.

    A function intended to be called from builtins updating refs
    by locking them before write, specially those that came from
    scripts using "git update-ref".
    
    [jc: with minor fixups]
    
    Signed-off-by: Carlos Rica <jasampler@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    jasampler authored gitster committed

May 10, 2007

  1. git-update-ref: add --no-deref option for overwriting/detaching ref

    git-checkout is also adapted to make use of this new option
    instead of the handcrafted command sequence.
    
    Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
    Signed-off-by: Junio C Hamano <junkio@cox.net>
    Sven Verdoolaege authored Junio C Hamano committed

Apr 10, 2007

  1. Linus Torvalds

    Add 'resolve_gitlink_ref()' helper function

    This new function resolves a ref in *another* git repository.  It's
    named for its intended use: to look up the git link to a subproject.
    
    It's not actually wired up to anything yet, but we're getting closer to
    having fundamental plumbing support for "links" from one git directory
    to another, which is the basis of subproject support.
    
    [jc: amended a FILE* leak]
    
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Junio C Hamano <junkio@cox.net>
    torvalds authored Junio C Hamano committed

Feb 03, 2007

  1. scan reflogs independently from refs

    Currently, the search for all reflogs depends on the existence of
    corresponding refs under the .git/refs/ directory.  Let's scan the
    .git/logs/ directory directly instead.
    
    Signed-off-by: Nicolas Pitre <nico@cam.org>
    Signed-off-by: Junio C Hamano <junkio@cox.net>
    Nicolas Pitre authored Junio C Hamano committed

Jan 28, 2007

  1. lock_ref_sha1_basic(): remember the original name of a ref when resol…

    …ving it
    
    A ref might be pointing to another ref but only the name of the last ref
    is remembered.  Let's remember about the first name as well.
    
    Signed-off-by: Nicolas Pitre <nico@cam.org>
    Signed-off-by: Junio C Hamano <junkio@cox.net>
    Nicolas Pitre authored Junio C Hamano committed
  2. make reflog filename independent from struct ref_lock

    This allows for ref_log_write() to be used in a more flexible way,
    and is needed for future changes.
    
    This is only code reorg with no behavior change.
    
    Signed-off-by: Nicolas Pitre <nico@cam.org>
    Signed-off-by: Junio C Hamano <junkio@cox.net>
    Nicolas Pitre authored Junio C Hamano committed

Jan 20, 2007

  1. Extend read_ref_at() to be usable from places other than sha1_name.

    You can pass an extra argument to the function to receive the
    reflog message information.  Also when the log does not go back
    beyond the point the user asked, the cut-off time and count are
    given back to the caller for emitting the error messages as
    appropriately.
    
    We could later add configuration for get_sha1_basic() to make it
    an error instead of it being just a warning.
    
    Signed-off-by: Junio C Hamano <junkio@cox.net>
    Junio C Hamano authored

Jan 09, 2007

  1. dscho

    Sanitize for_each_reflog_ent()

    It used to ignore the return value of the helper function; now, it
    expects it to return 0, and stops iteration upon non-zero return
    values; this value is then passed on as the return value of
    for_each_reflog_ent().
    
    Further, it makes no sense to force the parsing upon the helper
    functions; for_each_reflog_ent() now calls the helper function with
    old and new sha1, the email, the timestamp & timezone, and the message.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    Signed-off-by: Junio C Hamano <junkio@cox.net>
    dscho authored Junio C Hamano committed

Dec 21, 2006

  1. add for_each_reflog_ent() iterator

    Signed-off-by: Junio C Hamano <junkio@cox.net>
    Junio C Hamano authored

Dec 06, 2006

  1. git-branch: let caller specify logmsg

    This changes the signature of rename_ref() in refs.[hc] to include a
    logmessage for the reflogs.
    
    Also, builtin-branch.c is modified to provide a proper logmessage + call
    setup_ident() before any logmessages are written.
    
    Signed-off-by: Lars Hjemli <hjemli@gmail.com>
    Signed-off-by: Junio C Hamano <junkio@cox.net>
    Lars Hjemli authored Junio C Hamano committed
  2. git-branch: add options and tests for branch renaming

    Extend git-branch with the following options:
    
      git-branch -m|-M [<oldbranch>] newbranch
    
    The -M variation is required to force renaming over an exsisting
    branchname.
    
    This also indroduces $GIT_DIR/RENAME_REF which is a "metabranch"
    used when renaming branches. It will always hold the original sha1
    for the latest renamed branch.
    
    Additionally, if $GIT_DIR/logs/RENAME_REF exists, all branch rename
    events are logged there.
    
    Finally, some testcases are added to verify the new options.
    
    Signed-off-by: Lars Hjemli <hjemli@gmail.com>
    Signed-off-by: Junio C Hamano <junkio@cox.net>
    Lars Hjemli authored Junio C Hamano committed

Nov 22, 2006

  1. Store peeled refs in packed-refs (take 2).

    This fixes the previous implementation which failed to optimize
    repositories with tons of lightweight tags.  The updated
    packed-refs format begins with "# packed-refs with:" line that
    lists the kind of extended data the file records.  Currently,
    there is only one such extension defined, "peeled".  This stores
    the "peeled tag" on a line that immediately follows a line for a
    tag object itself in the format "^<sha-1>".
    
    The header line itself and any extended data are ignored by
    older implementation, so packed-refs file generated with this
    version can still be used by older git.  packed-refs made by
    older git can of course be used with this version.
    
    Signed-off-by: Junio C Hamano <junkio@cox.net>
    Junio C Hamano authored

Nov 20, 2006

  1. Store peeled refs in packed-refs file.

    This would speed up "show-ref -d" in a repository with mostly
    packed tags.
    
    Signed-off-by: Junio C Hamano <junkio@cox.net>
    Junio C Hamano authored

Oct 06, 2006

  1. ref-log: allow ref@{count} syntax.

    Often I find myself wanting to say 'tip of "next" before I
    merged the last three topics'.  Now I can say that with:
    
    	git log next@{3}..next
    
    Since small integers alone are invalid input strings to
    approxidate, there is no fear of confusion.
    
    Signed-off-by: Junio C Hamano <junkio@cox.net>
    Junio C Hamano authored
Something went wrong with that request. Please try again.