mirror of
https://github.com/git/git.git
synced 2024-11-18 06:54:55 +01:00
Merge branch 'master' into next
* master: Merge branch 'jc/diff' git-commit: make sure we protect against races. git-commit --amend show-branch --topics GIT-VERSION-GEN: squelch unneeded error from "cat version" Merge branch 'ml/cvsserver' annotate: resurrect raw timestamps. Documentation: rev-list --objects-edge Documentation: read-tree --aggressive war on whitespaces: documentation.
This commit is contained in:
commit
810e300d4c
11 changed files with 134 additions and 15 deletions
|
@ -9,7 +9,8 @@ git-am - Apply a series of patches in a mailbox
|
|||
SYNOPSIS
|
||||
--------
|
||||
[verse]
|
||||
'git-am' [--signoff] [--dotest=<dir>] [--utf8] [--binary] [--3way] <mbox>...
|
||||
'git-am' [--signoff] [--dotest=<dir>] [--utf8] [--binary] [--3way]
|
||||
[--interactive] [--whitespace=<option>] <mbox>...
|
||||
'git-am' [--skip | --resolved]
|
||||
|
||||
DESCRIPTION
|
||||
|
@ -46,6 +47,10 @@ OPTIONS
|
|||
Skip the current patch. This is only meaningful when
|
||||
restarting an aborted patch.
|
||||
|
||||
--whitespace=<option>::
|
||||
This flag is passed to the `git-apply` program that applies
|
||||
the patch.
|
||||
|
||||
--interactive::
|
||||
Run interactively, just like git-applymbox.
|
||||
|
||||
|
@ -80,7 +85,7 @@ names.
|
|||
|
||||
SEE ALSO
|
||||
--------
|
||||
gitlink:git-applymbox[1], gitlink:git-applypatch[1].
|
||||
gitlink:git-applymbox[1], gitlink:git-applypatch[1], gitlink:git-apply[1].
|
||||
|
||||
|
||||
Author
|
||||
|
|
|
@ -11,6 +11,7 @@ SYNOPSIS
|
|||
[verse]
|
||||
'git-apply' [--stat] [--numstat] [--summary] [--check] [--index] [--apply]
|
||||
[--no-add] [--index-info] [--allow-binary-replacement] [-z] [-pNUM]
|
||||
[--whitespace=<nowarn|warn|error|error-all|strip>]
|
||||
[<patch>...]
|
||||
|
||||
DESCRIPTION
|
||||
|
@ -97,6 +98,35 @@ OPTIONS
|
|||
result. This allows binary files to be patched in a
|
||||
very limited way.
|
||||
|
||||
--whitespace=<option>::
|
||||
When applying a patch, detect a new or modified line
|
||||
that ends with trailing whitespaces (this includes a
|
||||
line that solely consists of whitespaces). By default,
|
||||
the command outputs warning messages and applies the
|
||||
patch.
|
||||
When `git-apply` is used for statistics and not applying a
|
||||
patch, it defaults to `nowarn`.
|
||||
You can use different `<option>` to control this
|
||||
behaviour:
|
||||
+
|
||||
* `nowarn` turns off the trailing whitespace warning.
|
||||
* `warn` outputs warnings for a few such errors, but applies the
|
||||
patch (default).
|
||||
* `error` outputs warnings for a few such errors, and refuses
|
||||
to apply the patch.
|
||||
* `error-all` is similar to `error` but shows all errors.
|
||||
* `strip` outputs warnings for a few such errors, strips out the
|
||||
trailing whitespaces and applies the patch.
|
||||
|
||||
|
||||
Configuration
|
||||
-------------
|
||||
|
||||
apply.whitespace::
|
||||
When no `--whitespace` flag is given from the command
|
||||
line, this configuration item is used as the default.
|
||||
|
||||
|
||||
Author
|
||||
------
|
||||
Written by Linus Torvalds <torvalds@osdl.org>
|
||||
|
|
|
@ -8,7 +8,7 @@ git-read-tree - Reads tree information into the index
|
|||
|
||||
SYNOPSIS
|
||||
--------
|
||||
'git-read-tree' (<tree-ish> | [[-m | --reset] [-u | -i]] <tree-ish1> [<tree-ish2> [<tree-ish3>]])
|
||||
'git-read-tree' (<tree-ish> | [[-m [--aggressive]| --reset] [-u | -i]] <tree-ish1> [<tree-ish2> [<tree-ish3>]])
|
||||
|
||||
|
||||
DESCRIPTION
|
||||
|
@ -50,6 +50,19 @@ OPTIONS
|
|||
trees that are not directly related to the current
|
||||
working tree status into a temporary index file.
|
||||
|
||||
--aggressive::
|
||||
Usually a three-way merge by `git-read-tree` resolves
|
||||
the merge for really trivial cases and leaves other
|
||||
cases unresolved in the index, so that Porcelains can
|
||||
implement different merge policies. This flag makes the
|
||||
command to resolve a few more cases internally:
|
||||
+
|
||||
* when one side removes a path and the other side leaves the path
|
||||
unmodified. The resolution is to remove that path.
|
||||
* when both sides remove a path. The resolution is to remove that path.
|
||||
* when both sides adds a path identically. The resolution
|
||||
is to add that path.
|
||||
|
||||
<tree-ish#>::
|
||||
The id of the tree object(s) to be read/merged.
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ SYNOPSIS
|
|||
[ \--all ]
|
||||
[ \--topo-order ]
|
||||
[ \--parents ]
|
||||
[ \--objects [ \--unpacked ] ]
|
||||
[ [\--objects | \--objects-edge] [ \--unpacked ] ]
|
||||
[ \--pretty | \--header ]
|
||||
[ \--bisect ]
|
||||
<commit>... [ \-- <paths>... ]
|
||||
|
@ -53,6 +53,14 @@ OPTIONS
|
|||
which I need to download if I have the commit object 'bar', but
|
||||
not 'foo'".
|
||||
|
||||
--objects-edge::
|
||||
Similar to `--objects`, but also print the IDs of
|
||||
excluded commits refixed with a `-` character. This is
|
||||
used by `git-pack-objects` to build 'thin' pack, which
|
||||
records objects in deltified form based on objects
|
||||
contained in these excluded commits to reduce network
|
||||
traffic.
|
||||
|
||||
--unpacked::
|
||||
Only useful with `--objects`; print the object IDs that
|
||||
are not in packs.
|
||||
|
|
|
@ -7,8 +7,11 @@ DEF_VER=v1.2.GIT
|
|||
# (included in release tarballs), then default
|
||||
if VN=$(git-describe --abbrev=4 HEAD 2>/dev/null); then
|
||||
VN=$(echo "$VN" | sed -e 's/-/./g');
|
||||
else
|
||||
elif test -f version
|
||||
then
|
||||
VN=$(cat version) || VN="$DEF_VER"
|
||||
else
|
||||
VN="$DEF_VER"
|
||||
fi
|
||||
|
||||
VN=$(expr "$VN" : v*'\(.*\)')
|
||||
|
|
2
apply.c
2
apply.c
|
@ -32,7 +32,7 @@ static int no_add = 0;
|
|||
static int show_index_info = 0;
|
||||
static int line_termination = '\n';
|
||||
static const char apply_usage[] =
|
||||
"git-apply [--stat] [--numstat] [--summary] [--check] [--index] [--apply] [--no-add] [--index-info] [--allow-binary-replacement] [-z] [-pNUM] <patch>...";
|
||||
"git-apply [--stat] [--numstat] [--summary] [--check] [--index] [--apply] [--no-add] [--index-info] [--allow-binary-replacement] [-z] [-pNUM] [--whitespace=<nowarn|warn|error|error-all|strip>] <patch>...";
|
||||
|
||||
static enum whitespace_eol {
|
||||
nowarn_whitespace,
|
||||
|
|
|
@ -2,7 +2,8 @@
|
|||
#
|
||||
# Copyright (c) 2005, 2006 Junio C Hamano
|
||||
|
||||
USAGE='[--signoff] [--dotest=<dir>] [--utf8] [--binary] [--3way] <mbox>
|
||||
USAGE='[--signoff] [--dotest=<dir>] [--utf8] [--binary] [--3way]
|
||||
[--interactive] [--whitespace=<option>] <mbox>...
|
||||
or, when resuming [--skip | --resolved]'
|
||||
. git-sh-setup
|
||||
|
||||
|
|
|
@ -15,6 +15,8 @@ ()
|
|||
print STDERR 'Usage: ${\basename $0} [-s] [-S revs-file] file [ revision ]
|
||||
-l, --long
|
||||
Show long rev (Defaults off)
|
||||
-t, --time
|
||||
Show raw timestamp (Defaults off)
|
||||
-r, --rename
|
||||
Follow renames (Defaults on).
|
||||
-S, --rev-file revs-file
|
||||
|
@ -26,9 +28,10 @@ ()
|
|||
exit(1);
|
||||
}
|
||||
|
||||
our ($help, $longrev, $rename, $starting_rev, $rev_file) = (0, 0, 1);
|
||||
our ($help, $longrev, $rename, $rawtime, $starting_rev, $rev_file) = (0, 0, 1);
|
||||
|
||||
my $rc = GetOptions( "long|l" => \$longrev,
|
||||
"time|t" => \$rawtime,
|
||||
"help|h" => \$help,
|
||||
"rename|r" => \$rename,
|
||||
"rev-file|S=s" => \$rev_file);
|
||||
|
@ -411,8 +414,10 @@ sub git_commit_info {
|
|||
}
|
||||
|
||||
sub format_date {
|
||||
if ($rawtime) {
|
||||
return $_[0];
|
||||
}
|
||||
my ($timestamp, $timezone) = split(' ', $_[0]);
|
||||
|
||||
return strftime("%Y-%m-%d %H:%M:%S " . $timezone, gmtime($timestamp));
|
||||
}
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
# Copyright (c) 2005 Linus Torvalds
|
||||
# Copyright (c) 2006 Junio C Hamano
|
||||
|
||||
USAGE='[-a] [-s] [-v] [--no-verify] [-m <message> | -F <logfile> | (-C|-c) <commit>] [-e] [--author <author>] [[-i | -o] <path>...]'
|
||||
USAGE='[-a] [-s] [-v] [--no-verify] [-m <message> | -F <logfile> | (-C|-c) <commit>) [--amend] [-e] [--author <author>] [[-i | -o] <path>...]'
|
||||
SUBDIRECTORY_OK=Yes
|
||||
. git-sh-setup
|
||||
|
||||
|
@ -64,6 +64,22 @@ run_status () {
|
|||
# We always show status for the whole tree.
|
||||
cd "$TOP"
|
||||
|
||||
IS_INITIAL="$initial_commit"
|
||||
REFERENCE=HEAD
|
||||
case "$amend" in
|
||||
t)
|
||||
# If we are amending the initial commit, there
|
||||
# is no HEAD^1.
|
||||
if git-rev-parse --verify "HEAD^1" >/dev/null 2>&1
|
||||
then
|
||||
REFERENCE="HEAD^1"
|
||||
IS_INITIAL=
|
||||
else
|
||||
IS_INITIAL=t
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
# If TMP_INDEX is defined, that means we are doing
|
||||
# "--only" partial commit, and that index file is used
|
||||
# to build the tree for the commit. Otherwise, if
|
||||
|
@ -85,10 +101,10 @@ run_status () {
|
|||
*) echo "# On branch $branch" ;;
|
||||
esac
|
||||
|
||||
if test -z "$initial_commit"
|
||||
if test -z "$IS_INITIAL"
|
||||
then
|
||||
git-diff-index -M --cached --name-status \
|
||||
--diff-filter=MDTCRA HEAD |
|
||||
--diff-filter=MDTCRA $REFERENCE |
|
||||
sed -e '
|
||||
s/\\/\\\\/g
|
||||
s/ /\\ /g
|
||||
|
@ -147,7 +163,7 @@ run_status () {
|
|||
|
||||
if test -n "$verbose"
|
||||
then
|
||||
git-diff-index --cached -M -p --diff-filter=MDTCRA HEAD
|
||||
git-diff-index --cached -M -p --diff-filter=MDTCRA $REFERENCE
|
||||
fi
|
||||
case "$committable" in
|
||||
0)
|
||||
|
@ -173,6 +189,7 @@ also=
|
|||
only=
|
||||
logfile=
|
||||
use_commit=
|
||||
amend=
|
||||
no_edit=
|
||||
log_given=
|
||||
log_message=
|
||||
|
@ -254,6 +271,12 @@ do
|
|||
verify=
|
||||
shift
|
||||
;;
|
||||
--a|--am|--ame|--amen|--amend)
|
||||
amend=t
|
||||
log_given=t$log_given
|
||||
use_commit=HEAD
|
||||
shift
|
||||
;;
|
||||
-c)
|
||||
case "$#" in 1) usage ;; esac
|
||||
shift
|
||||
|
@ -328,6 +351,15 @@ done
|
|||
################################################################
|
||||
# Sanity check options
|
||||
|
||||
case "$amend,$initial_commit" in
|
||||
t,t)
|
||||
die "You do not have anything to amend." ;;
|
||||
t,)
|
||||
if [ -f "$GIT_DIR/MERGE_HEAD" ]; then
|
||||
die "You are in the middle of a merge -- cannot amend."
|
||||
fi ;;
|
||||
esac
|
||||
|
||||
case "$log_given" in
|
||||
tt*)
|
||||
die "Only one of -c/-C/-F/-m can be used." ;;
|
||||
|
@ -559,13 +591,18 @@ if test -z "$initial_commit"
|
|||
then
|
||||
if [ -f "$GIT_DIR/MERGE_HEAD" ]; then
|
||||
PARENTS="-p HEAD "`sed -e 's/^/-p /' "$GIT_DIR/MERGE_HEAD"`
|
||||
elif test -n "$amend"; then
|
||||
PARENTS=$(git-cat-file commit HEAD |
|
||||
sed -n -e '/^$/q' -e 's/^parent /-p /p')
|
||||
fi
|
||||
current=$(git-rev-parse --verify HEAD)
|
||||
else
|
||||
if [ -z "$(git-ls-files)" ]; then
|
||||
echo >&2 Nothing to commit
|
||||
exit 1
|
||||
fi
|
||||
PARENTS=""
|
||||
current=
|
||||
fi
|
||||
|
||||
{
|
||||
|
|
|
@ -706,7 +706,7 @@ static int read_cache_unmerged(void)
|
|||
return deleted;
|
||||
}
|
||||
|
||||
static const char read_tree_usage[] = "git-read-tree (<sha> | -m [-u | -i] <sha1> [<sha2> [<sha3>]])";
|
||||
static const char read_tree_usage[] = "git-read-tree (<sha> | -m [--aggressive] [-u | -i] <sha1> [<sha2> [<sha3>]])";
|
||||
|
||||
static struct cache_file cache_file;
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
#include "refs.h"
|
||||
|
||||
static const char show_branch_usage[] =
|
||||
"git-show-branch [--current] [--all] [--heads] [--tags] [--topo-order] [--more=count | --list | --independent | --merge-base ] [<refs>...]";
|
||||
"git-show-branch [--current] [--all] [--heads] [--tags] [--topo-order] [--more=count | --list | --independent | --merge-base ] [--topics] [<refs>...]";
|
||||
|
||||
static int default_num = 0;
|
||||
static int default_alloc = 0;
|
||||
|
@ -547,6 +547,7 @@ int main(int ac, char **av)
|
|||
int shown_merge_point = 0;
|
||||
int with_current_branch = 0;
|
||||
int head_at = -1;
|
||||
int topics = 0;
|
||||
|
||||
setup_git_directory();
|
||||
git_config(git_show_branch_config);
|
||||
|
@ -587,6 +588,8 @@ int main(int ac, char **av)
|
|||
independent = 1;
|
||||
else if (!strcmp(arg, "--topo-order"))
|
||||
lifo = 1;
|
||||
else if (!strcmp(arg, "--topics"))
|
||||
topics = 1;
|
||||
else if (!strcmp(arg, "--date-order"))
|
||||
lifo = 0;
|
||||
else
|
||||
|
@ -729,6 +732,20 @@ int main(int ac, char **av)
|
|||
|
||||
if (1 < num_rev) {
|
||||
int is_merge = !!(commit->parents && commit->parents->next);
|
||||
if (topics) {
|
||||
int interesting = 0;
|
||||
for (i = 1; i < num_rev; i++) {
|
||||
if ((this_flag &
|
||||
(1u << (i + REV_SHIFT)))) {
|
||||
interesting = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!interesting)
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
for (i = 0; i < num_rev; i++) {
|
||||
int mark;
|
||||
if (!(this_flag & (1u << (i + REV_SHIFT))))
|
||||
|
|
Loading…
Reference in a new issue