]> asedeno.scripts.mit.edu Git - git.git/commitdiff
Merge branch 'kh/commit'
authorJunio C Hamano <gitster@pobox.com>
Wed, 5 Dec 2007 01:16:33 +0000 (17:16 -0800)
committerJunio C Hamano <gitster@pobox.com>
Wed, 5 Dec 2007 01:16:33 +0000 (17:16 -0800)
* kh/commit: (33 commits)
  git-commit --allow-empty
  git-commit: Allow to amend a merge commit that does not change the tree
  quote_path: fix collapsing of relative paths
  Make git status usage say git status instead of git commit
  Fix --signoff in builtin-commit differently.
  git-commit: clean up die messages
  Do not generate full commit log message if it is not going to be used
  Remove git-status from list of scripts as it is builtin
  Fix off-by-one error when truncating the diff out of the commit message.
  builtin-commit.c: export GIT_INDEX_FILE for launch_editor as well.
  Add a few more tests for git-commit
  builtin-commit: Include the diff in the commit message when verbose.
  builtin-commit: fix partial-commit support
  Fix add_files_to_cache() to take pathspec, not user specified list of files
  Export three helper functions from ls-files
  builtin-commit: run commit-msg hook with correct message file
  builtin-commit: do not color status output shown in the message template
  file_exists(): dangling symlinks do exist
  Replace "runstatus" with "status" in the tests
  t7501-commit: Add test for git commit <file> with dirty index.
  ...

12 files changed:
1  2 
.gitignore
Makefile
builtin-tag.c
builtin.h
cache.h
contrib/examples/git-commit.sh
dir.c
git.c
ident.c
t/t4001-diff-rename.sh
t/t7501-commit.sh
wt-status.c

diff --cc .gitignore
Simple merge
diff --cc Makefile
index ed0c5d113c4e169aa1342b32b8cd87a798559daf,625b9c337c4afd66cb5e5cd9171c682d8a3bce4a..eb2dd5def3458bf11e084bf1a46624511393ec67
+++ b/Makefile
@@@ -213,7 -213,8 +213,7 @@@ BASIC_LDFLAGS 
  
  SCRIPT_SH = \
        git-bisect.sh git-checkout.sh \
-       git-clone.sh git-commit.sh \
 -      git-clean.sh git-clone.sh \
 -      git-ls-remote.sh \
++      git-clone.sh \
        git-merge-one-file.sh git-mergetool.sh git-parse-remote.sh \
        git-pull.sh git-rebase.sh git-rebase--interactive.sh \
        git-repack.sh git-request-pull.sh \
@@@ -259,7 -260,7 +259,7 @@@ EXTRA_PROGRAMS 
  BUILT_INS = \
        git-format-patch$X git-show$X git-whatchanged$X git-cherry$X \
        git-get-tar-commit-id$X git-init$X git-repo-config$X \
-       git-fsck-objects$X git-cherry-pick$X git-peek-remote$X \
 -      git-fsck-objects$X git-cherry-pick$X git-status$X\
++      git-fsck-objects$X git-cherry-pick$X git-peek-remote$X git-status$X \
        $(patsubst builtin-%.o,git-%$X,$(BUILTIN_OBJS))
  
  # what 'all' will build and 'install' will install, in gitexecdir
@@@ -326,7 -330,7 +326,8 @@@ BUILTIN_OBJS = 
        builtin-check-attr.o \
        builtin-checkout-index.o \
        builtin-check-ref-format.o \
 +      builtin-clean.o \
+       builtin-commit.o \
        builtin-commit-tree.o \
        builtin-count-objects.o \
        builtin-describe.o \
diff --cc builtin-tag.c
Simple merge
diff --cc builtin.h
index 3c1bf38d83c9a1ebf4a1036114a158b58a6c1b75,caea1a94e40f2e103b75694fa14d17f628d29935..cb675c4d7a80b99a06d6d04156e767ea025eb512
+++ b/builtin.h
@@@ -24,7 -24,7 +24,8 @@@ extern int cmd_check_attr(int argc, con
  extern int cmd_check_ref_format(int argc, const char **argv, const char *prefix);
  extern int cmd_cherry(int argc, const char **argv, const char *prefix);
  extern int cmd_cherry_pick(int argc, const char **argv, const char *prefix);
 +extern int cmd_clean(int argc, const char **argv, const char *prefix);
+ extern int cmd_commit(int argc, const char **argv, const char *prefix);
  extern int cmd_commit_tree(int argc, const char **argv, const char *prefix);
  extern int cmd_count_objects(int argc, const char **argv, const char *prefix);
  extern int cmd_describe(int argc, const char **argv, const char *prefix);
@@@ -72,8 -70,6 +73,7 @@@ extern int cmd_rev_list(int argc, cons
  extern int cmd_rev_parse(int argc, const char **argv, const char *prefix);
  extern int cmd_revert(int argc, const char **argv, const char *prefix);
  extern int cmd_rm(int argc, const char **argv, const char *prefix);
- extern int cmd_runstatus(int argc, const char **argv, const char *prefix);
 +extern int cmd_send_pack(int argc, const char **argv, const char *prefix);
  extern int cmd_shortlog(int argc, const char **argv, const char *prefix);
  extern int cmd_show(int argc, const char **argv, const char *prefix);
  extern int cmd_show_branch(int argc, const char **argv, const char *prefix);
diff --cc cache.h
Simple merge
Simple merge
diff --cc dir.c
Simple merge
diff --cc git.c
index c4877a9714c227a1af77cfa84caa2230eb30bf9d,a5adc3487d4ca62a9ff93679ce8711a578a5c3eb..15fec8974ad5361a2308b3c46424e896bc8e3246
--- 1/git.c
--- 2/git.c
+++ b/git.c
@@@ -293,7 -293,7 +293,8 @@@ static void handle_internal_command(in
                { "check-attr", cmd_check_attr, RUN_SETUP | NEED_WORK_TREE },
                { "cherry", cmd_cherry, RUN_SETUP },
                { "cherry-pick", cmd_cherry_pick, RUN_SETUP | NEED_WORK_TREE },
 +              { "clean", cmd_clean, RUN_SETUP | NEED_WORK_TREE },
+               { "commit", cmd_commit, RUN_SETUP | NEED_WORK_TREE },
                { "commit-tree", cmd_commit_tree, RUN_SETUP },
                { "config", cmd_config },
                { "count-objects", cmd_count_objects, RUN_SETUP },
                { "rev-parse", cmd_rev_parse },
                { "revert", cmd_revert, RUN_SETUP | NEED_WORK_TREE },
                { "rm", cmd_rm, RUN_SETUP },
-               { "runstatus", cmd_runstatus, RUN_SETUP | NEED_WORK_TREE },
 +              { "send-pack", cmd_send_pack, RUN_SETUP },
                { "shortlog", cmd_shortlog, RUN_SETUP | USE_PAGER },
                { "show-branch", cmd_show_branch, RUN_SETUP },
                { "show", cmd_show, RUN_SETUP | USE_PAGER },
diff --cc ident.c
Simple merge
Simple merge
index 0316ecf5a16792f226725eb9626ad77c369877bb,ce83af3a02427af8c6a5fbea921a46ed5522b8b3..19c4b2c5566dcd6a88b8b557d4d597079df21b4e
@@@ -244,43 -242,29 +244,70 @@@ test_expect_success 'multiple -m' 
  
  '
  
+ author="The Real Author <someguy@his.email.org>"
+ test_expect_success 'amend commit to fix author' '
+       oldtick=$GIT_AUTHOR_DATE &&
+       test_tick &&
+       git reset --hard &&
+       git cat-file -p HEAD |
+       sed -e "s/author.*/author $author $oldtick/" \
+               -e "s/^\(committer.*> \).*$/\1$GIT_COMMITTER_DATE/" > \
+               expected &&
+       git commit --amend --author="$author" &&
+       git cat-file -p HEAD > current &&
+       diff expected current
+ '
+ test_expect_success 'git commit <file> with dirty index' '
+       echo tacocat > elif &&
+       echo tehlulz > chz &&
+       git add chz &&
+       git commit elif -m "tacocat is a palindrome" &&
+       git show --stat | grep elif &&
+       git diff --cached | grep chz
+ '
 +test_expect_success 'same tree (single parent)' '
 +
++      git reset --hard
++
 +      if git commit -m empty
 +      then
 +              echo oops -- should have complained
 +              false
 +      else
 +              : happy
 +      fi
 +
 +'
 +
 +test_expect_success 'same tree (single parent) --allow-empty' '
 +
 +      git commit --allow-empty -m "forced empty" &&
 +      git cat-file commit HEAD | grep forced
 +
 +'
 +
 +test_expect_success 'same tree (merge and amend merge)' '
 +
 +      git checkout -b side HEAD^ &&
 +      echo zero >zero &&
 +      git add zero &&
 +      git commit -m "add zero" &&
 +      git checkout master &&
 +
 +      git merge -s ours side -m "empty ok" &&
 +      git diff HEAD^ HEAD >actual &&
 +      : >expected &&
 +      diff -u expected actual &&
 +
 +      git commit --amend -m "empty really ok" &&
 +      git diff HEAD^ HEAD >actual &&
 +      : >expected &&
 +      diff -u expected actual
 +
 +'
 +
  test_done
diff --cc wt-status.c
Simple merge