Skip to content
Commits on Nov 10, 2009
  1. @jrn @gitster

    Show usage string for 'git show-ref -h'

    jrn committed with gitster Nov 9, 2009
    This only changes the behavior of "git show-ref -h" without any
    other options and arguments.
    
    "show-ref -h" currently is short for "show-ref --head", which
    shows all the refs/* and HEAD, as opposed to "show-ref" that
    shows all the refs/* and not HEAD.
    
    Does anybody use "show-ref -h"?  It was in Linus's original, most
    likely only because "it might be handy", not because "the command
    should not show the HEAD by default for such and such reasons".
    So I think it is okay if "show-ref -h" (but not "show-ref
    --head") gives help and exits.
    
    If a current script uses "git show-ref -h" without any other
    arguments, it would have to be adapted by changing "-h" to
    "--head".
    
    Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jun 21, 2009
  1. @bebarino @gitster

    show-ref: migrate to parse-options

    bebarino committed with gitster Jun 20, 2009
    Also make the docs more consistent with the usage message. While we're
    here remove the zero initializers from the static variables as they're
    unnecessary.
    
    Signed-off-by: Stephen Boyd <bebarino@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Mar 24, 2009
  1. @gitster

    builtin-show-ref: use warning() instead of fprintf(stderr, "warning: ")

    Miklos Vajna committed with gitster Mar 24, 2009
    Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Aug 31, 2008
  1. @gitster

    'git foo' program identifies itself without dash in die() messages

    gitster committed Aug 31, 2008
    This is a mechanical conversion of all '*.c' files with:
    
    	s/((?:die|error|warning)\("git)-(\S+:)/$1 $2/;
    
    The result was manually inspected and no false positive was found.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jul 22, 2008
  1. @dscho @gitster

    Rename path_list to string_list

    dscho committed with gitster Jul 21, 2008
    The name path_list was correct for the first usage of that data structure,
    but it really is a general-purpose string list.
    
    $ perl -i -pe 's/path-list/string-list/g' $(git grep -l path-list)
    $ perl -i -pe 's/path_list/string_list/g' $(git grep -l path_list)
    $ git mv path-list.h string-list.h
    $ git mv path-list.c string-list.c
    $ perl -i -pe 's/has_path/has_string/g' $(git grep -l has_path)
    $ perl -i -pe 's/path/string/g' string-list.[ch]
    $ git mv Documentation/technical/api-path-list.txt \
    	Documentation/technical/api-string-list.txt
    $ perl -i -pe 's/strdup_paths/strdup_strings/g' $(git grep -l strdup_paths)
    
    ... and then fix all users of string-list to access the member "string"
    instead of "path".
    
    Documentation/technical/api-string-list.txt needed some rewrapping, too.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Feb 18, 2008
  1. @gitster

    deref_tag: handle return value NULL

    Martin Koegler committed with gitster Feb 18, 2008
    Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jul 15, 2007
  1. @gitster

    Make every builtin-*.c file #include "builtin.h"

    Peter Hagervall committed with gitster Jul 15, 2007
    Make every builtin-*.c file #include "builtin.h".
    
    Also takes care of some declaration/definition mismatches.
    
    Signed-off-by: Peter Hagervall <hager@cs.umu.se>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Feb 24, 2007
  1. Merge branch 'maint'

    Junio C Hamano committed Feb 24, 2007
    * maint:
      diff-patch: Avoid emitting double-slashes in textual patch.
      Reword git-am 3-way fallback failure message.
      Limit filename for format-patch
      core.legacyheaders: Use the description used in RelNotes-1.5.0
      git-show-ref --verify: Fail if called without a reference
    
    Conflicts:
    
    	builtin-show-ref.c
    	diff.c
  2. @ldv-alt

    git-show-ref --verify: Fail if called without a reference

    ldv-alt committed with Junio C Hamano Feb 23, 2007
    builtin-show-ref.c (cmd_show_ref): Fail if called with --verify option but
    without a reference.
    
    Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
    Signed-off-by: Junio C Hamano <junkio@cox.net>
Commits on Feb 21, 2007
  1. Mechanical conversion to use prefixcmp()

    Junio C Hamano committed Feb 20, 2007
    This mechanically converts strncmp() to use prefixcmp(), but only when
    the parameters match specific patterns, so that they can be verified
    easily.  Leftover from this will be fixed in a separate step, including
    idiotic conversions like
    
        if (!strncmp("foo", arg, 3))
    
      =>
    
        if (!(-prefixcmp(arg, "foo")))
    
    This was done by using this script in px.perl
    
       #!/usr/bin/perl -i.bak -p
       if (/strncmp\(([^,]+), "([^\\"]*)", (\d+)\)/ && (length($2) == $3)) {
               s|strncmp\(([^,]+), "([^\\"]*)", (\d+)\)|prefixcmp($1, "$2")|;
       }
       if (/strncmp\("([^\\"]*)", ([^,]+), (\d+)\)/ && (length($1) == $3)) {
               s|strncmp\("([^\\"]*)", ([^,]+), (\d+)\)|(-prefixcmp($2, "$1"))|;
       }
    
    and running:
    
       $ git grep -l strncmp -- '*.c' | xargs perl px.perl
    
    Signed-off-by: Junio C Hamano <junkio@cox.net>
Commits on Dec 18, 2006
  1. show-ref: fix --exclude-existing

    Junio C Hamano committed Dec 18, 2006
    Do not falsely document --filter-invalid which does not even exist.
    Also make sure the line is long enough to have ^{} suffix before
    checking for it.
    
    Pointed out by Dscho.
    
    Signed-off-by: Junio C Hamano <junkio@cox.net>
  2. show-ref: fix --verify --hash=length

    Junio C Hamano committed Dec 17, 2006
    An earlier optimization for --verify broke a lot of stuff
    because it did not take interaction with other flags into
    account.
    
    This also fixes an unrelated argument parsing error; --hash=8
    should mean the same as "--hash --abbrev=8".
    
    Signed-off-by: Junio C Hamano <junkio@cox.net>
  3. show-ref: fix --quiet --verify

    Junio C Hamano committed Dec 17, 2006
    Signed-off-by: Junio C Hamano <junkio@cox.net>
  4. avoid accessing _all_ loose refs in git-show-ref --verify

    Junio C Hamano committed Dec 17, 2006
    If you want to verify a ref, it is overkill to first read all loose refs
    into a linked list, and then check if the desired ref is there.
    
    Signed-off-by: Junio C Hamano <junkio@cox.net>
    Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
  5. git-fetch: Avoid reading packed refs over and over again

    Junio C Hamano committed Dec 17, 2006
    When checking which tags to fetch, the old code used to call
    git-show-ref --verify for each remote tag. Since reading even
    packed refs is not a cheap operation when there are a lot of
    local refs, the code became quite slow.
    
    This fixes it by teaching git-show-ref to filter out existing
    refs using a new mode of operation of git-show-ref.
    
    Signed-off-by: Junio C Hamano <junkio@cox.net>
Commits on Nov 22, 2006
  1. Store peeled refs in packed-refs (take 2).

    Junio C Hamano committed Nov 21, 2006
    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>
Commits on Nov 20, 2006
  1. Store peeled refs in packed-refs file.

    Junio C Hamano committed Nov 19, 2006
    This would speed up "show-ref -d" in a repository with mostly
    packed tags.
    
    Signed-off-by: Junio C Hamano <junkio@cox.net>
Commits on Oct 27, 2006
  1. @hjemli

    Fix show-ref usagestring

    hjemli committed with Junio C Hamano Oct 26, 2006
    This describes the abbreviation possibilities for git-show-ref
    
    Signed-off-by: Lars Hjemli <hjemli@gmail.com>
    Signed-off-by: Junio C Hamano <junkio@cox.net>
Commits on Oct 1, 2006
  1. show-ref --hash=len, --abbrev=len, and --abbrev

    Junio C Hamano committed Oct 1, 2006
    This teaches show-ref to abbreviate the object name.
    
    Signed-off-by: Junio C Hamano <junkio@cox.net>
Commits on Sep 21, 2006
  1. Merge branch 'lt/refs' into jc/lt-ref2-with-lt-refs

    Junio C Hamano committed Sep 21, 2006
    * lt/refs: (58 commits)
      git-pack-refs --prune
      pack-refs: do not pack symbolic refs.
      Tell between packed, unpacked and symbolic refs.
      Add callback data to for_each_ref() family.
      symbolit-ref: fix resolve_ref conversion.
      Fix broken sha1 locking
      fsck-objects: adjust to resolve_ref() clean-up.
      gitignore: git-pack-refs is a generated file.
      wt-status: use simplified resolve_ref to find current branch
      Fix t1400-update-ref test minimally
      Enable the packed refs file format
      Make ref resolution saner
      Add support for negative refs
      Start handling references internally as a sorted in-memory list
      gitweb fix validating pg (page) parameter
      git-repack(1): document --window and --depth
      git-apply(1): document --unidiff-zero
      gitweb: fix warnings in PATH_INFO code and add export_ok/strict_export
      upload-archive: monitor child communication even more carefully.
      gitweb: export options
      ...
Commits on Sep 20, 2006
  1. @chriscool

    Fix show-ref usage for --dereference.

    chriscool committed with Junio C Hamano Sep 20, 2006
    Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
    Signed-off-by: Junio C Hamano <junkio@cox.net>
Commits on Sep 17, 2006
  1. @chriscool

    Add [-s|--hash] option to Linus' show-ref.

    chriscool committed with Junio C Hamano Sep 17, 2006
    With this option only the sha1 hash of the ref should
    be printed.
    
    Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
    Signed-off-by: Junio C Hamano <junkio@cox.net>
Commits on Sep 16, 2006
  1. Add "git show-ref" builtin command

    Linus Torvalds committed with Junio C Hamano Sep 15, 2006
    It's kind of like "git peek-remote", but works only locally (and thus
    avoids the whole overhead of git_connect()) and has some extra
    verification features.
    
    For example, it allows you to filter the results, and to choose whether
    you want the tag dereferencing or not. You can also use it to just test
    whether a particular ref exists.
    
    For example:
    
    	git show-ref master
    
    will show all references called "master", whether tags or heads or
    anything else, and regardless of how deep in the reference naming
    hierarchy they are (so it would show "refs/heads/master" but also
    "refs/remote/other-repo/master").
    
    When using the "--verify" flag, the command requires an exact ref path:
    
    	git show-ref --verify refs/heads/master
    
    will only match the exact branch called "master".
    
    If nothing matches, show-ref will return an error code of 1, and in the
    case of verification, it will show an error message.
    
    For scripting, you can ask it to be quiet with the "--quiet" flag, which
    allows you to do things like
    
    	git-show-ref --quiet --verify -- "refs/heads/$headname" ||
    		echo "$headname is not a valid branch"
    
    to check whether a particular branch exists or not (notice how we don't
    actually want to show any results, and we want to use the full refname for
    it in order to not trigger the problem with ambiguous partial matches).
    
    To show only tags, or only proper branch heads, use "--tags" and/or
    "--heads" respectively (using both means that it shows tags _and_ heads,
    but not other random references under the refs/ subdirectory).
    
    To do automatic tag object dereferencing, use the "-d" or "--dereference"
    flag, so you can do
    
    	git show-ref --tags --dereference
    
    to get a listing of all tags together with what they dereference.
    
    Signed-off-by: Linus Torvalds <torvalds@osdl.org>
    Signed-off-by: Junio C Hamano <junkio@cox.net>
Something went wrong with that request. Please try again.