Skip to content

Commit

Permalink
Merge branch 'fix'
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
Junio C Hamano committed Feb 22, 2006
2 parents 6b98579 + aa06474 commit 752b0fe
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 2 deletions.
7 changes: 6 additions & 1 deletion Documentation/git-add.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ git-add - Add files to the index file.

SYNOPSIS
--------
'git-add' [-n] [-v] <file>...
'git-add' [-n] [-v] [--] <file>...

DESCRIPTION
-----------
Expand All @@ -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
----------
Expand Down
6 changes: 6 additions & 0 deletions Documentation/git-push.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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>`.
Expand Down
4 changes: 4 additions & 0 deletions git-add.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ while : ; do
-v)
verbose=--verbose
;;
--)
shift
break
;;
-*)
usage
;;
Expand Down
2 changes: 1 addition & 1 deletion git-format-patch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
22 changes: 22 additions & 0 deletions t/t3700-add.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 752b0fe

Please sign in to comment.