Merge branch 'master' into sp/reflog
authorJunio C Hamano <junkio@cox.net>
Wed, 24 May 2006 23:49:24 +0000 (16:49 -0700)
committerJunio C Hamano <junkio@cox.net>
Wed, 24 May 2006 23:49:24 +0000 (16:49 -0700)
* master: (90 commits)
  fetch.c: remove an unused variable and dead code.
  Clean up sha1 file writing
  Builtin git-cat-file
  builtin format-patch: squelch content-type for 7-bit ASCII
  CMIT_FMT_EMAIL: Q-encode Subject: and display-name part of From: fields.
  add more informative error messages to git-mktag
  remove the artificial restriction tagsize < 8kb
  git-rebase: use canonical A..B syntax to format-patch
  git-format-patch: now built-in.
  fmt-patch: Support --attach
  fmt-patch: understand old <his> notation
  Teach fmt-patch about --keep-subject
  Teach fmt-patch about --numbered
  fmt-patch: implement -o <dir>
  fmt-patch: output file names to stdout
  Teach fmt-patch to write individual files.
  built-in tar-tree and remote tar-tree
  Builtin git-diff-files, git-diff-index, git-diff-stages, and git-diff-tree.
  Builtin git-show-branch.
  Builtin git-apply.
  ...

1  2 
Documentation/git-branch.txt
Documentation/git-checkout.txt
cache.h
fetch.c
fetch.h
git-am.sh
git-commit.sh

Simple merge
index 064394385486ca032c52e513c071ec08895a04c6,d82efc00d403dc13ac1e85c53083ccc52a4c79f3..fbdbadc74fbe558285323353b7aa006f3cfd559b
@@@ -35,13 -35,11 +35,16 @@@ OPTION
        Force a re-read of everything.
  
  -b::
-       Create a new branch and start it at <branch>.
+       Create a new branch named <new_branch> and start it at
+       <branch>.  The new branch name must pass all checks defined
+       by gitlink:git-check-ref-format[1].  Some of these checks
+       may restrict the characters allowed in a branch name.
  
 +-l::
 +      Create the new branch's ref log.  This activates recording of
 +      all changes to made the branch ref, enabling use of date
 +      based sha1 expressions such as "<branchname>@{yesterday}".
 +
  -m::
        If you have local modifications to one or more files that
        are different between the current branch and the branch to
diff --cc cache.h
Simple merge
diff --cc fetch.c
index fd57684d8fad43c92df8005aa8fe7b2cd9263bbb,f7f8902580f0f5e4eb7a63000f9987e63715cd09..ae92d5212e9d80e8cee9a8af752d1b564dbd09db
+++ b/fetch.c
@@@ -8,10 -8,7 +8,8 @@@
  #include "refs.h"
  
  const char *write_ref = NULL;
 +const char *write_ref_log_details = NULL;
  
- const unsigned char *current_ref = NULL;
  int get_tree = 0;
  int get_history = 0;
  int get_all = 0;
@@@ -212,42 -206,19 +210,41 @@@ int pull(char *target
  
        save_commit_buffer = 0;
        track_object_refs = 0;
-               lock = lock_ref_sha1(write_ref, current_ref, 1);
 +      if (write_ref) {
++              lock = lock_ref_sha1(write_ref, NULL, 0);
 +              if (!lock) {
 +                      error("Can't lock ref %s", write_ref);
 +                      return -1;
 +              }
 +      }
  
-       if (!get_recover) {
+       if (!get_recover)
                for_each_ref(mark_complete);
-       }
  
 -      if (interpret_target(target, sha1))
 -              return error("Could not interpret %s as something to pull",
 -                           target);
 -      if (process(lookup_unknown_object(sha1)))
 +      if (interpret_target(target, sha1)) {
 +              error("Could not interpret %s as something to pull", target);
 +              unlock_ref(lock);
                return -1;
 -      if (loop())
 +      }
 +      if (process(lookup_unknown_object(sha1))) {
 +              unlock_ref(lock);
                return -1;
 -      
 -      if (write_ref)
 -              write_ref_sha1_unlocked(write_ref, sha1);
 +      }
 +      if (loop()) {
 +              unlock_ref(lock);
 +              return -1;
 +      }
 +
 +      if (write_ref) {
 +              if (write_ref_log_details) {
 +                      msg = xmalloc(strlen(write_ref_log_details) + 12);
 +                      sprintf(msg, "fetch from %s", write_ref_log_details);
 +              } else
 +                      msg = NULL;
 +              ret = write_ref_sha1(lock, sha1, msg ? msg : "fetch (unknown)");
 +              if (msg)
 +                      free(msg);
 +              return ret;
 +      }
        return 0;
  }
diff --cc fetch.h
index 0011548de8c3aa085944ac56a1568a433834145f,001a6b8e2dccc02a64266ae804227674ee71338c..841bb1af9cab0c19dda3f0cb5956edaec22f9d3a
+++ b/fetch.h
@@@ -25,12 -25,6 +25,9 @@@ extern int fetch_ref(char *ref, unsigne
  /* If set, the ref filename to write the target value to. */
  extern const char *write_ref;
  
- /* If set, the hash that the current value of write_ref must be. */
- extern const unsigned char *current_ref;
 +/* If set additional text will appear in the ref log. */
 +extern const char *write_ref_log_details;
 +
  /* Set to fetch the target tree. */
  extern int get_tree;
  
diff --cc git-am.sh
Simple merge
diff --cc git-commit.sh
Simple merge