summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2013-07-15convert read_cache_preload() to take struct pathspecNguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-15line-log: convert to use parse_pathspecNguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-15reset: convert to use parse_pathspecNguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-15add: convert to use parse_pathspecNguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-15check-ignore: convert to use parse_pathspecNguyễn Thái Ngọc Duy
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>
2013-07-15archive: convert to use parse_pathspecNguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-15ls-files: convert to use parse_pathspecNguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-15rm: convert to use parse_pathspecNguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-15checkout: convert to use parse_pathspecNguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-15rerere: convert to use parse_pathspecNguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-15status: convert to use parse_pathspecNguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-15commit: convert to use parse_pathspecNguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-15clean: convert to use parse_pathspecNguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-15guard against new pathspec magic in pathspec matching codeNguyễn Thái Ngọc Duy
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>
2013-07-15parse_pathspec: support prefixing original patternsNguyễn Thái Ngọc Duy
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>
2013-07-15parse_pathspec: support stripping/checking submodule pathsNguyễn Thái Ngọc Duy
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>
2013-07-15parse_pathspec: support stripping submodule trailing slashesNguyễn Thái Ngọc Duy
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>
2013-07-15parse_pathspec: add special flag for max_depth featureNguyễn Thái Ngọc Duy
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>
2013-07-15convert some get_pathspec() calls to parse_pathspec()Nguyễn Thái Ngọc Duy
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>
2013-07-15parse_pathspec: add PATHSPEC_PREFER_{CWD,FULL} flagsNguyễn Thái Ngọc Duy
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>
2013-07-15parse_pathspec: save original pathspec for reportingNguyễn Thái Ngọc Duy
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>
2013-07-15add parse_pathspec() that converts cmdline args to struct pathspecNguyễn Thái Ngọc Duy
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>
2013-07-15pathspec: add copy_pathspecNguyễn Thái Ngọc Duy
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>
2013-07-15pathspec: i18n-ize error strings in pathspec parsing codeNguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-15move struct pathspec and related functions to pathspec.[ch]Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-15clean: remove unused variable "seen"Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-12Update draft release notes for 1.8.4Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-12Merge branch 'jc/remote-http-argv-array'Junio C Hamano
* jc/remote-http-argv-array: remote-http: use argv-array
2013-07-12Merge branch 'rs/pickaxe-simplify'Junio C Hamano
* rs/pickaxe-simplify: diffcore-pickaxe: simplify has_changes and contains
2013-07-12Merge branch 'tr/test-lint-no-export-assignment-in-shell'Junio C Hamano
* tr/test-lint-no-export-assignment-in-shell: test-lint: detect 'export FOO=bar' t9902: fix 'test A == B' to use = operator
2013-07-12Merge branch 'rr/name-rev-stdin-doc'Junio C Hamano
* rr/name-rev-stdin-doc: name-rev doc: rewrite --stdin paragraph
2013-07-12Merge branch 'ft/diff-rename-default-score-is-half'Junio C Hamano
* ft/diff-rename-default-score-is-half: diff-options: document default similarity index
2013-07-12Merge branch 'ml/cygwin-does-not-have-fifo'Junio C Hamano
* ml/cygwin-does-not-have-fifo: test-lib.sh - cygwin does not have usable FIFOs
2013-07-12Merge branch 'tf/gitweb-extra-breadcrumbs'Junio C Hamano
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
2013-07-12Merge branch 'ms/remote-tracking-branches-in-doc'Junio C Hamano
* ms/remote-tracking-branches-in-doc: Change "remote tracking" to "remote-tracking"
2013-07-12Merge branch 'jk/pull-to-integrate'Junio C Hamano
* jk/pull-to-integrate: pull: change the description to "integrate" changes push: avoid suggesting "merging" remote changes
2013-07-12Merge branch 'jk/maint-config-multi-order'Junio C Hamano
* jk/maint-config-multi-order: git-config(1): clarify precedence of multiple values
2013-07-12Merge branch 'as/log-output-encoding-in-user-format'Junio C Hamano
"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
2013-07-12git-clone.txt: remove the restriction on pushing from a shallow cloneNguyễn Thái Ngọc Duy
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>
2013-07-11Update draft release notes to 1.8.4Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-11Merge branch 'jc/t1512-fix'Junio C Hamano
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
2013-07-11Merge branch 'tr/test-v-and-v-subtest-only'Junio C Hamano
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
2013-07-11Merge branch 'af/rebase-i-merge-options'Junio C Hamano
"git rebase -i" now honors --strategy and -X options. * af/rebase-i-merge-options: Do not ignore merge options in interactive rebase
2013-07-11Merge branch 'pb/stash-refuse-to-kill'Junio C Hamano
"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
2013-07-11Merge branch 'jc/maint-diff-core-safecrlf'Junio C Hamano
"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
2013-07-11Merge branch 'jg/status-config'Junio C Hamano
"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
2013-07-11Merge branch 'jk/bash-completion'Junio C Hamano
* jk/bash-completion: completion: learn about --man-path completion: handle unstuck form of base git options
2013-07-11Merge branch 'rr/rebase-checkout-reflog'Junio C Hamano
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
2013-07-11Merge branch 'jc/triangle-push-fixup'Junio C Hamano
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
2013-07-11Merge branch 'mh/maint-lockfile-overflow'Junio C Hamano
* mh/maint-lockfile-overflow: lockfile: fix buffer overflow in path handling