Code

Merge fixes up to GIT 1.0.4
authorJunio C Hamano <junkio@cox.net>
Sat, 24 Dec 2005 08:16:56 +0000 (00:16 -0800)
committerJunio C Hamano <junkio@cox.net>
Sat, 24 Dec 2005 08:16:56 +0000 (00:16 -0800)
Documentation/git-ls-files.txt
debian/changelog
git-merge.sh
ls-files.c
mailinfo.c
show-branch.c

index 2f308ecda9d039224d2714e4cfd209422605430f..186f3bb57a6d77da9705860d730cf8cd3c9d867f 100644 (file)
@@ -13,7 +13,8 @@ SYNOPSIS
                (-[c|d|o|i|s|u|k|m])\*
                [-x <pattern>|--exclude=<pattern>]
                [-X <file>|--exclude-from=<file>]
-               [--exclude-per-directory=<file>] [--] [<file>]\*
+               [--exclude-per-directory=<file>] 
+               [--full-name] [--] [<file>]\*
 
 DESCRIPTION
 -----------
@@ -77,6 +78,12 @@ OPTIONS
        K::     to be killed
        ?       other
 
+--full-name::
+       When run from a subdirectory, the command usually
+       outputs paths relative to the current directory.  This
+       option forces paths to be output relative to the project
+       top directory.
+
 --::
        Do not interpret any more arguments as options.
 
index 8d6c0667c7dc9c8ef92ba494d0ddc625e0f01260..d7f75910798c14e21107c26c97f76292fb3c62a9 100644 (file)
@@ -10,6 +10,12 @@ git-core (1.0.0.GIT-0) unstable; urgency=low
 
  -- Junio C Hamano <junkio@cox.net>  Wed, 21 Dec 2005 12:12:05 -0800
 
+git-core (1.0.4-0) unstable; urgency=low
+
+  * GIT 1.0.4.
+
+ -- Junio C Hamano <junkio@cox.net>  Sat, 24 Dec 2005 00:01:20 -0800
+
 git-core (1.0.3-0) unstable; urgency=low
 
   * GIT 1.0.3 maintenance release.
index e50fbb1160ad6ccfebc0d65fcc54bc3488e597cd..0a158ef779eb8717f27e632e31726f00586979ed 100755 (executable)
@@ -209,6 +209,7 @@ case "$use_strategies" in
 esac
 
 result_tree= best_cnt=-1 best_strategy= wt_strategy=
+merge_was_ok=
 for strategy in $use_strategies
 do
     test "$wt_strategy" = '' || {
@@ -228,6 +229,7 @@ do
     exit=$?
     if test "$no_commit" = t && test "$exit" = 0
     then
+        merge_was_ok=t
        exit=1 ;# pretend it left conflicts.
     fi
 
@@ -293,4 +295,11 @@ do
 done >"$GIT_DIR/MERGE_HEAD"
 echo $merge_msg >"$GIT_DIR/MERGE_MSG"
 
-die "Automatic merge failed/prevented; fix up by hand"
+if test "$merge_was_ok" = t
+then
+       echo >&2 \
+       "Automatic merge went well; stopped before committing as requested"
+       exit 0
+else
+       die "Automatic merge failed; fix up by hand"
+fi
index f3f1a6a6633881bf43887731fdcbe08af9ad2f4a..5e9ac712af069e773fd7dd562706384b45683753 100644 (file)
@@ -562,7 +562,7 @@ static void verify_pathspec(void)
 static const char ls_files_usage[] =
        "git-ls-files [-z] [-t] (--[cached|deleted|others|stage|unmerged|killed|modified])* "
        "[ --ignored ] [--exclude=<pattern>] [--exclude-from=<file>] "
-       "[ --exclude-per-directory=<filename> ] [--] [<file>]*";
+       "[ --exclude-per-directory=<filename> ] [--full-name] [--] [<file>]*";
 
 int main(int argc, const char **argv)
 {
index 9f95f37651e2ce5a3930051fe875f1c16ede97c2..0265a29a3855902e25e44099663c2973bbe9f53e 100644 (file)
@@ -472,7 +472,7 @@ static void convert_to_utf8(char *line, char *charset)
        char *in, *out;
        size_t insize, outsize, nrc;
        char outbuf[4096]; /* cheat */
-       static char latin_one[] = "latin-1";
+       static char latin_one[] = "latin1";
        char *input_charset = *charset ? charset : latin_one;
        iconv_t conv = iconv_open(metainfo_charset, input_charset);
 
index 3fe62b7177241aaf0512b586e2dfe862d3b66b9c..15b1968781178c8aa939a79ed5a7f8fb363d181e 100644 (file)
@@ -284,10 +284,54 @@ static void show_one_commit(struct commit *commit, int no_name)
 static char *ref_name[MAX_REVS + 1];
 static int ref_name_cnt;
 
+static const char *find_digit_prefix(const char *s, int *v)
+{
+       const char *p;
+       int ver;
+       char ch;
+
+       for (p = s, ver = 0;
+            '0' <= (ch = *p) && ch <= '9';
+            p++)
+               ver = ver * 10 + ch - '0';
+       *v = ver;
+       return p;
+}
+
+
+static int version_cmp(const char *a, const char *b)
+{
+       while (1) {
+               int va, vb;
+
+               a = find_digit_prefix(a, &va);
+               b = find_digit_prefix(b, &vb);
+               if (va != vb)
+                       return va - vb;
+
+               while (1) {
+                       int ca = *a;
+                       int cb = *b;
+                       if ('0' <= ca && ca <= '9')
+                               ca = 0;
+                       if ('0' <= cb && cb <= '9')
+                               cb = 0;
+                       if (ca != cb)
+                               return ca - cb;
+                       if (!ca)
+                               break;
+                       a++;
+                       b++;
+               }
+               if (!*a && !*b)
+                       return 0;
+       }
+}
+
 static int compare_ref_name(const void *a_, const void *b_)
 {
        const char * const*a = a_, * const*b = b_;
-       return strcmp(*a, *b);
+       return version_cmp(*a, *b);
 }
 
 static void sort_ref_range(int bottom, int top)
@@ -299,8 +343,15 @@ static void sort_ref_range(int bottom, int top)
 static int append_ref(const char *refname, const unsigned char *sha1)
 {
        struct commit *commit = lookup_commit_reference_gently(sha1, 1);
+       int i;
+
        if (!commit)
                return 0;
+       /* Avoid adding the same thing twice */
+       for (i = 0; i < ref_name_cnt; i++)
+               if (!strcmp(refname, ref_name[i]))
+                       return 0;
+
        if (MAX_REVS <= ref_name_cnt) {
                fprintf(stderr, "warning: ignoring %s; "
                        "cannot handle more than %d refs\n",
@@ -512,19 +563,17 @@ int main(int ac, char **av)
        if (1 < independent + merge_base + (extra != 0))
                usage(show_branch_usage);
 
+       /* If nothing is specified, show all branches by default */
+       if (ac + all_heads + all_tags == 0)
+               all_heads = 1;
+
        if (all_heads + all_tags)
                snarf_refs(all_heads, all_tags);
-
-       if (ac) {
-               while (0 < ac) {
-                       append_one_rev(*av);
-                       ac--; av++;
-               }
-       }
-       else {
-               /* If no revs given, then add heads */
-               snarf_refs(1, 0);
+       while (0 < ac) {
+               append_one_rev(*av);
+               ac--; av++;
        }
+
        if (!ref_name_cnt) {
                fprintf(stderr, "No revs to be shown.\n");
                exit(0);