Merge branch 'cc/sha1-bsearch' into HEAD
authorJunio C Hamano <gitster@pobox.com>
Sun, 5 Apr 2009 06:04:50 +0000 (23:04 -0700)
committerJunio C Hamano <gitster@pobox.com>
Sun, 5 Apr 2009 06:04:50 +0000 (23:04 -0700)
* 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
...

1  2 
Makefile
refs.c
refs.h
diff --combined Makefile
index 9fa2928357e93114964b9bd18213b77471bdf5bd,7867eaccdb90729aef26dc9f67a45a5a74961aae..42cabe81620e017d522ae377874e6b1bd1f10b6f
+++ b/Makefile
@@@ -263,6 -263,18 +263,18 @@@ SPARSE_FLAGS = -D__BIG_ENDIAN__ -D__pow
  BASIC_CFLAGS =
  BASIC_LDFLAGS =
  
+ # Guard against environment variables
+ BUILTIN_OBJS =
+ BUILT_INS =
+ COMPAT_CFLAGS =
+ COMPAT_OBJS =
+ LIB_H =
+ LIB_OBJS =
+ PROGRAMS =
+ SCRIPT_PERL =
+ SCRIPT_SH =
+ TEST_PROGRAMS =
  SCRIPT_SH += git-am.sh
  SCRIPT_SH += git-bisect.sh
  SCRIPT_SH += git-filter-branch.sh
@@@ -420,7 -432,6 +432,7 @@@ LIB_OBJS += archive-tar.
  LIB_OBJS += archive-zip.o
  LIB_OBJS += attr.o
  LIB_OBJS += base85.o
 +LIB_OBJS += bisect.o
  LIB_OBJS += blob.o
  LIB_OBJS += branch.o
  LIB_OBJS += bundle.o
diff --combined refs.c
index 2d198a1add58f73b7708d48f0a4329b5b28facc1,26b001453bd1566f2ab3554fffeb63ec0437ceaa..e5468967eb81f5d102395e031c57cbb621280012
--- 1/refs.c
--- 2/refs.c
+++ b/refs.c
@@@ -647,24 -647,19 +647,24 @@@ int for_each_ref(each_ref_fn fn, void *
        return do_for_each_ref("refs/", fn, 0, 0, cb_data);
  }
  
 +int for_each_ref_in(const char *prefix, each_ref_fn fn, void *cb_data)
 +{
 +      return do_for_each_ref(prefix, fn, strlen(prefix), 0, cb_data);
 +}
 +
  int for_each_tag_ref(each_ref_fn fn, void *cb_data)
  {
 -      return do_for_each_ref("refs/tags/", fn, 10, 0, cb_data);
 +      return for_each_ref_in("refs/tags/", fn, cb_data);
  }
  
  int for_each_branch_ref(each_ref_fn fn, void *cb_data)
  {
 -      return do_for_each_ref("refs/heads/", fn, 11, 0, cb_data);
 +      return for_each_ref_in("refs/heads/", fn, cb_data);
  }
  
  int for_each_remote_ref(each_ref_fn fn, void *cb_data)
  {
 -      return do_for_each_ref("refs/remotes/", fn, 13, 0, cb_data);
 +      return for_each_ref_in("refs/remotes/", fn, cb_data);
  }
  
  int for_each_rawref(each_ref_fn fn, void *cb_data)
@@@ -742,6 -737,16 +742,16 @@@ int check_ref_format(const char *ref
        }
  }
  
+ const char *prettify_ref(const struct ref *ref)
+ {
+       const char *name = ref->name;
+       return name + (
+               !prefixcmp(name, "refs/heads/") ? 11 :
+               !prefixcmp(name, "refs/tags/") ? 10 :
+               !prefixcmp(name, "refs/remotes/") ? 13 :
+               0);
+ }
  const char *ref_rev_parse_rules[] = {
        "%.*s",
        "refs/%.*s",
diff --combined refs.h
index abb125754d7b23ef61fa9b130f1614ffea0a79de,68c2d16d5388f5591a610e1d6fcf2f731159ecb2..2f6a8af6081245d626a724258dfa7c8d1a65c4ec
--- 1/refs.h
--- 2/refs.h
+++ b/refs.h
@@@ -20,7 -20,6 +20,7 @@@ struct ref_lock 
  typedef int each_ref_fn(const char *refname, const unsigned char *sha1, int flags, void *cb_data);
  extern int head_ref(each_ref_fn, void *);
  extern int for_each_ref(each_ref_fn, void *);
 +extern int for_each_ref_in(const char *, each_ref_fn, void *);
  extern int for_each_tag_ref(each_ref_fn, void *);
  extern int for_each_branch_ref(each_ref_fn, void *);
  extern int for_each_remote_ref(each_ref_fn, void *);
@@@ -80,6 -79,8 +80,8 @@@ extern int for_each_reflog(each_ref_fn
  #define CHECK_REF_FORMAT_WILDCARD (-3)
  extern int check_ref_format(const char *target);
  
+ extern const char *prettify_ref(const struct ref *ref);
  /** rename ref, return 0 on success **/
  extern int rename_ref(const char *oldref, const char *newref, const char *logmsg);