Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

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

Sep 27, 2006

  1. Clean-up lock-ref implementation

    This drops "mustexist" parameter lock_ref_sha1() and lock_any_ref_forupdate()
    functions take.
    
    Signed-off-by: Junio C Hamano <junkio@cox.net>
    Junio C Hamano authored

Sep 21, 2006

  1. Tell between packed, unpacked and symbolic refs.

    This adds a "int *flag" parameter to resolve_ref() and makes
    for_each_ref() family to call callback function with an extra
    "int flag" parameter.  They are used to give two bits of
    information (REF_ISSYMREF and REF_ISPACKED) about the ref.
    
    Signed-off-by: Junio C Hamano <junkio@cox.net>
    Junio C Hamano authored
  2. Add callback data to for_each_ref() family.

    This is a long overdue fix to the API for for_each_ref() family
    of functions.  It allows the callers to specify a callback data
    pointer, so that the caller does not have to use static
    variables to communicate with the callback funciton.
    
    The updated for_each_ref() family takes a function of type
    
    	int (*fn)(const char *, const unsigned char *, void *)
    
    and a void pointer as parameters, and calls the function with
    the name of the ref and its SHA-1 with the caller-supplied void
    pointer as parameters.
    
    The commit updates two callers, builtin-name-rev.c and
    builtin-pack-refs.c as an example.
    
    Signed-off-by: Junio C Hamano <junkio@cox.net>
    Junio C Hamano authored

Sep 18, 2006

  1. Enable the packed refs file format

    This actually "turns on" the packed ref file format, now that the
    infrastructure to do so sanely exists (ie notably the change to make the
    reference reading logic take refnames rather than pathnames to the loose
    objects that no longer necessarily even exist).
    
    In particular, when the ref lookup hits a refname that has no loose file
    associated with it, it falls back on the packed-ref information. Also, the
    ref-locking code, while still using a loose file for the locking itself
    (and _creating_ a loose file for the new ref) no longer requires that the
    old ref be in such an unpacked state.
    
    Finally, this does a minimal hack to git-checkout.sh to rather than check
    the ref-file directly, do a "git-rev-parse" on the "heads/$refname".
    That's not really wonderful - we should rather really have a special
    routine to verify the names as proper branch head names, but it is a
    workable solution for now.
    
    With this, I can literally do something like
    
    	git pack-refs
    	find .git/refs -type f -print0 | xargs -0 rm -f --
    
    and the end result is a largely working repository (ie I've done two
    commits - which creates _one_ unpacked ref file - done things like run
    "gitk" and "git log" etc, and it all looks ok).
    
    There are probably things missing, but I'm hoping that the missing things
    are now of the "small and obvious" kind, and that somebody else might want
    to start looking at this too. Hint hint ;)
    
    Signed-off-by: Linus Torvalds <torvalds@osdl.org>
    Signed-off-by: Junio C Hamano <junkio@cox.net>
    Linus Torvalds authored Junio C Hamano committed

Jun 06, 2006

  1. ref-log: style fixes.

    A few style fixes to get the code in line with the rest.
    
     - asterisk to make a type a pointer to something goes in front
       of the variable, not at the end of the base type.
       E.g. a pointer to an integer is "int *ip", not "int* ip".
    
     - open parenthesis for function parameter list, unlike
       syntactic constructs, comes immediately after the function
       name.  E.g. "if (foo) bar();" not "if(foo) bar ();".
    
     - "else" does not come on the same line as the closing brace of
       corresponding "if".
    
    The style is mostly a matter of personal taste, and people may
    disagree, but consistency is important.
    
    Signed-off-by: Junio C Hamano <junkio@cox.net>
    Junio C Hamano authored
  2. refs.c: convert it to use lockfile interface.

    This updates the ref locking code to use creat-rename locking
    code we use for the index file, so that it can borrow the code
    to clean things up upon signals and program termination.
    
    Signed-off-by: Junio C Hamano <junkio@cox.net>
    Junio C Hamano authored

May 19, 2006

  1. Shawn O. Pearce

    Force writing ref if it doesn't exist.

    Normally we try to skip writing a ref if its value hasn't changed
    but in the special case that the ref doesn't exist but the new
    value is going to be 0{40} then force writing the ref anyway.
    
    Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
    Signed-off-by: Junio C Hamano <junkio@cox.net>
    spearce authored Junio C Hamano committed

May 18, 2006

  1. Shawn O. Pearce

    Support 'master@2 hours ago' syntax

    Extended sha1 expressions may now include date specifications
    which indicate a point in time within the local repository's
    history.  If the ref indicated to the left of '@' has a log in
    $GIT_DIR/logs/<ref> then the value of the ref at the time indicated
    by the specification is obtained from the ref's log.
    
    Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
    Signed-off-by: Junio C Hamano <junkio@cox.net>
    spearce authored Junio C Hamano committed
  2. Shawn O. Pearce

    Log ref updates to logs/refs/<ref>

    If config parameter core.logAllRefUpdates is true or the log
    file already exists then append a line to ".git/logs/refs/<ref>"
    whenever git-update-ref <ref> is executed.  Each log line contains
    the following information:
    
      oldsha1 <SP> newsha1 <SP> committer <LF>
    
    where committer is the current user, date, time and timezone in
    the standard GIT ident format.  If the caller is unable to append
    to the log file then git-update-ref will fail without updating <ref>.
    
    An optional message may be included in the log line with the -m flag.
    
    Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
    Signed-off-by: Junio C Hamano <junkio@cox.net>
    spearce authored Junio C Hamano committed
  3. Shawn O. Pearce

    Improve abstraction of ref lock/write.

    Created 'struct ref_lock' to contain the data necessary to perform
    a ref update.  This change improves writing a ref as the file names
    are generated only once (rather than twice) and supports following
    symrefs (up to the maximum depth).  Further the ref_lock structure
    provides room to extend the update API with ref logging.
    
    Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
    Signed-off-by: Junio C Hamano <junkio@cox.net>
    spearce authored Junio C Hamano committed

May 14, 2006

  1. Sean

    Add "--branches", "--tags" and "--remotes" options to git-rev-parse.

    "git branch" uses "rev-parse --all" and becomes much too slow when
    there are many tags (it scans all refs).  Use the new "--branches"
    option of rev-parse to speed things up.
    
    Signed-off-by: Sean Estabrooks <seanlkml@sympatico.ca>
    Signed-off-by: Junio C Hamano <junkio@cox.net>
    loops authored Junio C Hamano committed

Jul 05, 2005

  1. Add "git_path()" and "head_ref()" helper functions.

    "git_path()" returns a static pathname pointer into the git directory
    using a printf-like format specifier.
    
    "head_ref()" works like "for_each_ref()", except for just the HEAD.
    Linus Torvalds authored

Jul 03, 2005

  1. Fix up "for_each_ref()" to be more usable, and use it in git-fsck-cache

    It needed to take the GIT_DIR information into account, something that
    the original receive-pack usage just never cared about.
    Linus Torvalds authored
  2. Generalize the "show each ref" code in receice-pack

    This turns it into a generic "do xyz for each ref" library function.
    Linus Torvalds authored

Jun 07, 2005

  1. [PATCH] Operations on refs

    This patch adds code to read a hash out of a specified file under
    {GIT_DIR}/refs/, and to write such files atomically and optionally with an
    compare and lock.
    
    Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
    Signed-off-by: Linus Torvalds <torvalds@osdl.org>
    Daniel Barkalow authored Linus Torvalds committed
Something went wrong with that request. Please try again.