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
@@@ -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
+++ 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
+++ 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