1. 22 7月, 2008 1 次提交
    • J
      Rename path_list to string_list · c455c87c
      Johannes Schindelin 提交于
      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: NJohannes Schindelin <johannes.schindelin@gmx.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      c455c87c
  2. 18 2月, 2008 1 次提交
  3. 15 7月, 2007 1 次提交
  4. 24 2月, 2007 1 次提交
  5. 21 2月, 2007 1 次提交
    • J
      Mechanical conversion to use prefixcmp() · cc44c765
      Junio C Hamano 提交于
      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: NJunio C Hamano <junkio@cox.net>
      cc44c765
  6. 19 12月, 2006 1 次提交
  7. 18 12月, 2006 4 次提交
  8. 22 11月, 2006 1 次提交
    • J
      Store peeled refs in packed-refs (take 2). · f4204ab9
      Junio C Hamano 提交于
      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: NJunio C Hamano <junkio@cox.net>
      f4204ab9
  9. 20 11月, 2006 1 次提交
  10. 27 10月, 2006 1 次提交
  11. 01 10月, 2006 1 次提交
  12. 20 9月, 2006 1 次提交
  13. 17 9月, 2006 1 次提交
  14. 16 9月, 2006 1 次提交
    • L
      Add "git show-ref" builtin command · 358ddb62
      Linus Torvalds 提交于
      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: NLinus Torvalds <torvalds@osdl.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      358ddb62