summaryrefslogtreecommitdiff
path: root/t
AgeCommit message (Collapse)AuthorFilesLines
2012-07-22Merge branch 'jc/sha1-name-more'Libravatar Junio C Hamano1-0/+264
Teaches the object name parser things like a "git describe" output is always a commit object, "A" in "git log A" must be a committish, and "A" and "B" in "git log A...B" both must be committish, etc., to prolong the lifetime of abbreviated object names. * jc/sha1-name-more: (27 commits) t1512: match the "other" object names t1512: ignore whitespaces in wc -l output rev-parse --disambiguate=<prefix> rev-parse: A and B in "rev-parse A..B" refer to committish reset: the command takes committish commit-tree: the command wants a tree and commits apply: --build-fake-ancestor expects blobs sha1_name.c: add support for disambiguating other types revision.c: the "log" family, except for "show", takes committish revision.c: allow handle_revision_arg() to take other flags sha1_name.c: introduce get_sha1_committish() sha1_name.c: teach lookup context to get_sha1_with_context() sha1_name.c: many short names can only be committish sha1_name.c: get_sha1_1() takes lookup flags sha1_name.c: get_describe_name() by definition groks only commits sha1_name.c: teach get_short_sha1() a commit-only option sha1_name.c: allow get_short_sha1() to take other flags get_sha1(): fix error status regression sha1_name.c: restructure disambiguation of short names sha1_name.c: correct misnamed "canonical" and "res" ...
2012-07-22Merge branch 'jc/maint-filter-branch-epoch-date'Libravatar Junio C Hamano2-3/+13
In 1.7.9 era, we taught "git rebase" about the raw timestamp format but we did not teach the same trick to "filter-branch", which rolled a similar logic on its own. Because of this, "filter-branch" failed to rewrite commits with ancient timestamps. * jc/maint-filter-branch-epoch-date: t7003: add test to filter a branch with a commit at epoch date.c: Fix off by one error in object-header date parsing filter-branch: do not forget the '@' prefix to force git-timestamp
2012-07-15Merge branch 'tg/maint-cache-name-compare'Libravatar Junio C Hamano1-0/+39
Even though the index can record pathnames longer than 1<<12 bytes, in some places we were not comparing them in full, potentially replacing index entries instead of adding. * tg/maint-cache-name-compare: cache_name_compare(): do not truncate while comparing paths
2012-07-15Merge branch 'jk/maint-commit-amend-only-no-paths'Libravatar Junio C Hamano1-0/+10
"git commit --amend --only --" was meant to allow "Clever" people to rewrite the commit message without making any change even when they have already changes for the next commit added to their index, but it never worked as advertised since it was introduced in 1.3.0 era. * jk/maint-commit-amend-only-no-paths: commit: fix "--amend --only" with no pathspec
2012-07-15Merge branch 'cw/amend-commit-without-message'Libravatar Junio C Hamano1-0/+15
"commit --amend" used to refuse amending a commit with an empty log message, with or without "--allow-empty-message". * cw/amend-commit-without-message: Allow edit of empty message with commit --amend
2012-07-15Merge branch 'jc/apply-3way'Libravatar Junio C Hamano2-0/+165
"git apply" learned to wiggle the base version and perform three-way merge when a patch does not exactly apply to the version you have. * jc/apply-3way: apply: tests for the --3way option apply: document --3way option apply: allow rerere() to work on --3way results apply: register conflicted stages to the index apply: --3way with add/add conflict apply: move verify_index_match() higher apply: plug the three-way merge logic in apply: fall back on three-way merge apply: accept -3/--3way command line option apply: move "already exists" logic to check_to_create() apply: move check_to_create_blob() closer to its sole caller apply: further split load_preimage() apply: refactor "previous patch" logic apply: split load_preimage() helper function out apply: factor out checkout_target() helper function apply: refactor read_file_or_gitlink() apply: clear_image() clears things a bit more apply: a bit more comments on PATH_TO_BE_DELETED apply: fix an incomplete comment in check_patch()
2012-07-15Merge branch 'cw/rebase-i-root'Libravatar Junio C Hamano2-5/+31
"git rebase [-i] --root $tip" can now be used to rewrite all the history down to the root. * cw/rebase-i-root: t3404: make test 57 work with dash and others Add tests for rebase -i --root without --onto rebase -i: support --root without --onto
2012-07-15Merge branch 'pw/git-p4-move'Libravatar Junio C Hamano1-8/+8
* pw/git-p4-move: git p4: add support for 'p4 move' in P4Submit git p4: refactor diffOpts calculation
2012-07-13Merge branch 'pw/git-p4-jobs'Libravatar Junio C Hamano3-5/+168
Teach "git p4" to notice "Jobs:" in the log message and relay it to Perforce to trigger its "jobs" support. # By Pete Wyckoff * pw/git-p4-jobs: git p4: notice Jobs lines in git commit messages git p4 test: refactor marshal_dump git p4: remove unused P4Submit interactive setting
2012-07-13Merge branch 'jc/refactor-diff-stdin'Libravatar Junio C Hamano1-0/+12
Due to the way "git diff --no-index" is bolted onto by touching the low level code that is shared with the rest of the "git diff" code, even though it has to work in a very different way, any comparison that involves a file "-" at the root level incorrectly tried to read from the standard input. This cleans up the no-index codepath further to remove code that reads from the standard input from the core side, which is never necessary when git is running its usual diff operation. * jc/refactor-diff-stdin: diff-index.c: "git diff" has no need to read blob from the standard input diff-index.c: unify handling of command line paths diff-index.c: do not pretend paths are pathspecs
2012-07-13Merge branch 'tb/sanitize-decomposed-utf-8-pathname'Libravatar Junio C Hamano1-0/+164
Teaches git to normalize pathnames read from readdir(3) and all arguments from the command line into precomposed UTF-8 (assuming that they come as decomposed UTF-8) to work around issues on Mac OS. I think there still are other places that need conversion (e.g. paths that are read from stdin for some commands), but this should be a good first step in the right direction. * tb/sanitize-decomposed-utf-8-pathname: git on Mac OS and precomposed unicode
2012-07-13Merge branch 'tr/maint-show-walk'Libravatar Junio C Hamano1-0/+91
Fixes "git show"'s auto-walking behaviour, and make it behave just like "git log" does when it walks. * tr/maint-show-walk: show: fix "range implies walking" Demonstrate git-show is broken with ranges
2012-07-13Merge branch 'mz/rebase-no-mbox'Libravatar Junio C Hamano2-5/+35
Teach "am --rebasing" codepath to grab authorship, log message and the patch text directly out of existing commits. This will help rebasing commits that have confusing "diff" output in their log messages. * mz/rebase-no-mbox: am: don't call mailinfo if $rebasing am --rebasing: get patch body from commit, not from mailbox rebase --root: print usage on too many args rebase: don't source git-sh-setup twice
2012-07-13t1512: match the "other" object namesLibravatar Junio C Hamano1-3/+3
The test creates 16 objects that share the same prefix, and two other objects that do not. Tweak the test so that the other two share the same prefix that is different from the one that is shared by the 16. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-07-12git p4: add support for 'p4 move' in P4SubmitLibravatar Gary Gibbons1-8/+8
For -M option (detectRenames) in P4Submit, use 'p4 move' rather than 'p4 integrate'. Check Perforce server for exisitence of 'p4 move' and use it if present, otherwise revert to 'p4 integrate'. [pw: wildcard-encode src/dest, add/update tests, tweak code] Signed-off-by: Gary Gibbons <ggibbons@perforce.com> Signed-off-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-07-12t7003: add test to filter a branch with a commit at epochLibravatar Junio C Hamano2-3/+13
Running filter-branch on a history that has a commit with timestamp at epoch used to fail, but it should have been fixed. Add test to make sure it won't break again. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-07-11t1512: ignore whitespaces in wc -l outputLibravatar Junio C Hamano1-1/+1
Some implementations of sed (e.g. MacOS X) have whitespaces in the output of "wc -l" that reads from the standard input. Ignore these whitespaces by not quoting the command substitution to be compared with the constant "16". Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-07-11cache_name_compare(): do not truncate while comparing pathsLibravatar Junio C Hamano1-0/+39
We failed to use ce_namelen() equivalent and instead only compared up to the CE_NAMEMASK bytes by mistake. Adding an overlong path that shares the same common prefix as an existing entry in the index did not add a new entry, but instead replaced the existing one, as the result. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-07-10commit: fix "--amend --only" with no pathspecLibravatar Jeff King1-0/+10
When we do not have any pathspec, we typically disallow an explicit "--only", because it makes no sense (your commit would, by definition, be empty). But since 6a74642 (git-commit --amend: two fixes., 2006-04-20), we have allowed "--amend --only" with the intent that it would amend the commit, ignoring any contents staged in the index. However, while that commit allowed the combination, we never actually implemented the logic to make it work. The current code notices that we have no pathspec and assumes we want to do an as-is commit (i.e., the "--only" is ignored). Instead, we must make sure to follow the partial-commit code-path. We also need to tweak the list_paths function to handle a NULL pathspec. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-07-09apply: tests for the --3way optionLibravatar Junio C Hamano1-0/+54
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-07-09rev-parse --disambiguate=<prefix>Libravatar Junio C Hamano1-0/+9
The new option allows you to feed an ambiguous prefix and enumerate all the objects that share it as a prefix of their object names. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-07-09rev-parse: A and B in "rev-parse A..B" refer to committishLibravatar Junio C Hamano1-1/+1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-07-09reset: the command takes committishLibravatar Junio C Hamano1-1/+1
This is not strictly correct, in that resetting selected index entries from corresponding paths out of a given tree without moving HEAD is a valid operation, and in such case a tree-ish would suffice. But the existing code already requires a committish in the codepath, so let's be consistent with it for now. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-07-09commit-tree: the command wants a tree and commitsLibravatar Junio C Hamano1-2/+2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-07-09apply: --build-fake-ancestor expects blobsLibravatar Junio C Hamano1-1/+1
The "index" line read from the patch to reconstruct a partial preimage tree records the object names of blob objects. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-07-09sha1_name.c: add support for disambiguating other typesLibravatar Junio C Hamano1-1/+1
This teaches the revision parser that in "$name:$path" (used for a blob object name), "$name" must be a tree-ish. There are many more places where we know what types of objects are called for. This patch adds support for "commit", "treeish", "tree", and "blob", which could be used in the following contexts: - "git apply --build-fake-ancestor" reads the "index" lines from the patch; they must name blob objects (not even "blob-ish"); - "git commit-tree" reads a tree object name (not "tree-ish"), and zero or more commit object names (not "committish"); - "git reset $rev" wants a committish; "git reset $rev -- $path" wants a treeish. They will come in later patches in the series. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-07-09revision.c: the "log" family, except for "show", takes committishLibravatar Junio C Hamano1-1/+1
Add a field to setup_revision_opt structure and allow these callers to tell the setup_revisions command parsing machinery that short SHA1 it encounters are meant to name committish. This step does not go all the way to connect the setup_revisions() to sha1_name.c yet. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-07-09sha1_name.c: introduce get_sha1_committish()Libravatar Junio C Hamano1-1/+1
Many callers know that the user meant to name a committish by syntactical positions where the object name appears. Calling this function allows the machinery to disambiguate shorter-than-unique abbreviated object names between committish and others. Note that this does NOT error out when the named object is not a committish. It is merely to give a hint to the disambiguation machinery. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-07-09sha1_name.c: many short names can only be committishLibravatar Junio C Hamano1-1/+1
We know that the token "$name" that appear in "$name^{commit}", "$name^4", "$name~4" etc. can only name a committish (either a commit or a tag that peels to a commit). Teach get_short_sha1() to take advantage of that knowledge when disambiguating an abbreviated SHA-1 given as an object name. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-07-09sha1_name.c: get_describe_name() by definition groks only commitsLibravatar Junio C Hamano1-0/+255
Teach get_describe_name() to pass the disambiguation hint down the callchain to get_short_sha1(). Also add tests to show various syntactic elements that we could take advantage of the object type information to help disambiguration of abbreviated object names. Many of them are marked as broken, and some of them will be fixed in later patches in this series. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-07-09apply: allow rerere() to work on --3way resultsLibravatar Junio C Hamano1-0/+25
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-07-09apply: register conflicted stages to the indexLibravatar Junio C Hamano1-0/+78
Now we have all the necessary logic to fall back on three-way merge when the patch does not cleanly apply, insert the conflicted entries to the index as appropriate. This obviously triggers only when the "--index" option is used. When we fall back to three-way merge and some of the merges fail, just like the case where the "--reject" option was specified and we had to write some "*.rej" files out for unapplicable patches, exit the command with non-zero status without showing the diffstat and summary. Otherwise they would make the list of problematic paths scroll off the display. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-07-09apply: accept -3/--3way command line optionLibravatar Junio C Hamano1-0/+8
Begin teaching the three-way merge fallback logic "git am -3" uses to the underlying "git apply". It only implements the command line parsing part, and does not do anything interesting yet, other than making sure that "--reject" and "--3way" are not given together, and making "--3way" imply "--index". Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-07-09Allow edit of empty message with commit --amendLibravatar Chris Webb1-0/+15
"git commit --amend" used on a commit with an empty message fails unless -m is given, whether or not --allow-empty-message is specified. Allow it to proceed to the editor with an empty commit message. Unless --allow-empty-message is in force, it will still abort later if an empty message is saved from the editor (this check was already necessary to prevent a non-empty commit message being edited to an empty one). Add a test for --amend --edit of an empty commit message which fails without this fix, as it's a rare case that won't get frequently tested otherwise. Signed-off-by: Chris Webb <chris@arachsys.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-07-09Merge branch 'mz/empty-rebase-test'Libravatar Junio C Hamano1-0/+8
We did not have test to make sure "git rebase" without extra options filters out an empty commit in the original history. * mz/empty-rebase-test: add test case for rebase of empty commit
2012-07-09Merge branch 'pw/git-p4-tests'Libravatar Junio C Hamano9-433/+574
More "git p4" tests. * pw/git-p4-tests: git p4 test: fix badp4dir test git p4 test: split up big t9800 test git p4 test: cleanup_git should make a new $git git p4 test: copy source indeterminate git p4 test: check for error message in failed test git p4 test: rename some "git-p4 command" strings git p4 test: never create default test repo git p4 test: simplify quoting involving TRASH_DIRECTORY git p4 test: use real_path to resolve p4 client symlinks git p4 test: wait longer for p4d to start and test its pid
2012-07-09Merge branch 'js/fast-export-paths-with-spaces'Libravatar Junio C Hamano1-1/+1
"git fast-export" produced an input stream for fast-import without properly quoting pathnames when they contain SPs in them. * js/fast-export-paths-with-spaces: fast-export: quote paths with spaces
2012-07-09Merge branch 'cw/no-detaching-an-unborn'Libravatar Junio C Hamano1-0/+6
"git checkout --detach", when you are still on an unborn branch, should be forbidden, but it wasn't. * cw/no-detaching-an-unborn: git-checkout: disallow --detach on unborn branch
2012-07-09Merge branch 'vr/use-our-perl-in-tests'Libravatar Junio C Hamano26-44/+65
Some implementations of Perl terminates "lines" with CRLF even when the script is operating on just a sequence of bytes. Make sure to use "$PERL_PATH", the version of Perl the user told Git to use, in our tests to avoid unnecessary breakages in tests. * vr/use-our-perl-in-tests: t/README: add a bit more Don'ts tests: enclose $PERL_PATH in double quotes t/test-lib.sh: export PERL_PATH for use in scripts t: Replace 'perl' by $PERL_PATH
2012-07-09Merge branch 'mm/credential-plumbing'Libravatar Junio C Hamano2-2/+51
Expose the credential API to scripted Porcelain writers. * mm/credential-plumbing: git-remote-mediawiki: update comments to reflect credential support git-remote-mediawiki: add credential support git credential fill: output the whole 'struct credential' add 'git credential' plumbing command
2012-07-09Merge branch 'mm/config-xdg'Libravatar Junio C Hamano1-0/+158
Teach git to read various information from $XDG_CONFIG_HOME/git/ to allow the user to avoid cluttering $HOME. * mm/config-xdg: config: write to $XDG_CONFIG_HOME/git/config file when appropriate Let core.attributesfile default to $XDG_CONFIG_HOME/git/attributes Let core.excludesfile default to $XDG_CONFIG_HOME/git/ignore config: read (but not write) from $XDG_CONFIG_HOME/git/config file
2012-07-08git on Mac OS and precomposed unicodeLibravatar Torsten Bögershausen1-0/+164
Mac OS X mangles file names containing unicode on file systems HFS+, VFAT or SAMBA. When a file using unicode code points outside ASCII is created on a HFS+ drive, the file name is converted into decomposed unicode and written to disk. No conversion is done if the file name is already decomposed unicode. Calling open("\xc3\x84", ...) with a precomposed "Ä" yields the same result as open("\x41\xcc\x88",...) with a decomposed "Ä". As a consequence, readdir() returns the file names in decomposed unicode, even if the user expects precomposed unicode. Unlike on HFS+, Mac OS X stores files on a VFAT drive (e.g. an USB drive) in precomposed unicode, but readdir() still returns file names in decomposed unicode. When a git repository is stored on a network share using SAMBA, file names are send over the wire and written to disk on the remote system in precomposed unicode, but Mac OS X readdir() returns decomposed unicode to be compatible with its behaviour on HFS+ and VFAT. The unicode decomposition causes many problems: - The names "git add" and other commands get from the end user may often be precomposed form (the decomposed form is not easily input from the keyboard), but when the commands read from the filesystem to see what it is going to update the index with already is on the filesystem, readdir() will give decomposed form, which is different. - Similarly "git log", "git mv" and all other commands that need to compare pathnames found on the command line (often but not always precomposed form; a command line input resulting from globbing may be in decomposed) with pathnames found in the tree objects (should be precomposed form to be compatible with other systems and for consistency in general). - The same for names stored in the index, which should be precomposed, that may need to be compared with the names read from readdir(). NFS mounted from Linux is fully transparent and does not suffer from the above. As Mac OS X treats precomposed and decomposed file names as equal, we can - wrap readdir() on Mac OS X to return the precomposed form, and - normalize decomposed form given from the command line also to the precomposed form, to ensure that all pathnames used in Git are always in the precomposed form. This behaviour can be requested by setting "core.precomposedunicode" configuration variable to true. The code in compat/precomposed_utf8.c implements basically 4 new functions: precomposed_utf8_opendir(), precomposed_utf8_readdir(), precomposed_utf8_closedir() and precompose_argv(). The first three are to wrap opendir(3), readdir(3), and closedir(3) functions. The argv[] conversion allows to use the TAB filename completion done by the shell on command line. It tolerates other tools which use readdir() to feed decomposed file names into git. When creating a new git repository with "git init" or "git clone", "core.precomposedunicode" will be set "false". The user needs to activate this feature manually. She typically sets core.precomposedunicode to "true" on HFS and VFAT, or file systems mounted via SAMBA. Helped-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Torsten Bögershausen <tboegi@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-07-05git p4: notice Jobs lines in git commit messagesLibravatar Pete Wyckoff1-0/+155
P4 has a feature called "jobs" that allows linking changes to a bug tracking system or other tasks. When submitting code, a job name can be specified to mark that this change is associated with a particular job. Teach git-p4 to find an optional "Jobs:" line in git commit messages and use them to make a Jobs section in the p4 change specifitation. Signed-off-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-07-05git p4 test: refactor marshal_dumpLibravatar Pete Wyckoff2-5/+13
This function will be useful in future tests. Move it to the git-p4 test library. Let it accept an optional argument to pick a certain marshaled object out of the input stream. Signed-off-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-07-05t3404: make test 57 work with dash and othersLibravatar Michael J Gruber1-1/+5
The construct VAR=value test_must_fail command args works only for some shells (such as bash) but not others (such as dash) because VAR=value does not end up in the environment for command when it is called by the shell function test_must_fail. That is why we explicitly set and export variable in a subshell, i.e. ( VAR=value && export VAR && test_must_fail command args ) in most places already, bar the newly introduced 57 from b64b7fe (Add tests for rebase -i --root without --onto, 2012-06-26). Make test 57 use that construct also. Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-07-04Merge branch 'nd/clone-single-fix'Libravatar Junio C Hamano1-1/+6
"git clone --single-branch" to clone a single branch did not limit the cloning to the specified branch. * nd/clone-single-fix: clone: fix ref selection in --single-branch --branch=xxx
2012-07-04Merge branch 'th/diff-no-index-fixes'Libravatar Junio C Hamano2-2/+86
"git diff --no-index" did not correctly handle relative paths and did not give correct exit codes when run under "--quiet" option. * th/diff-no-index-fixes: diff-no-index: exit(1) if 'diff --quiet <repo file> <external file>' finds changes diff: handle relative paths in no-index
2012-07-04Merge branch 'hv/remote-end-hung-up'Libravatar Junio C Hamano1-9/+7
When we get disconnected while expecting a response from the remote side because authentication failed, we issued an error message "The remote side hung up unexpectedly." Give hint that it may be a permission problem in the message when we can reasonably suspect it. * hv/remote-end-hung-up: remove the impression of unexpectedness when access is denied
2012-06-28diff-index.c: "git diff" has no need to read blob from the standard inputLibravatar Junio C Hamano1-0/+12
Only "diff --no-index -" does. Bolting the logic into the low-level function diff_populate_filespec() was a layering violation from day one. Move populate_from_stdin() function out of the generic diff.c to its only user, diff-index.c. Also make sure "-" from the command line stays a special token "read from the standard input", even if we later decide to sanitize the result from prefix_filename() function in a few obvious ways, e.g. removing unnecessary "./" prefix, duplicated slashes "//" in the middle, etc. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-06-28Merge branch 'fc/git-prompt-script'Libravatar Junio C Hamano3-13/+475
Split a rather heavy-ish "git completion" script out to create a separate "git prompting" script, to help lazy-autoloading of the completion part while making prompting part always available.