Skip to content
Commits on Jun 6, 2006
  1. ref-log: style fixes.

    Junio C Hamano committed
    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 <>
  2. refs.c: convert it to use lockfile interface.

    Junio C Hamano committed
    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 <>
Commits on May 19, 2006
  1. @spearce

    Force writing ref if it doesn't exist.

    spearce committed with Junio C Hamano
    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 <>
    Signed-off-by: Junio C Hamano <>
Commits on May 18, 2006
  1. @spearce

    Support 'master@2 hours ago' syntax

    spearce committed with Junio C Hamano
    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 <>
    Signed-off-by: Junio C Hamano <>
  2. @spearce

    Log ref updates to logs/refs/<ref>

    spearce committed with Junio C Hamano
    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 <>
    Signed-off-by: Junio C Hamano <>
  3. @spearce

    Improve abstraction of ref lock/write.

    spearce committed with Junio C Hamano
    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 <>
    Signed-off-by: Junio C Hamano <>
Commits on May 14, 2006
  1. @loops

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

    loops committed with Junio C Hamano
    "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 <>
    Signed-off-by: Junio C Hamano <>
Commits on Jul 5, 2005
  1. Add "git_path()" and "head_ref()" helper functions.

    Linus Torvalds committed
    "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.
Commits on Jul 3, 2005
  1. Fix up "for_each_ref()" to be more usable, and use it in git-fsck-cache

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

    Linus Torvalds committed
    This turns it into a generic "do xyz for each ref" library function.
Commits on Jun 7, 2005
  1. [PATCH] Operations on refs

    Daniel Barkalow committed with Linus Torvalds
    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 <>
    Signed-off-by: Linus Torvalds <>
Something went wrong with that request. Please try again.