Nguyễn Thái Ngọc Duy [Sun, 14 Jul 2013 08:36:00 +0000 (15:36 +0700)]
remove match_pathspec() in favor of match_pathspec_depth()
match_pathspec_depth was created to replace match_pathspec (see
61cf282 (pathspec: add match_pathspec_depth() - 2010-12-15). It took
more than two years, but the replacement finally happens :-)
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Nguyễn Thái Ngọc Duy [Sun, 14 Jul 2013 08:35:59 +0000 (15:35 +0700)]
remove init_pathspec() in favor of parse_pathspec()
While at there, move free_pathspec() to pathspec.c
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Nguyễn Thái Ngọc Duy [Sun, 14 Jul 2013 08:35:58 +0000 (15:35 +0700)]
remove diff_tree_{setup,release}_paths
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Nguyễn Thái Ngọc Duy [Sun, 14 Jul 2013 08:35:57 +0000 (15:35 +0700)]
convert common_prefix() to use struct pathspec
The code now takes advantage of nowildcard_len field.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Nguyễn Thái Ngọc Duy [Sun, 14 Jul 2013 08:35:56 +0000 (15:35 +0700)]
convert add_files_to_cache to take struct pathspec
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Nguyễn Thái Ngọc Duy [Sun, 14 Jul 2013 08:35:55 +0000 (15:35 +0700)]
convert {read,fill}_directory to take struct pathspec
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Nguyễn Thái Ngọc Duy [Sun, 14 Jul 2013 08:35:54 +0000 (15:35 +0700)]
convert refresh_index to take struct pathspec
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Nguyễn Thái Ngọc Duy [Sun, 14 Jul 2013 08:35:53 +0000 (15:35 +0700)]
convert report_path_error to take struct pathspec
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Nguyễn Thái Ngọc Duy [Sun, 14 Jul 2013 08:35:52 +0000 (15:35 +0700)]
checkout: convert read_tree_some to take struct pathspec
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Nguyễn Thái Ngọc Duy [Sun, 14 Jul 2013 08:35:51 +0000 (15:35 +0700)]
convert unmerge_cache to take struct pathspec
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Nguyễn Thái Ngọc Duy [Sun, 14 Jul 2013 08:35:50 +0000 (15:35 +0700)]
convert run_add_interactive to use struct pathspec
This passes the pathspec, more or less unmodified, to
git-add--interactive. The command itself does not process pathspec. It
simply passes the pathspec to other builtin commands. So if all those
commands support pathspec, we're good.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Nguyễn Thái Ngọc Duy [Sun, 14 Jul 2013 08:35:49 +0000 (15:35 +0700)]
convert read_cache_preload() to take struct pathspec
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Nguyễn Thái Ngọc Duy [Sun, 14 Jul 2013 08:35:48 +0000 (15:35 +0700)]
line-log: convert to use parse_pathspec
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Nguyễn Thái Ngọc Duy [Sun, 14 Jul 2013 08:35:47 +0000 (15:35 +0700)]
reset: convert to use parse_pathspec
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Nguyễn Thái Ngọc Duy [Sun, 14 Jul 2013 08:35:46 +0000 (15:35 +0700)]
add: convert to use parse_pathspec
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Nguyễn Thái Ngọc Duy [Sun, 14 Jul 2013 08:35:45 +0000 (15:35 +0700)]
check-ignore: convert to use parse_pathspec
check-ignore (at least the test suite) seems to rely on the pattern
order. PATHSPEC_KEEP_ORDER is introduced to explictly express this.
The lack of PATHSPEC_MAXDEPTH_VALID is sufficient because it's the
only flag that reorders pathspecs, but it's less obvious that way.
Cc: Adam Spiers <git@adamspiers.org>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Nguyễn Thái Ngọc Duy [Sun, 14 Jul 2013 08:35:44 +0000 (15:35 +0700)]
archive: convert to use parse_pathspec
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Nguyễn Thái Ngọc Duy [Sun, 14 Jul 2013 08:35:43 +0000 (15:35 +0700)]
ls-files: convert to use parse_pathspec
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Nguyễn Thái Ngọc Duy [Sun, 14 Jul 2013 08:35:42 +0000 (15:35 +0700)]
rm: convert to use parse_pathspec
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Nguyễn Thái Ngọc Duy [Sun, 14 Jul 2013 08:35:41 +0000 (15:35 +0700)]
checkout: convert to use parse_pathspec
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Nguyễn Thái Ngọc Duy [Sun, 14 Jul 2013 08:35:40 +0000 (15:35 +0700)]
rerere: convert to use parse_pathspec
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Nguyễn Thái Ngọc Duy [Sun, 14 Jul 2013 08:35:39 +0000 (15:35 +0700)]
status: convert to use parse_pathspec
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Nguyễn Thái Ngọc Duy [Sun, 14 Jul 2013 08:35:38 +0000 (15:35 +0700)]
commit: convert to use parse_pathspec
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Nguyễn Thái Ngọc Duy [Sun, 14 Jul 2013 08:35:37 +0000 (15:35 +0700)]
clean: convert to use parse_pathspec
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Nguyễn Thái Ngọc Duy [Sun, 14 Jul 2013 08:35:36 +0000 (15:35 +0700)]
guard against new pathspec magic in pathspec matching code
GUARD_PATHSPEC() marks pathspec-sensitive code, basically all those
that touch anything in 'struct pathspec' except fields "nr" and
"original". GUARD_PATHSPEC() is not supposed to fail. It's mainly to
help the designers catch unsupported codepaths.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Nguyễn Thái Ngọc Duy [Sun, 14 Jul 2013 08:35:35 +0000 (15:35 +0700)]
parse_pathspec: support prefixing original patterns
This makes 'original' suitable for passing to an external command
because all pathspec magic is left in place, provided that the
external command understands pathspec. The prefixing is needed because
we usually launch a subcommand at worktree's top directory and the
subcommand can no longer calculate the prefix itself.
This slightly affects the original purpose of 'original'
(i.e. reporting). We should report without prefixing. So only turn
this flag on when you know you are about to pass the result straight
away to an external command.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Nguyễn Thái Ngọc Duy [Sun, 14 Jul 2013 08:35:34 +0000 (15:35 +0700)]
parse_pathspec: support stripping/checking submodule paths
PATHSPEC_SYMLINK_LEADING_PATH and _STRIP_SUBMODULE_SLASH_EXPENSIVE are
respectively the alternate implementation of
pathspec.c:die_if_path_beyond_symlink() and
pathspec.c:check_path_for_gitlink(). They are intended to replace
those functions when builtin/add.c and builtin/check-ignore.c are
converted to use parse_pathspec.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Nguyễn Thái Ngọc Duy [Sun, 14 Jul 2013 08:35:33 +0000 (15:35 +0700)]
parse_pathspec: support stripping submodule trailing slashes
This flag is equivalent to builtin/ls-files.c:strip_trailing_slashes()
and is intended to replace that function when ls-files is converted to
use parse_pathspec.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Nguyễn Thái Ngọc Duy [Sun, 14 Jul 2013 08:35:32 +0000 (15:35 +0700)]
parse_pathspec: add special flag for max_depth feature
match_pathspec_depth() and tree_entry_interesting() check max_depth
field in order to support "git grep --max-depth". The feature
activation is tied to "recursive" field, which led to some unwanted
activation, e.g.
5c8eeb8 (diff-index: enable recursive pathspec
matching in unpack_trees - 2012-01-15).
This patch decouples the activation from "recursive" field, puts it in
"magic" field instead. This makes sure that only "git grep" can
activate this feature. And because parse_pathspec knows when the
feature is not used, it does not need to sort pathspec (required for
max_depth to work correctly). A small win for non-grep cases.
Even though a new magic flag is introduced, no magic syntax is. The
magic can be only enabled by parse_pathspec() caller. We might someday
want to support ":(maxdepth:10)src." It all depends on actual use
cases.
max_depth feature cannot be enabled via init_pathspec() anymore. But
that's ok because init_pathspec() is on its way to /dev/null.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Nguyễn Thái Ngọc Duy [Sun, 14 Jul 2013 08:35:31 +0000 (15:35 +0700)]
convert some get_pathspec() calls to parse_pathspec()
These call sites follow the pattern:
paths = get_pathspec(prefix, argv);
init_pathspec(&pathspec, paths);
which can be converted into a single parse_pathspec() call.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Nguyễn Thái Ngọc Duy [Sun, 14 Jul 2013 08:35:30 +0000 (15:35 +0700)]
parse_pathspec: add PATHSPEC_PREFER_{CWD,FULL} flags
We have two ways of dealing with empty pathspec:
1. limit it to current prefix
2. match the entire working directory
Some commands go with #1, some #2. get_pathspec() and parse_pathspec()
only support #1. Make parse_pathspec() reject empty pathspec by
default. #1 and #2 can be specified via new flags. This makes it more
expressive about default behavior at command level.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Nguyễn Thái Ngọc Duy [Sun, 14 Jul 2013 08:35:29 +0000 (15:35 +0700)]
parse_pathspec: save original pathspec for reporting
We usually use pathspec_item's match field for pathspec error
reporting. However "match" (or "raw") does not show the magic part,
which will play more important role later on. Preserve exact user
input for reporting.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Nguyễn Thái Ngọc Duy [Sun, 14 Jul 2013 08:35:28 +0000 (15:35 +0700)]
add parse_pathspec() that converts cmdline args to struct pathspec
Currently to fill a struct pathspec, we do:
const char **paths;
paths = get_pathspec(prefix, argv);
...
init_pathspec(&pathspec, paths);
"paths" can only carry bare strings, which loses information from
command line arguments such as pathspec magic or the prefix part's
length for each argument.
parse_pathspec() is introduced to combine the two calls into one. The
plan is gradually replace all get_pathspec() and init_pathspec() with
parse_pathspec(). get_pathspec() now becomes a thin wrapper of
parse_pathspec().
parse_pathspec() allows the caller to reject the pathspec magics that
it does not support. When a new pathspec magic is introduced, we can
enable it per command after making sure that all underlying code has no
problem with the new magic.
"flags" parameter is currently unused. But it would allow callers to
pass certain instructions to parse_pathspec, for example forcing
literal pathspec when no magic is used.
With the introduction of parse_pathspec, there are now two functions
that can initialize struct pathspec: init_pathspec and
parse_pathspec. Any semantic changes in struct pathspec must be
reflected in both functions. init_pathspec() will be phased out in
favor of parse_pathspec().
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Nguyễn Thái Ngọc Duy [Sun, 14 Jul 2013 08:35:27 +0000 (15:35 +0700)]
pathspec: add copy_pathspec
Because free_pathspec wants to free "items" pointer in the pathspec
structure, a simple structure assignment is not enough if you want to
copy an existing pathspec into another. Freeing the original will
damage the copy unless a deep copy is made.
Note that the strings in pathspec->items->match and the array
pathspec->raw[] are still shared between the original and the copy.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Nguyễn Thái Ngọc Duy [Sun, 14 Jul 2013 08:35:26 +0000 (15:35 +0700)]
pathspec: i18n-ize error strings in pathspec parsing code
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Nguyễn Thái Ngọc Duy [Sun, 14 Jul 2013 08:35:25 +0000 (15:35 +0700)]
move struct pathspec and related functions to pathspec.[ch]
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Nguyễn Thái Ngọc Duy [Sun, 14 Jul 2013 08:35:24 +0000 (15:35 +0700)]
clean: remove unused variable "seen"
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Fri, 12 Jul 2013 17:49:34 +0000 (10:49 -0700)]
Update draft release notes for 1.8.4
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Fri, 12 Jul 2013 19:04:19 +0000 (12:04 -0700)]
Merge branch 'jc/remote-http-argv-array'
* jc/remote-http-argv-array:
remote-http: use argv-array
Junio C Hamano [Fri, 12 Jul 2013 19:04:17 +0000 (12:04 -0700)]
Merge branch 'rs/pickaxe-simplify'
* rs/pickaxe-simplify:
diffcore-pickaxe: simplify has_changes and contains
Junio C Hamano [Fri, 12 Jul 2013 19:04:16 +0000 (12:04 -0700)]
Merge branch 'tr/test-lint-no-export-assignment-in-shell'
* tr/test-lint-no-export-assignment-in-shell:
test-lint: detect 'export FOO=bar'
t9902: fix 'test A == B' to use = operator
Junio C Hamano [Fri, 12 Jul 2013 19:04:14 +0000 (12:04 -0700)]
Merge branch 'rr/name-rev-stdin-doc'
* rr/name-rev-stdin-doc:
name-rev doc: rewrite --stdin paragraph
Junio C Hamano [Fri, 12 Jul 2013 19:04:12 +0000 (12:04 -0700)]
Merge branch 'ft/diff-rename-default-score-is-half'
* ft/diff-rename-default-score-is-half:
diff-options: document default similarity index
Junio C Hamano [Fri, 12 Jul 2013 19:04:10 +0000 (12:04 -0700)]
Merge branch 'ml/cygwin-does-not-have-fifo'
* ml/cygwin-does-not-have-fifo:
test-lib.sh - cygwin does not have usable FIFOs
Junio C Hamano [Fri, 12 Jul 2013 19:04:09 +0000 (12:04 -0700)]
Merge branch 'tf/gitweb-extra-breadcrumbs'
An Gitweb installation that is a part of larger site can optionally
show extra links that point at the levels higher than the Gitweb
pages itself in the link hierarchy of pages.
* tf/gitweb-extra-breadcrumbs:
gitweb: allow extra breadcrumbs to prefix the trail
Junio C Hamano [Fri, 12 Jul 2013 19:04:07 +0000 (12:04 -0700)]
Merge branch 'ms/remote-tracking-branches-in-doc'
* ms/remote-tracking-branches-in-doc:
Change "remote tracking" to "remote-tracking"
Junio C Hamano [Fri, 12 Jul 2013 19:04:06 +0000 (12:04 -0700)]
Merge branch 'jk/pull-to-integrate'
* jk/pull-to-integrate:
pull: change the description to "integrate" changes
push: avoid suggesting "merging" remote changes
Junio C Hamano [Fri, 12 Jul 2013 19:04:04 +0000 (12:04 -0700)]
Merge branch 'jk/maint-config-multi-order'
* jk/maint-config-multi-order:
git-config(1): clarify precedence of multiple values
Junio C Hamano [Fri, 12 Jul 2013 19:04:01 +0000 (12:04 -0700)]
Merge branch 'as/log-output-encoding-in-user-format'
"log --format=" did not honor i18n.logoutputencoding configuration
and this attempts to fix it.
* as/log-output-encoding-in-user-format:
t4205 (log-pretty-formats): avoid using `sed`
t6006 (rev-list-format): add tests for "%b" and "%s" for the case i18n.commitEncoding is not set
t4205, t6006, t7102: make functions better readable
t4205 (log-pretty-formats): revert back single quotes
t4041, t4205, t6006, t7102: use iso8859-1 rather than iso-8859-1
t4205: replace .\+ with ..* in sed commands
pretty: --format output should honor logOutputEncoding
pretty: Add failing tests: --format output should honor logOutputEncoding
t4205 (log-pretty-formats): don't hardcode SHA-1 in expected outputs
t7102 (reset): don't hardcode SHA-1 in expected outputs
t6006 (rev-list-format): don't hardcode SHA-1 in expected outputs
Nguyễn Thái Ngọc Duy [Fri, 12 Jul 2013 05:37:42 +0000 (12:37 +0700)]
git-clone.txt: remove the restriction on pushing from a shallow clone
The document says one cannot push from a shallow clone. But that is
not true (maybe it was at some point in the past). The client does not
stop such a push nor does it give any indication to the receiver that
this is a shallow push. If the receiver accepts it, it's in.
Since
52fed6e (receive-pack: check connectivity before concluding "git
push" - 2011-09-02), receive-pack is prepared to deal with broken
push, a shallow push can't cause any corruption. Update the document
to reflect that.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Thu, 11 Jul 2013 20:25:18 +0000 (13:25 -0700)]
Update draft release notes to 1.8.4
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Thu, 11 Jul 2013 20:06:11 +0000 (13:06 -0700)]
Merge branch 'jc/t1512-fix'
A test that should have failed but didn't revealed a bug that needs
to be corrected.
* jc/t1512-fix:
get_short_sha1(): correctly disambiguate type-limited abbreviation
t1512: correct leftover constants from earlier edition
Junio C Hamano [Thu, 11 Jul 2013 20:06:02 +0000 (13:06 -0700)]
Merge branch 'tr/test-v-and-v-subtest-only'
Finishing touches to a topic that is already in master for the
upcoming release.
* tr/test-v-and-v-subtest-only:
t0000: do not use export X=Y
Junio C Hamano [Thu, 11 Jul 2013 20:05:58 +0000 (13:05 -0700)]
Merge branch 'af/rebase-i-merge-options'
"git rebase -i" now honors --strategy and -X options.
* af/rebase-i-merge-options:
Do not ignore merge options in interactive rebase
Junio C Hamano [Thu, 11 Jul 2013 20:05:52 +0000 (13:05 -0700)]
Merge branch 'pb/stash-refuse-to-kill'
"git stash save" is not just about "saving" the local changes, but
also is to restore the working tree state to that of HEAD. If you
changed a non-directory into a directory in the local change, you
may have untracked files in that directory, which have to be killed
while doing so, unless you run it with --include-untracked. Teach
the command to detect and error out before spreading the damage.
This needed a small fix to "ls-files --killed".
* pb/stash-refuse-to-kill:
git stash: avoid data loss when "git stash save" kills a directory
treat_directory(): do not declare submodules to be untracked
Junio C Hamano [Thu, 11 Jul 2013 20:05:45 +0000 (13:05 -0700)]
Merge branch 'jc/maint-diff-core-safecrlf'
"git diff" refused to even show difference when core.safecrlf is
set to true (i.e. error out) and there are offending lines in the
working tree files.
* jc/maint-diff-core-safecrlf:
diff: demote core.safecrlf=true to core.safecrlf=warn
Junio C Hamano [Thu, 11 Jul 2013 20:05:34 +0000 (13:05 -0700)]
Merge branch 'jg/status-config'
"git status" learned status.branch and status.short configuration
variables to use --branch and --short options by default (override
with --no-branch and --no-short options from the command line).
* jg/status-config:
status/commit: make sure --porcelain is not affected by user-facing config
commit: make it work with status.short
status: introduce status.branch to enable --branch by default
status: introduce status.short to enable --short by default
Junio C Hamano [Thu, 11 Jul 2013 20:05:28 +0000 (13:05 -0700)]
Merge branch 'jk/bash-completion'
* jk/bash-completion:
completion: learn about --man-path
completion: handle unstuck form of base git options
Junio C Hamano [Thu, 11 Jul 2013 20:04:33 +0000 (13:04 -0700)]
Merge branch 'rr/rebase-checkout-reflog'
Invocations of "git checkout" used internally by "git rebase" were
counted as "checkout", and affected later "git checkout -" to the
the user to an unexpected place.
* rr/rebase-checkout-reflog:
checkout: respect GIT_REFLOG_ACTION
status: do not depend on rebase reflog messages
t/t2021-checkout-last: "checkout -" should work after a rebase finishes
wt-status: remove unused field in grab_1st_switch_cbdata
t7512: test "detached from" as well
Junio C Hamano [Thu, 11 Jul 2013 20:03:21 +0000 (13:03 -0700)]
Merge branch 'jc/triangle-push-fixup'
Earlier remote.pushdefault (and per-branch branch.*.pushremote)
were introduced as an additional mechanism to choose what
repository to push into when "git push" did not say it from the
command line, to help people who push to a repository that is
different from where they fetch from. This attempts to finish that
topic by teaching the default mechanism to choose branch in the
remote repository to be updated by such a push.
The 'current', 'matching' and 'nothing' modes (specified by the
push.default configuration variable) extend to such a "triangular"
workflow naturally, but 'upstream' and 'simple' have to be updated.
. 'upstream' is about pushing back to update the branch in the
remote repository that the current branch fetches from and
integrates with, it errors out in a triangular workflow.
. 'simple' is meant to help new people by avoiding mistakes, and
will be the safe default in Git 2.0.
In a non-triangular workflow, it will continue to act as a cross
between 'upstream' and 'current' in that it pushes to the current
branch's @{upstream} only when it is set to the same name as the
current branch (e.g. your 'master' forks from the 'master' from
the central repository).
In a triangular workflow, this series tentatively defines it as
the same as 'current', but we may have to tighten it to avoid
surprises in some way.
* jc/triangle-push-fixup:
t/t5528-push-default: test pushdefault workflows
t/t5528-push-default: generalize test_push_*
push: change `simple` to accommodate triangular workflows
config doc: rewrite push.default section
t/t5528-push-default: remove redundant test_config lines
Junio C Hamano [Thu, 11 Jul 2013 20:03:16 +0000 (13:03 -0700)]
Merge branch 'mh/maint-lockfile-overflow'
* mh/maint-lockfile-overflow:
lockfile: fix buffer overflow in path handling
Junio C Hamano [Tue, 9 Jul 2013 05:16:31 +0000 (22:16 -0700)]
remote-http: use argv-array
Instead of using a hand-managed argument array, use argv-array API
to manage dynamically formulated command line.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
John Keeping [Sun, 7 Jul 2013 19:02:15 +0000 (20:02 +0100)]
pull: change the description to "integrate" changes
Since git-pull learned the --rebase option it has not just been about
merging changes from a remote repository (where "merge" is in the sense
of "git merge"). Change the description to use "integrate" instead of
"merge" in order to reflect this.
Signed-off-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Thomas Rast [Mon, 8 Jul 2013 15:20:32 +0000 (17:20 +0200)]
test-lint: detect 'export FOO=bar'
Some shells do not understand the one-line construct, and instead need
FOO=bar &&
export FOO
Detect this in the test-lint target.
Signed-off-by: Thomas Rast <trast@inf.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Thomas Rast [Mon, 8 Jul 2013 15:20:31 +0000 (17:20 +0200)]
t9902: fix 'test A == B' to use = operator
The == operator as an alias to = is not POSIX. This doesn't actually
matter for the execution of the script, because it only runs when the
shell is bash. However, it trips up test-lint, so it's nicer to use
the standard form.
Signed-off-by: Thomas Rast <trast@inf.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Torsten Bögershausen [Mon, 8 Jul 2013 09:21:22 +0000 (11:21 +0200)]
t0000: do not use export X=Y
The shell syntax "export X=Y A=B" is not understood by all shells.
Signed-off-by: Torsten Bögershausen <tboegi@web.de>
Acked-by: Thomas Rast <trast@inf.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
John Keeping [Sun, 7 Jul 2013 19:02:14 +0000 (20:02 +0100)]
push: avoid suggesting "merging" remote changes
With some workflows, it is more suitable to rebase on top of remote
changes when a push does not fast-forward. Change the advice messages
in git-push to suggest that a user "integrate the remote changes"
instead of "merge the remote changes" to make this slightly clearer.
Also change the suggested 'git pull' to 'git pull ...' to hint to users
that they may want to add other parameters.
Suggested-by: Philip Oakley <philipoakley@iee.org>
Signed-off-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
John Keeping [Sun, 7 Jul 2013 19:49:56 +0000 (20:49 +0100)]
git-config(1): clarify precedence of multiple values
In order to clarify which value is used when there are multiple values
defined for a key, re-order the list of file locations so that it runs
from least specific to most specific. Then add a paragraph which simply
says that the last value will be used.
Signed-off-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Ramkumar Ramachandra [Sun, 7 Jul 2013 12:43:16 +0000 (18:13 +0530)]
name-rev doc: rewrite --stdin paragraph
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Michael Haggerty [Sat, 6 Jul 2013 19:48:52 +0000 (21:48 +0200)]
lockfile: fix buffer overflow in path handling
The path of the file to be locked is held in lock_file::filename,
which is a fixed-length buffer of length PATH_MAX. This buffer is
also (temporarily) used to hold the path of the lock file, which is
the path of the file being locked plus ".lock". Because of this, the
path of the file being locked must be less than (PATH_MAX - 5)
characters long (5 chars are needed for ".lock" and one character for
the NUL terminator).
On entry into lock_file(), the path length was only verified to be
less than PATH_MAX characters, not less than (PATH_MAX - 5)
characters.
When and if resolve_symlink() is called, then that function is
correctly told to treat the buffer as (PATH_MAX - 5) characters long.
This part is correct. However:
* If LOCK_NODEREF was specified, then resolve_symlink() is never
called.
* If resolve_symlink() is called but the path is not a symlink, then
the length check is never applied.
So it is possible for a path with length (PATH_MAX - 5 <= len <
PATH_MAX) to make it through the checks. When ".lock" is strcat()ted
to such a path, the lock_file::filename buffer is overflowed.
Fix the problem by adding a check when entering lock_file() that the
original path is less than (PATH_MAX - 5) characters.
[jc: with independent development by Peff]
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
René Scharfe [Sat, 6 Jul 2013 13:53:27 +0000 (15:53 +0200)]
diffcore-pickaxe: simplify has_changes and contains
Halve the number of callsites of contains() to two using temporary
variables, simplifying the code. While at it, get rid of the
diff_options parameter, which became unused with
8fa4b09f.
Signed-off-by: René Scharfe <rene.scharfe@lsrfire.ath.cx>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Fraser Tweedale [Fri, 5 Jul 2013 08:42:17 +0000 (18:42 +1000)]
diff-options: document default similarity index
The default similarity index of 50% is documented in gitdiffcore(7)
but it is worth also mentioning it in the description of the
-M/--find-renames option.
Signed-off-by: Fraser Tweedale <frase@frase.id.au>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Alexey Shumkin [Fri, 5 Jul 2013 12:01:50 +0000 (16:01 +0400)]
t4205 (log-pretty-formats): avoid using `sed`
For testing truncated log messages 'commit_msg' function uses `sed` to
cut a message. On various platforms `sed` behaves differently and
results of its work depend on locales installed. So, avoid using `sed`.
Use predefined expected outputs instead of calculated ones.
Signed-off-by: Alexey Shumkin <Alex.Crezoff@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Alexey Shumkin [Fri, 5 Jul 2013 12:01:49 +0000 (16:01 +0400)]
t6006 (rev-list-format): add tests for "%b" and "%s" for the case i18n.commitEncoding is not set
In
de6029a (pretty: Add failing tests: --format output should honor
logOutputEncoding, 2013-06-26) 'complex-subject' test was changed.
Revert it back, because that change actually removed tests for "%b"
and "%s" with i18n.commitEncoding set. Also, add two more tests for
mentioned above "%b" and "%s" to test encoding conversions with no
i18n.commitEncoding set.
Signed-off-by: Alexey Shumkin <Alex.Crezoff@gmail.com>
Suggested-by: Johannes Sixt <j.sixt@viscovery.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Alexey Shumkin [Fri, 5 Jul 2013 12:01:48 +0000 (16:01 +0400)]
t4205, t6006, t7102: make functions better readable
Function 'test_format' has become harder to read after its change in
de6029a2 (pretty: Add failing tests: --format output should honor
logOutputEncoding, 2013-06-26). Simplify it by moving its "should we
expect it to fail?" parameter to the end.
Note, current code does not use this last parameter as far as there
are no tests expected to fail. We can keep that for future use.
Also, reformat comments.
Signed-off-by: Alexey Shumkin <Alex.Crezoff@gmail.com>
Improved-by: Johannes Sixt <j.sixt@viscovery.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Alexey Shumkin [Fri, 5 Jul 2013 12:01:47 +0000 (16:01 +0400)]
t4205 (log-pretty-formats): revert back single quotes
In previuos commit
de6029a (pretty: Add failing tests: --format output
should honor logOutputEncoding, 2013-06-26) single quotes were replaced
with double quotes to make "$(commit_msg)" expression in heredoc to
work. The same effect can be achieved by using "EOF" as a heredoc
delimiter instead of "\EOF".
Signed-off-by: Alexey Shumkin <Alex.Crezoff@gmail.com>
Suggested-by: Johannes Sixt <j.sixt@viscovery.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Fri, 5 Jul 2013 08:16:27 +0000 (01:16 -0700)]
Merge branch 'maint'
* maint:
fixup-builtins: retire an old transition helper script
Junio C Hamano [Fri, 5 Jul 2013 08:15:48 +0000 (01:15 -0700)]
Merge branch 'tr/test-v-and-v-subtest-only'
Allows N instances of tests run in parallel, each running 1/N parts
of the test suite under Valgrind, to speed things up.
* tr/test-v-and-v-subtest-only:
perf-lib: fix start/stop of perf tests
test-lib: support running tests under valgrind in parallel
test-lib: allow prefixing a custom string before "ok N" etc.
test-lib: valgrind for only tests matching a pattern
test-lib: verbose mode for only tests matching a pattern
test-lib: self-test that --verbose works
test-lib: rearrange start/end of test_expect_* and test_skip
test-lib: refactor $GIT_SKIP_TESTS matching
test-lib: enable MALLOC_* for the actual tests
Mark Levedahl [Thu, 4 Jul 2013 22:04:30 +0000 (18:04 -0400)]
test-lib.sh - cygwin does not have usable FIFOs
Do not use FIFOs on cygwin, they do not work. Cygwin includes
coreutils, so has mkfifo, and that command does something. However,
the resultant named pipe is known (on the Cygwin mailing list at
least) to not work correctly.
This disables PIPE for Cygwin, allowing t0008.sh to complete (all other
tests in that file work correctly).
Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Alexey Shumkin [Thu, 4 Jul 2013 12:45:46 +0000 (16:45 +0400)]
t4041, t4205, t6006, t7102: use iso8859-1 rather than iso-8859-1
Both "iso8859-1" and "iso-8859-1" are understood as latin-1 by
modern platforms, but the latter is not understood by older
platforms;update tests to use the former.
This is in line with
3994e8a9 (t4201: use ISO8859-1 rather than
ISO-8859-1, 2009-12-03), which did the same.
Signed-off-by: Alexey Shumkin <Alex.Crezoff@gmail.com>
Reviewed-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Tony Finch [Thu, 4 Jul 2013 17:02:12 +0000 (18:02 +0100)]
gitweb: allow extra breadcrumbs to prefix the trail
There are often parent pages logically above the gitweb projects
list, e.g. home pages of the organization and department that host
the gitweb server. This change allows you to include links to those
pages in gitweb's breadcrumb trail.
Signed-off-by: Tony Finch <dot@dotat.at>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Ramkumar Ramachandra [Fri, 28 Jun 2013 15:46:19 +0000 (21:16 +0530)]
fixup-builtins: retire an old transition helper script
This script was added in
36e5e70 (Start deprecating "git-command" in
favor of "git command", 2007-06-30) with the intent of aiding the
transition away from dashed forms.
It has already been used to help the transision and served its
purpose, and is no longer very useful for follow-up work, because
the majority of remaining matches it finds are false positives.
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Wed, 3 Jul 2013 22:43:49 +0000 (15:43 -0700)]
Merge branch 'maint'
* maint:
Update draft release notes to 1.8.3.3
git-config: update doc for --get with multiple values
Junio C Hamano [Wed, 3 Jul 2013 22:43:41 +0000 (15:43 -0700)]
Update draft release notes to 1.8.3.3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Wed, 3 Jul 2013 22:41:17 +0000 (15:41 -0700)]
Merge branch 'rr/diffcore-pickaxe-doc' into maint
* rr/diffcore-pickaxe-doc:
diffcore-pickaxe doc: document -S and -G properly
diffcore-pickaxe: make error messages more consistent
Junio C Hamano [Wed, 3 Jul 2013 22:41:05 +0000 (15:41 -0700)]
Merge branch 'cr/git-work-tree-sans-git-dir' into maint
* cr/git-work-tree-sans-git-dir:
git.txt: remove stale comment regarding GIT_WORK_TREE
Junio C Hamano [Wed, 3 Jul 2013 22:40:38 +0000 (15:40 -0700)]
Merge branch 'fc/do-not-use-the-index-in-add-to-index' into maint
* fc/do-not-use-the-index-in-add-to-index:
read-cache: trivial style cleanups
read-cache: fix wrong 'the_index' usage
Junio C Hamano [Wed, 3 Jul 2013 22:39:37 +0000 (15:39 -0700)]
Merge branch 'dm/unbash-subtree' into maint
* dm/unbash-subtree:
contrib/git-subtree: Use /bin/sh interpreter instead of /bin/bash
Junio C Hamano [Wed, 3 Jul 2013 22:39:15 +0000 (15:39 -0700)]
Merge branch 'jc/core-checkstat' into maint
* jc/core-checkstat:
deprecate core.statinfo at Git 2.0 boundary
Junio C Hamano [Wed, 3 Jul 2013 22:37:58 +0000 (15:37 -0700)]
Merge branch 'jc/t5551-posix-sed-bre' into maint
* jc/t5551-posix-sed-bre:
t5551: do not use unportable sed '\+'
Junio C Hamano [Wed, 3 Jul 2013 22:37:50 +0000 (15:37 -0700)]
Merge branch 'vv/help-unknown-ref' into maint
* vv/help-unknown-ref:
merge: use help_unknown_ref()
help: add help_unknown_ref()
Junio C Hamano [Wed, 3 Jul 2013 22:36:54 +0000 (15:36 -0700)]
Merge branch 'rs/empty-archive' into maint
* rs/empty-archive:
t5004: resurrect original empty tar archive test
t5004: avoid using tar for checking emptiness of archive
Conflicts:
t/t5004-archive-corner-cases.sh
Junio C Hamano [Wed, 3 Jul 2013 22:36:30 +0000 (15:36 -0700)]
Merge branch 'rh/merge-options-doc-fix' into maint
* rh/merge-options-doc-fix:
Documentation/merge-options.txt: restore `-e` option
Junio C Hamano [Wed, 3 Jul 2013 22:35:55 +0000 (15:35 -0700)]
Merge branch 'an/diff-index-doc' into maint
* an/diff-index-doc:
Documentation/diff-index: mention two modes of operation
Junio C Hamano [Wed, 3 Jul 2013 22:31:36 +0000 (15:31 -0700)]
Merge branch 'cm/gitweb-project-list-persistent-cgi-fix' into maint
"gitweb" forgot to clear a global variable $search_regexp upon each
request, mistakenly carrying over the previous search to a new one
when used as a persistent CGI.
* cm/gitweb-project-list-persistent-cgi-fix:
gitweb: fix problem causing erroneous project list
Junio C Hamano [Wed, 3 Jul 2013 22:31:27 +0000 (15:31 -0700)]
Merge branch 'ar/wildmatch-foldcase' into maint
The wildmatch engine did not honor WM_CASEFOLD option correctly.
* ar/wildmatch-foldcase:
wildmatch: properly fold case everywhere
Junio C Hamano [Wed, 3 Jul 2013 22:30:59 +0000 (15:30 -0700)]
Merge branch 'cb/log-follow-with-combined' into maint
"git log -c --follow $path" segfaulted upon hitting the commit that
renamed the $path being followed.
* cb/log-follow-with-combined:
fix segfault with git log -c --follow
Junio C Hamano [Wed, 3 Jul 2013 22:30:24 +0000 (15:30 -0700)]
Merge branch 'rr/die-on-missing-upstream' into maint
When a reflog notation is used for implicit "current branch", we did
not say which branch, and worse said "branch ''".
* rr/die-on-missing-upstream:
sha1_name: fix error message for @{<N>}, @{<date>}
sha1_name: fix error message for @{u}
Junio C Hamano [Wed, 3 Jul 2013 22:27:19 +0000 (15:27 -0700)]
Merge branch 'maint-1.8.2' into maint
* maint-1.8.2:
git-config: update doc for --get with multiple values
Junio C Hamano [Wed, 3 Jul 2013 22:26:53 +0000 (15:26 -0700)]
Merge branch 'maint-1.8.1' into maint-1.8.2
* maint-1.8.1:
git-config: update doc for --get with multiple values