summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <junkio@cox.net>2006-02-22 00:35:07 -0800
committerLibravatar Junio C Hamano <junkio@cox.net>2006-02-22 00:35:07 -0800
commit752b0fe287185886f9d89ebe126cd2e185d7e063 (patch)
tree41514057ea4ca7f40e9c5a3c9df1fcafdfe6c23e
parentMerge branch 'jc/perl' (diff)
parentgit-push: Update documentation to describe the no-refspec behavior. (diff)
downloadtgif-752b0fe287185886f9d89ebe126cd2e185d7e063.tar.xz
Merge branch 'fix'
* fix: git-push: Update documentation to describe the no-refspec behavior. format-patch: pretty-print timestamp correctly. git-add: Add support for --, documentation, and test.
-rw-r--r--Documentation/git-add.txt7
-rw-r--r--Documentation/git-push.txt6
-rwxr-xr-xgit-add.sh4
-rwxr-xr-xgit-format-patch.sh2
-rwxr-xr-xt/t3700-add.sh22
5 files changed, 39 insertions, 2 deletions
diff --git a/Documentation/git-add.txt b/Documentation/git-add.txt
index 89e461402e..7e293834d1 100644
--- a/Documentation/git-add.txt
+++ b/Documentation/git-add.txt
@@ -7,7 +7,7 @@ git-add - Add files to the index file.
SYNOPSIS
--------
-'git-add' [-n] [-v] <file>...
+'git-add' [-n] [-v] [--] <file>...
DESCRIPTION
-----------
@@ -26,6 +26,11 @@ OPTIONS
-v::
Be verbose.
+--::
+ This option can be used to separate command-line options from
+ the list of files, (useful when filenames might be mistaken
+ for command-line options).
+
DISCUSSION
----------
diff --git a/Documentation/git-push.txt b/Documentation/git-push.txt
index 5b891105b2..6f4a48a109 100644
--- a/Documentation/git-push.txt
+++ b/Documentation/git-push.txt
@@ -43,6 +43,12 @@ to fast forward the remote ref that matches <dst>. If
the optional plus `+` is used, the remote ref is updated
even if it does not result in a fast forward update.
+
+Note: If no explicit refspec is found, (that is neither
+on the command line nor in any Push line of the
+corresponding remotes file---see below), then all the
+refs that exist both on the local side and on the remote
+side are updated.
++
Some short-cut notations are also supported.
+
* `tag <tag>` means the same as `refs/tags/<tag>:refs/tags/<tag>`.
diff --git a/git-add.sh b/git-add.sh
index 13fad820d4..d6a4bc7d09 100755
--- a/git-add.sh
+++ b/git-add.sh
@@ -14,6 +14,10 @@ while : ; do
-v)
verbose=--verbose
;;
+ --)
+ shift
+ break
+ ;;
-*)
usage
;;
diff --git a/git-format-patch.sh b/git-format-patch.sh
index e54c9e4a94..eb75de4601 100755
--- a/git-format-patch.sh
+++ b/git-format-patch.sh
@@ -189,7 +189,7 @@ my @month_names = qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec);
sub show_date {
my ($time, $tz) = @_;
my $minutes = abs($tz);
- $minutes = ($minutes / 100) * 60 + ($minutes % 100);
+ $minutes = int($minutes / 100) * 60 + ($minutes % 100);
if ($tz < 0) {
$minutes = -$minutes;
}
diff --git a/t/t3700-add.sh b/t/t3700-add.sh
new file mode 100755
index 0000000000..6cd05c3d90
--- /dev/null
+++ b/t/t3700-add.sh
@@ -0,0 +1,22 @@
+#!/bin/sh
+#
+# Copyright (c) 2006 Carl D. Worth
+#
+
+test_description='Test of git-add, including the -- option.'
+
+. ./test-lib.sh
+
+test_expect_success \
+ 'Test of git-add' \
+ 'touch foo && git-add foo'
+
+test_expect_success \
+ 'Post-check that foo is in the index' \
+ 'git-ls-files foo | grep foo'
+
+test_expect_success \
+ 'Test that "git-add -- -q" works' \
+ 'touch -- -q && git-add -- -q'
+
+test_done