Merge branch 'maint'
authorJunio C Hamano <junkio@cox.net>
Fri, 23 Feb 2007 05:27:37 +0000 (21:27 -0800)
committerJunio C Hamano <junkio@cox.net>
Fri, 23 Feb 2007 05:27:37 +0000 (21:27 -0800)
* maint:
git-diff: fix combined diff
Fix 'git commit -a' in a newly initialized repository
Include git-gui credits file in dist.
Document the new core.bare configuration option.

Documentation/config.txt
Makefile
builtin-diff.c
git-commit.sh
index f5c846f4101c3d83ac6604b1f8b20925fde82857..9d045d88327e8f949f61f2f8e776e4ad44789ca0 100644 (file)
@@ -142,6 +142,18 @@ core.preferSymlinkRefs::
        This is sometimes needed to work with old scripts that
        expect HEAD to be a symbolic link.
 
+core.bare::
+       If true this repository is assumed to be 'bare' and has no
+       working directory associated with it.  If this is the case a
+       number of commands that require a working directory will be
+       disabled, such as gitlink:git-add[1] or gitlink:git-merge[1].
++
+This setting is automatically guessed by gitlink:git-clone[1] or
+gitlink:git-init[1] when the repository was created.  By default a
+repository that ends in "/.git" is assumed to be not bare (bare =
+false), while all other repositories are assumed to be bare (bare
+= true).
+
 core.logAllRefUpdates::
        Updates to a ref <ref> is logged to the file
        "$GIT_DIR/logs/<ref>", by appending the new and old
index 289decddc8865143896ff10fc3248ae460ef0b30..35be5e20496fe072c473639a00ebcaf77cda22f3 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -895,7 +895,8 @@ dist: git.spec git-archive
        $(TAR) rf $(GIT_TARNAME).tar \
                $(GIT_TARNAME)/git.spec \
                $(GIT_TARNAME)/version \
-               $(GIT_TARNAME)/git-gui/version
+               $(GIT_TARNAME)/git-gui/version \
+               $(GIT_TARNAME)/git-gui/credits
        @rm -rf $(GIT_TARNAME)
        gzip -f -9 $(GIT_TARNAME).tar
 
index a6590205e8f746304f3d06d3e328a05bf2bf954e..c387ebb16c6bd353a84abd9454892eeab309ef1e 100644 (file)
@@ -192,7 +192,8 @@ static int builtin_diff_combined(struct rev_info *revs,
        parent = xmalloc(ents * sizeof(*parent));
        /* Again, the revs are all reverse */
        for (i = 0; i < ents; i++)
-               hashcpy((unsigned char*)parent + i, ent[ents - 1 - i].item->sha1);
+               hashcpy((unsigned char *)(parent + i),
+                       ent[ents - 1 - i].item->sha1);
        diff_tree_combined(parent[0], parent + 1, ents - 1,
                           revs->dense_combined_merges, revs);
        return 0;
index ec506d956fa2858897c53b35d28db8083b7fdcec..476f4f18dbb76041fbbfe6243785ad4997a7e7c7 100755 (executable)
@@ -318,6 +318,10 @@ esac
 
 case "$all,$also" in
 t,)
+       if test ! -f "$THIS_INDEX"
+       then
+               die 'nothing to commit (use "git add file1 file2" to include for commit)'
+       fi
        save_index &&
        (
                cd_to_toplevel &&