Merge branch 'lj/refs'
authorJunio C Hamano <junkio@cox.net>
Wed, 1 Nov 2006 16:48:50 +0000 (08:48 -0800)
committerJunio C Hamano <junkio@cox.net>
Wed, 1 Nov 2006 16:48:50 +0000 (08:48 -0800)
* lj/refs: (63 commits)
  Fix show-ref usagestring
  t3200: git-branch testsuite update
  sha1_name.c: avoid compilation warnings.
  Make git-branch a builtin
  ref-log: fix D/F conflict coming from deleted refs.
  git-revert with conflicts to behave as git-merge with conflicts
  core.logallrefupdates thinko-fix
  git-pack-refs --all
  core.logallrefupdates create new log file only for branch heads.
  Remove bashism from t3210-pack-refs.sh
  ref-log: allow ref@{count} syntax.
  pack-refs: call fflush before fsync.
  pack-refs: use lockfile as everybody else does.
  git-fetch: do not look into $GIT_DIR/refs to see if a tag exists.
  lock_ref_sha1_basic does not remove empty directories on BSD
  Do not create tag leading directories since git update-ref does it.
  Check that a tag exists using show-ref instead of looking for the ref file.
  Use git-update-ref to delete a tag instead of rm()ing the ref file.
  Fix refs.c;:repack_without_ref() clean-up path
  Clean up "git-branch.sh" and add remove recursive dir test cases.
  ...

15 files changed:
1  2 
Documentation/config.txt
Makefile
builtin-prune.c
builtin.h
cache.h
fetch-pack.c
git-commit.sh
git-fetch.sh
git-revert.sh
git.c
receive-pack.c
revision.c
sha1_name.c
upload-pack.c
wt-status.c

Simple merge
diff --cc Makefile
+++ b/Makefile
@@@ -267,9 -265,9 +267,10 @@@ LIB_OBJS = 
  
  BUILTIN_OBJS = \
        builtin-add.o \
 +      builtin-annotate.o \
        builtin-apply.o \
        builtin-archive.o \
+       builtin-branch.o \
        builtin-cat-file.o \
        builtin-checkout-index.o \
        builtin-check-ref-format.o \
diff --cc builtin-prune.c
Simple merge
diff --cc builtin.h
+++ b/builtin.h
@@@ -11,12 -11,11 +11,13 @@@ extern int mailinfo(FILE *in, FILE *out
  extern int split_mbox(const char **mbox, const char *dir, int allow_bare, int nr_prec, int skip);
  extern void stripspace(FILE *in, FILE *out);
  extern int write_tree(unsigned char *sha1, int missing_ok, const char *prefix);
 +extern void prune_packed_objects(int);
  
  extern int cmd_add(int argc, const char **argv, const char *prefix);
 +extern int cmd_annotate(int argc, const char **argv, const char *prefix);
  extern int cmd_apply(int argc, const char **argv, const char *prefix);
  extern int cmd_archive(int argc, const char **argv, const char *prefix);
+ extern int cmd_branch(int argc, const char **argv, const char *prefix);
  extern int cmd_cat_file(int argc, const char **argv, const char *prefix);
  extern int cmd_checkout_index(int argc, const char **argv, const char *prefix);
  extern int cmd_check_ref_format(int argc, const char **argv, const char *prefix);
diff --cc cache.h
Simple merge
diff --cc fetch-pack.c
Simple merge
diff --cc git-commit.sh
Simple merge
diff --cc git-fetch.sh
Simple merge
diff --cc git-revert.sh
Simple merge
diff --cc git.c
--- 1/git.c
--- 2/git.c
+++ b/git.c
@@@ -219,9 -219,9 +219,10 @@@ static void handle_internal_command(in
                int option;
        } commands[] = {
                { "add", cmd_add, RUN_SETUP },
 +              { "annotate", cmd_annotate, },
                { "apply", cmd_apply },
                { "archive", cmd_archive },
+               { "branch", cmd_branch },
                { "cat-file", cmd_cat_file, RUN_SETUP },
                { "checkout-index", cmd_checkout_index, RUN_SETUP },
                { "check-ref-format", cmd_check_ref_format },
diff --cc receive-pack.c
@@@ -15,20 -14,7 +15,20 @@@ static int report_status
  static char capabilities[] = "report-status";
  static int capabilities_sent;
  
- static int show_ref(const char *path, const unsigned char *sha1)
 +static int receive_pack_config(const char *var, const char *value)
 +{
 +      git_default_config(var, value);
 +
 +      if (strcmp(var, "receive.denynonfastforwards") == 0)
 +      {
 +              deny_non_fast_forwards = git_config_bool(var, value);
 +              return 0;
 +      }
 +
 +      return 0;
 +}
 +
+ static int show_ref(const char *path, const unsigned char *sha1, int flag, void *cb_data)
  {
        if (capabilities_sent)
                packet_write(1, "%s %s\n", sha1_to_hex(sha1), path);
@@@ -349,10 -275,11 +289,11 @@@ int main(int argc, char **argv
        if (!dir)
                usage(receive_pack_usage);
  
-       if(!enter_repo(dir, 0))
+       if (!enter_repo(dir, 0))
                die("'%s': unable to chdir or not a git archive", dir);
  
 -      git_config(git_default_config);
+       setup_ident();
 +      git_config(receive_pack_config);
  
        write_head_info();
  
diff --cc revision.c
Simple merge
diff --cc sha1_name.c
Simple merge
diff --cc upload-pack.c
@@@ -420,9 -416,9 +420,9 @@@ static void receive_needs(void
        }
  }
  
- static int send_ref(const char *refname, const unsigned char *sha1)
+ static int send_ref(const char *refname, const unsigned char *sha1, int flag, void *cb_data)
  {
 -      static const char *capabilities = "multi_ack thin-pack side-band side-band-64k";
 +      static const char *capabilities = "multi_ack thin-pack side-band side-band-64k ofs-delta";
        struct object *o = parse_object(sha1);
  
        if (!o)
diff --cc wt-status.c
Simple merge