Merge branch 'maint'
* maint: git-clean: honor core.excludesfile Documentation: Fix man page breakage with DocBook XSL v1.72 git-remote.txt: fix typo core-tutorial.txt: Fix argument mistake in an example. replace reference to git-rm with git-reset in git-commit doc Grammar fixes for gitattributes documentation Don't allow fast-import tree delta chains to exceed maximum depth revert/cherry-pick: allow starting from dirty work tree. t/t3404: fix test for a bogus todo file. Conflicts: fast-import.c
This commit is contained in:
commit
fb5fd01148
@ -37,9 +37,6 @@ man7dir=$(mandir)/man7
|
||||
|
||||
ASCIIDOC=asciidoc
|
||||
ASCIIDOC_EXTRA =
|
||||
ifdef ASCIIDOC8
|
||||
ASCIIDOC_EXTRA += -a asciidoc7compatible
|
||||
endif
|
||||
INSTALL?=install
|
||||
RM ?= rm -f
|
||||
DOC_REF = origin/man
|
||||
@ -52,6 +49,13 @@ DOCBOOK2X_TEXI=docbook2x-texi
|
||||
-include ../config.mak.autogen
|
||||
-include ../config.mak
|
||||
|
||||
ifdef ASCIIDOC8
|
||||
ASCIIDOC_EXTRA += -a asciidoc7compatible
|
||||
endif
|
||||
ifdef DOCBOOK_XSL_172
|
||||
ASCIIDOC_EXTRA += -a docbook-xsl-172
|
||||
endif
|
||||
|
||||
#
|
||||
# Please note that there is a minor bug in asciidoc.
|
||||
# The version after 6.0.3 _will_ include the patch found here:
|
||||
|
@ -23,7 +23,9 @@ ifdef::backend-docbook[]
|
||||
endif::backend-docbook[]
|
||||
|
||||
ifdef::backend-docbook[]
|
||||
ifndef::docbook-xsl-172[]
|
||||
# "unbreak" docbook-xsl v1.68 for manpages. v1.69 works with or without this.
|
||||
# v1.72 breaks with this because it replaces dots not in roff requests.
|
||||
[listingblock]
|
||||
<example><title>{title}</title>
|
||||
<literallayout>
|
||||
@ -36,6 +38,7 @@ ifdef::doctype-manpage[]
|
||||
endif::doctype-manpage[]
|
||||
</literallayout>
|
||||
{title#}</example>
|
||||
endif::docbook-xsl-172[]
|
||||
endif::backend-docbook[]
|
||||
|
||||
ifdef::doctype-manpage[]
|
||||
|
@ -1152,7 +1152,7 @@ back to the earlier repository with "hello" and "example" file,
|
||||
and bring ourselves back to the pre-merge state:
|
||||
|
||||
------------
|
||||
$ git show-branch --more=3 master mybranch
|
||||
$ git show-branch --more=2 master mybranch
|
||||
! [master] Merge work in mybranch
|
||||
* [mybranch] Merge work in mybranch
|
||||
--
|
||||
@ -1215,7 +1215,7 @@ $ git-read-tree -m -u $mb HEAD mybranch
|
||||
This is the same `git-read-tree` command we have already seen,
|
||||
but it takes three trees, unlike previous examples. This reads
|
||||
the contents of each tree into different 'stage' in the index
|
||||
file (the first tree goes to stage 1, the second stage 2,
|
||||
file (the first tree goes to stage 1, the second to stage 2,
|
||||
etc.). After reading three trees into three stages, the paths
|
||||
that are the same in all three stages are 'collapsed' into stage
|
||||
0. Also paths that are the same in two of three stages are
|
||||
|
@ -224,6 +224,7 @@ See Also
|
||||
--------
|
||||
gitlink:git-status[1]
|
||||
gitlink:git-rm[1]
|
||||
gitlink:git-reset[1]
|
||||
gitlink:git-mv[1]
|
||||
gitlink:git-commit[1]
|
||||
gitlink:git-update-index[1]
|
||||
|
@ -154,10 +154,13 @@ EXAMPLES
|
||||
--------
|
||||
When recording your own work, the contents of modified files in
|
||||
your working tree are temporarily stored to a staging area
|
||||
called the "index" with gitlink:git-add[1]. Removal
|
||||
of a file is staged with gitlink:git-rm[1]. After building the
|
||||
state to be committed incrementally with these commands, `git
|
||||
commit` (without any pathname parameter) is used to record what
|
||||
called the "index" with gitlink:git-add[1]. A file can be
|
||||
reverted back, only in the index but not in the working tree,
|
||||
to that of the last commit with `git-reset HEAD -- <file>`,
|
||||
which effectively reverts `git-add` and prevents the changes to
|
||||
this file from participating in the next commit. After building
|
||||
the state to be committed incrementally with these commands,
|
||||
`git commit` (without any pathname parameter) is used to record what
|
||||
has been staged so far. This is the most basic form of the
|
||||
command. An example:
|
||||
|
||||
|
@ -79,7 +79,7 @@ caution.
|
||||
Fetch updates for a named set of remotes in the repository as defined by
|
||||
remotes.<group>. If a named group is not specified on the command line,
|
||||
the configuration parameter remotes.default will get used; if
|
||||
remotes.default is not defined, all remotes which do not the
|
||||
remotes.default is not defined, all remotes which do not have the
|
||||
configuration parameter remote.<name>.skipDefaultUpdate set to true will
|
||||
be updated. (See gitlink:git-config[1]).
|
||||
|
||||
|
@ -148,22 +148,23 @@ with `$Id$` upon check-in.
|
||||
`filter`
|
||||
^^^^^^^^
|
||||
|
||||
A `filter` attribute can be set to a string value. This names
|
||||
A `filter` attribute can be set to a string value that names a
|
||||
filter driver specified in the configuration.
|
||||
|
||||
A filter driver consists of `clean` command and `smudge`
|
||||
A filter driver consists of a `clean` command and a `smudge`
|
||||
command, either of which can be left unspecified. Upon
|
||||
checkout, when `smudge` command is specified, the command is fed
|
||||
the blob object from its standard input, and its standard output
|
||||
is used to update the worktree file. Similarly, `clean` command
|
||||
is used to convert the contents of worktree file upon checkin.
|
||||
checkout, when the `smudge` command is specified, the command is
|
||||
fed the blob object from its standard input, and its standard
|
||||
output is used to update the worktree file. Similarly, the
|
||||
`clean` command is used to convert the contents of worktree file
|
||||
upon checkin.
|
||||
|
||||
Missing filter driver definition in the config is not an error
|
||||
A missing filter driver definition in the config is not an error
|
||||
but makes the filter a no-op passthru.
|
||||
|
||||
The content filtering is done to massage the content into a
|
||||
shape that is more convenient for the platform, filesystem, and
|
||||
the user to use. The keyword here is "more convenient" and not
|
||||
the user to use. The key phrase here is "more convenient" and not
|
||||
"turning something unusable into usable". In other words, the
|
||||
intent is that if someone unsets the filter driver definition,
|
||||
or does not have the appropriate filter program, the project
|
||||
|
2
Makefile
2
Makefile
@ -115,6 +115,8 @@ all::
|
||||
#
|
||||
# Define ASCIIDOC8 if you want to format documentation with AsciiDoc 8
|
||||
#
|
||||
# Define DOCBOOK_XSL_172 if you want to format man pages with DocBook XSL v1.72.
|
||||
#
|
||||
# Define NO_PERL_MAKEMAKER if you cannot use Makefiles generated by perl's
|
||||
# MakeMaker (e.g. using ActiveState under Cygwin).
|
||||
#
|
||||
|
@ -258,7 +258,7 @@ static int revert_or_cherry_pick(int argc, const char **argv)
|
||||
if (get_sha1("HEAD", head))
|
||||
die ("You do not have a valid HEAD");
|
||||
wt_status_prepare(&s);
|
||||
if (s.commitable || s.workdir_dirty)
|
||||
if (s.commitable)
|
||||
die ("Dirty index: cannot %s", me);
|
||||
discard_cache();
|
||||
}
|
||||
|
@ -153,13 +153,16 @@ Format of STDIN stream:
|
||||
|
||||
#define PACK_ID_BITS 16
|
||||
#define MAX_PACK_ID ((1<<PACK_ID_BITS)-1)
|
||||
#define DEPTH_BITS 13
|
||||
#define MAX_DEPTH ((1<<DEPTH_BITS)-1)
|
||||
|
||||
struct object_entry
|
||||
{
|
||||
struct object_entry *next;
|
||||
uint32_t offset;
|
||||
unsigned type : TYPE_BITS;
|
||||
unsigned pack_id : PACK_ID_BITS;
|
||||
uint32_t type : TYPE_BITS,
|
||||
pack_id : PACK_ID_BITS,
|
||||
depth : DEPTH_BITS;
|
||||
unsigned char sha1[20];
|
||||
};
|
||||
|
||||
@ -1083,7 +1086,7 @@ static int store_object(
|
||||
unsigned pos = sizeof(hdr) - 1;
|
||||
|
||||
delta_count_by_type[type]++;
|
||||
last->depth++;
|
||||
e->depth = last->depth + 1;
|
||||
|
||||
hdrlen = encode_header(OBJ_OFS_DELTA, deltalen, hdr);
|
||||
write_or_die(pack_data->pack_fd, hdr, hdrlen);
|
||||
@ -1095,8 +1098,7 @@ static int store_object(
|
||||
write_or_die(pack_data->pack_fd, hdr + pos, sizeof(hdr) - pos);
|
||||
pack_size += sizeof(hdr) - pos;
|
||||
} else {
|
||||
if (last)
|
||||
last->depth = 0;
|
||||
e->depth = 0;
|
||||
hdrlen = encode_header(type, dat->len, hdr);
|
||||
write_or_die(pack_data->pack_fd, hdr, hdrlen);
|
||||
pack_size += hdrlen;
|
||||
@ -1114,6 +1116,7 @@ static int store_object(
|
||||
strbuf_swap(&last->data, dat);
|
||||
}
|
||||
last->offset = e->offset;
|
||||
last->depth = e->depth;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@ -1160,7 +1163,7 @@ static void load_tree(struct tree_entry *root)
|
||||
if (myoe && myoe->pack_id != MAX_PACK_ID) {
|
||||
if (myoe->type != OBJ_TREE)
|
||||
die("Not a tree: %s", sha1_to_hex(sha1));
|
||||
t->delta_depth = 0;
|
||||
t->delta_depth = myoe->depth;
|
||||
buf = gfi_unpack_entry(myoe, &size);
|
||||
} else {
|
||||
enum object_type type;
|
||||
@ -2289,8 +2292,11 @@ int main(int argc, const char **argv)
|
||||
}
|
||||
else if (!prefixcmp(a, "--max-pack-size="))
|
||||
max_packsize = strtoumax(a + 16, NULL, 0) * 1024 * 1024;
|
||||
else if (!prefixcmp(a, "--depth="))
|
||||
else if (!prefixcmp(a, "--depth=")) {
|
||||
max_depth = strtoul(a + 8, NULL, 0);
|
||||
if (max_depth > MAX_DEPTH)
|
||||
die("--depth cannot exceed %u", MAX_DEPTH);
|
||||
}
|
||||
else if (!prefixcmp(a, "--active-branches="))
|
||||
max_active_branches = strtoul(a + 18, NULL, 0);
|
||||
else if (!prefixcmp(a, "--import-marks="))
|
||||
|
@ -83,15 +83,22 @@ esac
|
||||
|
||||
if [ -z "$ignored" ]; then
|
||||
excl="--exclude-per-directory=.gitignore"
|
||||
excl_info= excludes_file=
|
||||
if [ -f "$GIT_DIR/info/exclude" ]; then
|
||||
excl_info="--exclude-from=$GIT_DIR/info/exclude"
|
||||
fi
|
||||
if cfg_excl=$(git config core.excludesfile) && test -f "$cfg_excl"
|
||||
then
|
||||
excludes_file="--exclude-from=$cfg_excl"
|
||||
fi
|
||||
if [ "$ignoredonly" ]; then
|
||||
excl="$excl --ignored"
|
||||
fi
|
||||
fi
|
||||
|
||||
git ls-files --others --directory $excl ${excl_info:+"$excl_info"} -- "$@" |
|
||||
git ls-files --others --directory \
|
||||
$excl ${excl_info:+"$excl_info"} ${excludes_file:+"$excludes_file"} \
|
||||
-- "$@" |
|
||||
while read -r file; do
|
||||
if [ -d "$file" -a ! -L "$file" ]; then
|
||||
if [ -z "$cleandir" ]; then
|
||||
|
@ -149,7 +149,7 @@ test_expect_success 'stop on conflicting pick' '
|
||||
diff -u expect .git/.dotest-merge/patch &&
|
||||
diff -u expect2 file1 &&
|
||||
test 4 = $(grep -v "^#" < .git/.dotest-merge/done | wc -l) &&
|
||||
test 0 = $(grep -v "^#" < .git/.dotest-merge/todo | wc -l)
|
||||
test 0 = $(grep -v "^#" < .git/.dotest-merge/git-rebase-todo | wc -l)
|
||||
'
|
||||
|
||||
test_expect_success 'abort' '
|
||||
|
@ -291,4 +291,15 @@ test_expect_success 'clean.requireForce and -f' '
|
||||
|
||||
'
|
||||
|
||||
test_expect_success 'core.excludesfile' '
|
||||
|
||||
echo excludes >excludes &&
|
||||
echo included >included &&
|
||||
git config core.excludesfile excludes &&
|
||||
output=$(git clean -n excludes included 2>&1) &&
|
||||
expr "$output" : ".*included" >/dev/null &&
|
||||
! expr "$output" : ".*excludes" >/dev/null
|
||||
|
||||
'
|
||||
|
||||
test_done
|
||||
|
Loading…
Reference in New Issue
Block a user