Merge branch 'js/symlink'
authorJunio C Hamano <junkio@cox.net>
Mon, 5 Mar 2007 01:31:09 +0000 (17:31 -0800)
committerJunio C Hamano <junkio@cox.net>
Mon, 5 Mar 2007 01:31:09 +0000 (17:31 -0800)
* js/symlink:
Tell multi-parent diff about core.symlinks.
Handle core.symlinks=false case in merge-recursive.
Add core.symlinks to mark filesystems that do not support symbolic links.

19 files changed:
Documentation/Makefile
Documentation/RelNotes-1.5.0.3.txt
Documentation/config.txt
Documentation/cvs-migration.txt
Documentation/glossary.txt
Documentation/user-manual.txt
Makefile
builtin-archive.c
builtin-diff-files.c
builtin-diff.c
diff-lib.c
diff.h
git-compat-util.h
git-gc.sh
git-merge.sh
git-svn.perl
git.c
refs.c
utf8.c
index b6d1d8824f39557495ed479c0823f66f792b51f6..7c1c9e1918829b90aeb4e47d10aa0f5951204b0c 100644 (file)
@@ -105,8 +105,11 @@ clean:
 user-manual.xml: user-manual.txt user-manual.conf
        $(ASCIIDOC) -b docbook -d book $<
 
+XSLT = http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl
+XSLTOPTS = --nonet --xinclude --stringparam html.stylesheet docbook-xsl.css
+
 user-manual.html: user-manual.xml
-       xmlto html-nochunks $<
+       xsltproc $(XSLTOPTS) -o $@ $(XSLT) $<
 
 glossary.html : glossary.txt sort_glossary.pl
        cat $< | \
index 90b49cf27da1523326a03c17393fbc07e5572e52..cd500f96bfd73e288577b05cfdfe337d7f2b85bb 100644 (file)
@@ -1,4 +1,4 @@
-GIT v1.5.0.2 Release Notes
+GIT v1.5.0.3 Release Notes
 ==========================
 
 Fixes since v1.5.0.2
@@ -15,6 +15,10 @@ Fixes since v1.5.0.2
     path.  Earlier it started in the middle of the path, and
     incorrectly.
 
+  - 'git-merge' did not exit with non-zero status when the
+    working tree was dirty and cannot fast forward.  It does
+    now.
+
   - 'cvsexportcommit' does not lose yet-to-be-used message file.
 
   - int-vs-size_t typefix when running combined diff on files
@@ -38,18 +42,17 @@ Fixes since v1.5.0.2
   - 'git index-pack' did not protect itself from getting a short
     read out of pread(2).
 
+  - 'git http-push' had a few buffer overruns.
+
+  - Build dependency fixes to rebuild fetch.o when other headers
+    change.
+
 * Documentation updates
 
-  - options to 'git remote add' were described insufficiently.
+  - user-manual updates.
 
+  - Options to 'git remote add' were described insufficiently.
 
----
-exec >/var/tmp/1
-O=v1.5.0.2
-O=v1.5.0.2-16-gdb554bf
-echo O=`git describe maint`
-git shortlog --no-merges $O..maint
+  - Configuration format.suffix was not documented.
 
-# Local Variables:
-# mode: text
-# End:
+  - Other formatting and spelling fixes.
index b809772b866c74ed28b170a1284b6bc59646ecda..5408dd67d316ce3334f2843267a604f5a4ea044b 100644 (file)
@@ -348,6 +348,11 @@ format.headers::
        Additional email headers to include in a patch to be submitted
        by mail.  See gitlink:git-format-patch[1].
 
+format.suffix::
+       The default for format-patch is to output files with the suffix
+       `.patch`. Use this variable to change that suffix (make sure to
+       include the dot if you want it).
+
 gc.packrefs::
        `git gc` does not run `git pack-refs` in a bare repository by
        default so that older dumb-transport clients can still fetch
index 764cc560b4aeeb7248d94f939c976634bd395823..3b6b494162de6993ee6ffb6142fcc85b73609d9c 100644 (file)
@@ -109,7 +109,7 @@ sure it is in your path.  Then cd to a checked out CVS working directory
 of the project you are interested in and run gitlink:git-cvsimport[1]:
 
 -------------------------------------------
-$ git cvsimport -C <destination>
+$ git cvsimport -C <destination> <module>
 -------------------------------------------
 
 This puts a git archive of the named CVS module in the directory
index d20eb6270cd795ab61b281154a7e24070519b7fb..9f446241e2dabee4b93f5c1625351f2260e73717 100644 (file)
@@ -73,6 +73,11 @@ DAG::
        objects is acyclic (there is no chain which begins and ends with the
        same object).
 
+dangling object::
+       An unreachable object which is not reachable even from other
+       unreachable objects; a dangling object has no references to it
+       from any reference or object in the repository.
+
 dircache::
        You are *waaaaay* behind.
 
@@ -350,6 +355,10 @@ tag::
 unmerged index::
        An index which contains unmerged index entries.
 
+unreachable object::
+       An object which is not reachable from a branch, tag, or any
+       other reference.
+
 working tree::
        The set of files and directories currently being worked on,
        i.e. you can work in your working tree without using git at all.
index 34e965104b892ff0353064f254414cb744da85d4..ffd673ec335c3d85d6815dcfdc3e1bfd019f8551 100644 (file)
@@ -391,15 +391,20 @@ index 8be626f..d7aac9d 100644
 As you can see, a commit shows who made the latest change, what they
 did, and why.
 
-Every commit has a 40-hexdigit id, sometimes called the "object name"
-or the "SHA1 id", shown on the first line of the "git show" output.
-You can usually refer to a commit by a shorter name, such as a tag or a
-branch name, but this longer name can also be useful.  Most
-importantly, it is a globally unique name for this commit: so if you
-tell somebody else the object name (for example in email), then you are
-guaranteed that name will refer to the same commit in their repository
-that it does in yours (assuming their repository has that commit at
-all).
+Every commit has a 40-hexdigit id, sometimes called the "object name" or the
+"SHA1 id", shown on the first line of the "git show" output.  You can usually
+refer to a commit by a shorter name, such as a tag or a branch name, but this
+longer name can also be useful.  Most importantly, it is a globally unique
+name for this commit: so if you tell somebody else the object name (for
+example in email), then you are guaranteed that name will refer to the same
+commit in their repository that it does in yours (assuming their repository
+has that commit at all).  Since the object name is computed as a hash over the
+contents of the commit, you are guaranteed that the commit can never change
+without its name also changing.
+
+In fact, in <<git-internals>> we shall see that everything stored in git
+history, including file data and directory contents, is stored in an object
+with a name that is a hash of its contents.
 
 Understanding history: commits, parents, and reachability
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -1163,18 +1168,46 @@ the working tree in a special state that gives you all the
 information you need to help resolve the merge.
 
 Files with conflicts are marked specially in the index, so until you
-resolve the problem and update the index, git commit will fail:
+resolve the problem and update the index, gitlink:git-commit[1] will
+fail:
 
 -------------------------------------------------
 $ git commit
 file.txt: needs merge
 -------------------------------------------------
 
-Also, git status will list those files as "unmerged".
+Also, gitlink:git-status[1] will list those files as "unmerged", and the
+files with conflicts will have conflict markers added, like this:
+
+-------------------------------------------------
+<<<<<<< HEAD:file.txt
+Hello world
+=======
+Goodbye
+>>>>>>> 77976da35a11db4580b80ae27e8d65caf5208086:file.txt
+-------------------------------------------------
+
+All you need to do is edit the files to resolve the conflicts, and then
+
+-------------------------------------------------
+$ git add file.txt
+$ git commit
+-------------------------------------------------
+
+Note that the commit message will already be filled in for you with
+some information about the merge.  Normally you can just use this
+default message unchanged, but you may add additional commentary of
+your own if desired.
+
+The above is all you need to know to resolve a simple merge.  But git
+also provides more information to help resolve conflicts:
+
+Getting conflict-resolution help during a merge
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 All of the changes that git was able to merge automatically are
 already added to the index file, so gitlink:git-diff[1] shows only
-the conflicts.  Also, it uses a somewhat unusual syntax:
+the conflicts.  It uses an unusual syntax:
 
 -------------------------------------------------
 $ git diff
@@ -1195,14 +1228,32 @@ conflict will have two parents instead of the usual one: one parent
 will be HEAD, the tip of the current branch; the other will be the
 tip of the other branch, which is stored temporarily in MERGE_HEAD.
 
-The diff above shows the differences between the working-tree version
-of file.txt and two previous versions: one version from HEAD, and one
-from MERGE_HEAD.  So instead of preceding each line by a single "+"
-or "-", it now uses two columns: the first column is used for
-differences between the first parent and the working directory copy,
-and the second for differences between the second parent and the
-working directory copy.  Thus after resolving the conflict in the
-obvious way, the diff will look like:
+During the merge, the index holds three versions of each file.  Each of
+these three "file stages" represents a different version of the file:
+
+-------------------------------------------------
+$ git show :1:file.txt # the file in a common ancestor of both branches
+$ git show :2:file.txt # the version from HEAD, but including any
+                       # nonconflicting changes from MERGE_HEAD
+$ git show :3:file.txt # the version from MERGE_HEAD, but including any
+                       # nonconflicting changes from HEAD.
+-------------------------------------------------
+
+Since the stage 2 and stage 3 versions have already been updated with
+nonconflicting changes, the only remaining differences between them are
+the important ones; thus gitlink:git-diff[1] can use the information in
+the index to show only those conflicts.
+
+The diff above shows the differences between the working-tree version of
+file.txt and the stage 2 and stage 3 versions.  So instead of preceding
+each line by a single "+" or "-", it now uses two columns: the first
+column is used for differences between the first parent and the working
+directory copy, and the second for differences between the second parent
+and the working directory copy.  (See the "COMBINED DIFF FORMAT" section
+of gitlink:git-diff-files[1] for a details of the format.)
+
+After resolving the conflict in the obvious way (but before updating the
+index), the diff will look like:
 
 -------------------------------------------------
 $ git diff
@@ -1220,26 +1271,37 @@ This shows that our resolved version deleted "Hello world" from the
 first parent, deleted "Goodbye" from the second parent, and added
 "Goodbye world", which was previously absent from both.
 
-The gitlink:git-log[1] command also provides special help for merges:
+Some special diff options allow diffing the working directory against
+any of these stages:
+
+-------------------------------------------------
+$ git diff -1 file.txt         # diff against stage 1
+$ git diff --base file.txt     # same as the above
+$ git diff -2 file.txt         # diff against stage 2
+$ git diff --ours file.txt     # same as the above
+$ git diff -3 file.txt         # diff against stage 3
+$ git diff --theirs file.txt   # same as the above.
+-------------------------------------------------
+
+The gitlink:git-log[1] and gitk[1] commands also provide special help
+for merges:
 
 -------------------------------------------------
 $ git log --merge
+$ gitk --merge
 -------------------------------------------------
 
-This will list all commits which exist only on HEAD or on MERGE_HEAD,
-and which touch an unmerged file.
+These will display all commits which exist only on HEAD or on
+MERGE_HEAD, and which touch an unmerged file.
 
-We can now add the resolved version to the index and commit:
+Each time you resolve the conflicts in a file and update the index:
 
 -------------------------------------------------
 $ git add file.txt
-$ git commit
 -------------------------------------------------
 
-Note that the commit message will already be filled in for you with
-some information about the merge.  Normally you can just use this
-default message unchanged, but you may add additional commentary of
-your own if desired.
+the different stages of that file will be "collapsed", after which
+git-diff will (by default) no longer show diffs for that file.
 
 [[undoing-a-merge]]
 undoing a merge
@@ -1255,7 +1317,7 @@ $ git reset --hard HEAD
 Or, if you've already commited the merge that you want to throw away,
 
 -------------------------------------------------
-$ git reset --hard HEAD^
+$ git reset --hard ORIG_HEAD
 -------------------------------------------------
 
 However, this last command can be dangerous in some cases--never
@@ -1328,6 +1390,7 @@ with the changes to be reverted, then you will be asked to fix
 conflicts manually, just as in the case of <<resolving-a-merge,
 resolving a merge>>.
 
+[[fixing-a-mistake-by-editing-history]]
 Fixing a mistake by editing history
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
@@ -1930,6 +1993,51 @@ return mywork to the state it had before you started the rebase:
 $ git rebase --abort
 -------------------------------------------------
 
+Modifying a single commit
+-------------------------
+
+We saw in <<fixing-a-mistake-by-editing-history>> that you can replace the
+most recent commit using
+
+-------------------------------------------------
+$ git commit --amend
+-------------------------------------------------
+
+which will replace the old commit by a new commit incorporating your
+changes, giving you a chance to edit the old commit message first.
+
+You can also use a combination of this and gitlink:git-rebase[1] to edit
+commits further back in your history.  First, tag the problematic commit with
+
+-------------------------------------------------
+$ git tag bad mywork~5
+-------------------------------------------------
+
+(Either gitk or git-log may be useful for finding the commit.)
+
+Then check out a new branch at that commit, edit it, and rebase the rest of
+the series on top of it:
+
+-------------------------------------------------
+$ git checkout -b TMP bad
+$ # make changes here and update the index
+$ git commit --amend
+$ git rebase --onto TMP bad mywork
+-------------------------------------------------
+
+When you're done, you'll be left with mywork checked out, with the top patches
+on mywork reapplied on top of the modified commit you created in TMP.  You can
+then clean up with
+
+-------------------------------------------------
+$ git branch -d TMP
+$ git tag -d bad
+-------------------------------------------------
+
+Note that the immutable nature of git history means that you haven't really
+"modified" existing commits; instead, you have replaced the old commits with
+new commits having new object names.
+
 Reordering or selecting from a patch series
 -------------------------------------------
 
@@ -2155,6 +2263,7 @@ See gitlink:git-config[1] for more details on the configuration
 options mentioned above.
 
 
+[[git-internals]]
 Git internals
 =============
 
@@ -2936,11 +3045,6 @@ provides.
 Simplify beginning by suggesting disconnected head instead of
 temporary branch creation?
 
-Explain how to refer to file stages in the "how to resolve a merge"
-section: diff -1, -2, -3, --ours, --theirs :1:/path notation.  The
-"git ls-files --unmerged --stage" thing is sorta useful too,
-actually.  And note gitk --merge.
-
 Add more good examples.  Entire sections of just cookbook examples
 might be a good idea; maybe make an "advanced examples" section a
 standard end-of-chapter section?
index 9a37b15439543413506ca20d87c482052b65e035..a221bdc027851270b9920373a3d9cb8d0fbac2e2 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -89,6 +89,9 @@ all::
 #
 # Define NO_ICONV if your libc does not properly support iconv.
 #
+# Define OLD_ICONV if your library has an old iconv(), where the second
+# (input buffer pointer) parameter is declared with type (const char **).
+#
 # Define NO_R_TO_GCC if your gcc does not like "-R/path/lib" that
 # tells runtime paths to dynamic libraries; "-Wl,-rpath=/path/lib"
 # is used instead.
@@ -378,7 +381,6 @@ ifeq ($(uname_O),Cygwin)
        NO_STRCASESTR = YesPlease
        NO_SYMLINK_HEAD = YesPlease
        NEEDS_LIBICONV = YesPlease
-       NO_C99_FORMAT = YesPlease
        NO_FAST_WORKING_DIRECTORY = UnfortunatelyYes
        NO_TRUSTABLE_FILEMODE = UnfortunatelyYes
        # There are conflicting reports about this.
@@ -576,6 +578,10 @@ ifdef NO_ICONV
        BASIC_CFLAGS += -DNO_ICONV
 endif
 
+ifdef OLD_ICONV
+       BASIC_CFLAGS += -DOLD_ICONV
+endif
+
 ifdef PPC_SHA1
        SHA1_HEADER = "ppc/sha1.h"
        LIB_OBJS += ppc/sha1.o ppc/sha1ppc.o
index 8ea6cb1efc4f988fb09051852f9e51fc88b5efd7..2fae885f5c27f73820824b612d41fd37ab91239d 100644 (file)
@@ -252,8 +252,6 @@ int cmd_archive(int argc, const char **argv, const char *prefix)
 
        memset(&ar, 0, sizeof(ar));
        tree_idx = parse_archive_args(argc, argv, &ar);
-       if (prefix == NULL)
-               prefix = setup_git_directory();
 
        argv += tree_idx;
        parse_treeish_arg(argv, &ar.args, prefix);
index e1199f80ae34a53872ca6a74ae9678053e33db14..aec83384298042fc4509605299f82e82745ae675 100644 (file)
@@ -23,7 +23,10 @@ int cmd_diff_files(int argc, const char **argv, const char *prefix)
        git_config(git_default_config); /* no "diff" UI options */
        rev.abbrev = 0;
 
-       argc = setup_revisions(argc, argv, &rev, NULL);
+       if (!setup_diff_no_index(&rev, argc, argv, nongit, prefix))
+               argc = 0;
+       else
+               argc = setup_revisions(argc, argv, &rev, NULL);
        if (!rev.diffopt.output_format)
                rev.diffopt.output_format = DIFF_FORMAT_RAW;
        return run_diff_files_cmd(&rev, argc, argv);
index 28b660a780f9f2ae48acf5e8d3dc7c7aee178de2..4efbb8237bd49e8717a42833b2d9b2db064b45ac 100644 (file)
@@ -215,7 +215,10 @@ int cmd_diff(int argc, const char **argv, const char *prefix)
        git_config(git_diff_ui_config);
        init_revisions(&rev, prefix);
 
-       argc = setup_revisions(argc, argv, &rev, NULL);
+       if (!setup_diff_no_index(&rev, argc, argv, nongit, prefix))
+               argc = 0;
+       else
+               argc = setup_revisions(argc, argv, &rev, NULL);
        if (!rev.diffopt.output_format) {
                rev.diffopt.output_format = DIFF_FORMAT_PATCH;
                if (diff_setup_done(&rev.diffopt) < 0)
index f70888f8af57b3b7a695ecdbc19a3b8bc04c13b2..778cf58244d64b1e1b14ead43c2fdf5735bd717f 100644 (file)
@@ -200,6 +200,72 @@ static int handle_diff_files_args(struct rev_info *revs,
        return 0;
 }
 
+static int is_outside_repo(const char *path, int nongit, const char *prefix)
+{
+       int i;
+       if (nongit || !strcmp(path, "-") || path[0] == '/')
+               return 1;
+       if (prefixcmp(path, "../"))
+               return 0;
+       if (!prefix)
+               return 1;
+       for (i = strlen(prefix); !prefixcmp(path, "../"); ) {
+               while (i > 0 && prefix[i - 1] != '/')
+                       i--;
+               if (--i < 0)
+                       return 1;
+               path += 3;
+       }
+       return 0;
+}
+
+int setup_diff_no_index(struct rev_info *revs,
+               int argc, const char ** argv, int nongit, const char *prefix)
+{
+       int i;
+       for (i = 1; i < argc; i++)
+               if (argv[i][0] != '-')
+                       break;
+               else if (!strcmp(argv[i], "--")) {
+                       i++;
+                       break;
+               } else if (i < argc - 3 && !strcmp(argv[i], "--no-index")) {
+                       i = argc - 3;
+                       break;
+               }
+       if (argc != i + 2 || (!is_outside_repo(argv[i + 1], nongit, prefix) &&
+                               !is_outside_repo(argv[i], nongit, prefix)))
+               return -1;
+
+       diff_setup(&revs->diffopt);
+       for (i = 1; i < argc - 2; )
+               if (!strcmp(argv[i], "--no-index"))
+                       i++;
+               else {
+                       int j = diff_opt_parse(&revs->diffopt,
+                                       argv + i, argc - i);
+                       if (!j)
+                               die("invalid diff option/value: %s", argv[i]);
+                       i += j;
+               }
+
+       if (prefix) {
+               int len = strlen(prefix);
+
+               revs->diffopt.paths = xcalloc(2, sizeof(char*));
+               for (i = 0; i < 2; i++) {
+                       const char *p;
+                       p = prefix_filename(prefix, len, argv[argc - 2 + i]);
+                       revs->diffopt.paths[i] = xstrdup(p);
+               }
+       }
+       else
+               revs->diffopt.paths = argv + argc - 2;
+       revs->diffopt.nr_paths = 2;
+       revs->max_count = -2;
+       return 0;
+}
+
 int run_diff_files_cmd(struct rev_info *revs, int argc, const char **argv)
 {
        int silent_on_removed;
diff --git a/diff.h b/diff.h
index 4043cec04e0ae1da13a6049c9f30c4184f6b1da4..4b435e8b1933222da02f9e4cf2c28d2fef44d292 100644 (file)
--- a/diff.h
+++ b/diff.h
@@ -222,6 +222,8 @@ extern void diff_flush(struct diff_options*);
 extern const char *diff_unique_abbrev(const unsigned char *, int);
 
 extern int run_diff_files(struct rev_info *revs, int silent_on_removed);
+extern int setup_diff_no_index(struct rev_info *revs,
+               int argc, const char ** argv, int nongit, const char *prefix);
 extern int run_diff_files_cmd(struct rev_info *revs, int argc, const char **argv);
 
 extern int run_diff_index(struct rev_info *revs, int cached);
index 5d154faef6bcdbef7ae8ad91b92b08be326af1e1..56212b2f115d0ef738c5835c42d7bf241db4576a 100644 (file)
 #include <netdb.h>
 #include <pwd.h>
 #include <inttypes.h>
+#if defined(__CYGWIN__)
+#undef _XOPEN_SOURCE
+#include <grp.h>
+#define _XOPEN_SOURCE 600
+#else
 #undef _ALL_SOURCE /* AIX 5.3L defines a struct list with _ALL_SOURCE. */
 #include <grp.h>
 #define _ALL_SOURCE 1
+#endif
 
 #ifndef NO_ICONV
 #include <iconv.h>
index 1a45de5dff7763fbca2a9076a4d3bdb0ed903439..436d7caff5c26f7c0ff8c0a410bdabccdec0a900 100755 (executable)
--- a/git-gc.sh
+++ b/git-gc.sh
@@ -4,7 +4,7 @@
 #
 # Cleanup unreachable files and optimize the repository.
 
-USAGE='git-gc [--prune]'
+USAGE='[--prune]'
 SUBDIRECTORY_OK=Yes
 . git-sh-setup
 
index 498c938c4507ccdc27f5a9e30e85f013a067c876..4afcd95316c01e5d1811184c615c4da574ab0717 100755 (executable)
@@ -294,7 +294,7 @@ f,*)
        git-update-index --refresh 2>/dev/null
        new_head=$(git-rev-parse --verify "$1^0") &&
        git-read-tree -v -m -u --exclude-per-directory=.gitignore $head "$new_head" &&
-       finish "$new_head" "Fast forward"
+       finish "$new_head" "Fast forward" || exit
        dropsave
        exit 0
        ;;
index 41961b59f6d7848efbb4e7b91dcb629bbd7d4abb..326e89fe037561c1ad72d91c7783bf2a0f603826 100755 (executable)
@@ -447,7 +447,7 @@ sub cmd_show_ignore {
        my $url = (::working_head_info('HEAD'))[0];
        my $gs = Git::SVN->find_by_url($url) || Git::SVN->new;
        my $r = (defined $_revision ? $_revision : $gs->ra->get_latest_revnum);
-       $gs->traverse_ignore(\*STDOUT, '', $r);
+       $gs->traverse_ignore(\*STDOUT, $gs->{path}, $r);
 }
 
 sub cmd_multi_init {
@@ -1334,7 +1334,7 @@ sub traverse_ignore {
        my $ra = $self->ra;
        my ($dirent, undef, $props) = $ra->get_dir($path, $r);
        my $p = $path;
-       $p =~ s#^\Q$ra->{svn_path}\E/##;
+       $p =~ s#^\Q$self->{path}\E(/|$)##;
        print $fh length $p ? "\n# $p\n" : "\n# /\n";
        if (my $s = $props->{'svn:ignore'}) {
                $s =~ s/[\r\n]+/\n/g;
diff --git a/git.c b/git.c
index 9b37f423216a6e8a86646ba15af642b9f7cc10e6..04fc99a3dd9666bb4c22c99754334aeecc08bab5 100644 (file)
--- a/git.c
+++ b/git.c
@@ -226,7 +226,7 @@ static void handle_internal_command(int argc, const char **argv, char **envp)
                { "add", cmd_add, RUN_SETUP | NOT_BARE },
                { "annotate", cmd_annotate, USE_PAGER },
                { "apply", cmd_apply },
-               { "archive", cmd_archive },
+               { "archive", cmd_archive, RUN_SETUP },
                { "blame", cmd_blame, RUN_SETUP },
                { "branch", cmd_branch, RUN_SETUP },
                { "bundle", cmd_bundle },
diff --git a/refs.c b/refs.c
index d347876c876cfe210896a1f31d2b073849271f28..7a1f89caad17cfb090e683c9888537666e8398b9 100644 (file)
--- a/refs.c
+++ b/refs.c
@@ -1042,7 +1042,9 @@ int create_symref(const char *ref_target, const char *refs_heads_master,
                return -1;
        }
 
+#ifndef NO_SYMLINK_HEAD
        done:
+#endif
        if (logmsg && !read_ref(refs_heads_master, new_sha1))
                log_ref_write(ref_target, old_sha1, new_sha1, logmsg);
 
diff --git a/utf8.c b/utf8.c
index 9e1a6d4964c04f21aff757534f09d013c64f5675..a2965c9c1106b7e772d9b53c8885d86320d18f07 100644 (file)
--- a/utf8.c
+++ b/utf8.c
@@ -3,13 +3,15 @@
 
 /* This code is originally from http://www.cl.cam.ac.uk/~mgk25/ucs/ */
 
+typedef unsigned int ucs_char_t;  /* assuming 32bit int */
+
 struct interval {
   int first;
   int last;
 };
 
 /* auxiliary function for binary search in interval table */
-static int bisearch(wchar_t ucs, const struct interval *table, int max) {
+static int bisearch(ucs_char_t ucs, const struct interval *table, int max) {
        int min = 0;
        int mid;
 
@@ -56,11 +58,11 @@ static int bisearch(wchar_t ucs, const struct interval *table, int max) {
  *      ISO 8859-1 and WGL4 characters, Unicode control characters,
  *      etc.) have a column width of 1.
  *
- * This implementation assumes that wchar_t characters are encoded
+ * This implementation assumes that ucs_char_t characters are encoded
  * in ISO 10646.
  */
 
-static int wcwidth(wchar_t ch)
+static int wcwidth(ucs_char_t ch)
 {
        /*
         * Sorted list of non-overlapping intervals of non-spacing characters,
@@ -157,7 +159,7 @@ static int wcwidth(wchar_t ch)
 int utf8_width(const char **start)
 {
        unsigned char *s = (unsigned char *)*start;
-       wchar_t ch;
+       ucs_char_t ch;
 
        if (*s < 0x80) {
                /* 0xxxxxxx */
@@ -298,11 +300,17 @@ int is_encoding_utf8(const char *name)
  * with iconv.  If the conversion fails, returns NULL.
  */
 #ifndef NO_ICONV
+#ifdef OLD_ICONV
+       typedef const char * iconv_ibp;
+#else
+       typedef char * iconv_ibp;
+#endif
 char *reencode_string(const char *in, const char *out_encoding, const char *in_encoding)
 {
        iconv_t conv;
        size_t insz, outsz, outalloc;
-       char *out, *outpos, *cp;
+       char *out, *outpos;
+       iconv_ibp cp;
 
        if (!in_encoding)
                return NULL;
@@ -314,7 +322,7 @@ char *reencode_string(const char *in, const char *out_encoding, const char *in_e
        outalloc = outsz + 1; /* for terminating NUL */
        out = xmalloc(outalloc);
        outpos = out;
-       cp = (char *)in;
+       cp = (iconv_ibp)in;
 
        while (1) {
                size_t cnt = iconv(conv, &cp, &insz, &outpos, &outsz);