summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2012-11-27remote-hg: fix for older versions of pythonLibravatar Felipe Contreras1-4/+8
As Amit Bakshi reported, older versions of python (< 2.7) don't have subprocess.check_output, so let's use subprocess.Popen directly as suggested. Suggested-by: Amit Bakshi <ambakshi@gmail.com> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-11-27remote-hg: fix for files with spacesLibravatar Felipe Contreras1-1/+1
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-11-12remote-hg: avoid bad refsLibravatar Felipe Contreras1-0/+3
Turns out fast-export throws bad 'reset' commands because of a behavior in transport-helper that is not even needed. Either way, better to ignore them, otherwise the user will get warnings when we OK them. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Jeff King <peff@peff.net>
2012-11-12remote-hg: try the 'tip' if no checkout presentLibravatar Felipe Contreras1-0/+2
There's no concept of HEAD in mercurial, but let's try our best to do something sensible. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Jeff King <peff@peff.net>
2012-11-12remote-hg: fix compatibility with older versions of hgLibravatar Felipe Contreras1-1/+1
Turns out repo.revs was introduced quite late, and it doesn't do anything fancy for our refspec; only list all the numbers in that range. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Jeff King <peff@peff.net>
2012-11-12remote-hg: add missing config for basic testsLibravatar Ramkumar Ramachandra1-0/+9
'hg commit' fails otherwise in some versions of mercurial because of the missing user information. Other versions simply throw a warning and guess though. Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Jeff King <peff@peff.net>
2012-11-04remote-hg: the author email can be nullLibravatar Felipe Contreras1-3/+3
Like 'Foo <>'. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Jeff King <peff@peff.net>
2012-11-04remote-hg: add option to not track branchesLibravatar Felipe Contreras1-8/+14
Some people prefer it this way. % git config --global remote-hg.track-branches false Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Jeff King <peff@peff.net>
2012-11-04remote-hg: add extra author testLibravatar Felipe Contreras1-1/+5
For hg.hg. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Jeff King <peff@peff.net>
2012-11-04remote-hg: add tests to compare with hg-gitLibravatar Felipe Contreras1-0/+462
The base commands come from the tests of the hg-git project. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Jeff King <peff@peff.net>
2012-11-04remote-hg: add bidirectional testsLibravatar Felipe Contreras1-0/+243
Base commands from hg-git tests: https://bitbucket.org/durin42/hg-git/src Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Jeff King <peff@peff.net>
2012-11-04test-lib: avoid full path to store test resultsLibravatar Felipe Contreras1-1/+2
No reason to use the full path in case this is used externally. Otherwise we might get errors such as: ./test-lib.sh: line 394: /home/bob/dev/git/t/test-results//home/bob/dev/git/contrib/remote-hg/test-2894.counts: No such file or directory Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Jeff King <peff@peff.net>
2012-11-04remote-hg: add basic testsLibravatar Felipe Contreras2-0/+125
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Jeff King <peff@peff.net>
2012-11-04remote-hg: fake bookmark when there's noneLibravatar Felipe Contreras1-5/+14
Or at least no current bookmark. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Jeff King <peff@peff.net>
2012-11-04remote-hg: add compat for hg-git author fixesLibravatar Felipe Contreras1-6/+53
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Jeff King <peff@peff.net>
2012-11-04remote-hg: add support for hg-git compat modeLibravatar Felipe Contreras1-6/+83
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Jeff King <peff@peff.net>
2012-11-04remote-hg: match hg merge behaviorLibravatar Felipe Contreras1-0/+17
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Jeff King <peff@peff.net>
2012-11-04remote-hg: make sure the encoding is correctLibravatar Felipe Contreras1-1/+11
Independently of the environment. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Jeff King <peff@peff.net>
2012-11-04remote-hg: add support to push URLsLibravatar Felipe Contreras1-2/+12
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Jeff King <peff@peff.net>
2012-11-04remote-hg: add support for remote pushingLibravatar Felipe Contreras1-2/+7
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Jeff King <peff@peff.net>
2012-11-04remote-hg: add support for pushingLibravatar Felipe Contreras1-2/+215
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Jeff King <peff@peff.net>
2012-11-04Add new remote-hg transport helperLibravatar Felipe Contreras1-0/+391
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Jeff King <peff@peff.net>
2012-10-29Merge branch 'rs/branch-del-symref'Libravatar Jeff King2-26/+68
A symbolic ref refs/heads/SYM was not correctly removed with "git branch -d SYM"; the command removed the ref pointed by SYM instead. * rs/branch-del-symref: branch: show targets of deleted symrefs, not sha1s branch: skip commit checks when deleting symref branches branch: delete symref branch, not its target branch: factor out delete_branch_config() branch: factor out check_branch_commit()
2012-10-29Merge branch 'nd/status-long'Libravatar Jeff King3-6/+30
Allow an earlier "--short" option on the command line to be countermanded with the "--long" option for "git status" and "git commit". * nd/status-long: status: add --long output format option
2012-10-29Merge branch 'jk/sh-setup-in-filter-branch'Libravatar Jeff King3-54/+59
Refactoring to avoid code duplication in shell scripts. * jk/sh-setup-in-filter-branch: filter-branch: use git-sh-setup's ident parsing functions git-sh-setup: refactor ident-parsing functions
2012-10-29Merge branch 'nd/grep-true-path'Libravatar Jeff King4-17/+51
"git grep -e pattern <tree>" asked the attribute system to read "<tree>:.gitattributes" file in the working tree, which was nonsense. * nd/grep-true-path: grep: stop looking at random places for .gitattributes
2012-10-29Merge branch 'jk/maint-http-init-not-in-result-handler'Libravatar Jeff King3-14/+12
Further clean-up to the http codepath that picks up results after cURL library is done with one request slot. * jk/maint-http-init-not-in-result-handler: http: do not set up curl auth after a 401 remote-curl: do not call run_slot repeatedly
2012-10-29Merge branch 'jc/grep-pcre-loose-ends'Libravatar Jeff King7-129/+225
"git log -F -E --grep='<ere>'" failed to use the given <ere> pattern as extended regular expression, and instead looked for the string literally. The early part of this series is a fix for it; the latter part teaches log to respect the grep.* configuration. * jc/grep-pcre-loose-ends: log: honor grep.* configuration log --grep: accept --basic-regexp and --perl-regexp log --grep: use the same helper to set -E/-F options as "git grep" revisions: initialize revs->grep_filter using grep_init() grep: move pattern-type bits support to top-level grep.[ch] grep: move the configuration parsing logic to grep.[ch] builtin/grep.c: make configuration callback more reusable
2012-10-29Merge branch 'jl/submodule-add-by-name'Libravatar Jeff King5-14/+121
If you remove a submodule, in order to keep the repository so that "git checkout" to an older commit in the superproject history can resurrect the submodule, the real repository will stay in $GIT_DIR of the superproject. A later "git submodule add $path" to add a different submodule at the same path will fail. Diagnose this case a bit better, and if the user really wants to add an unrelated submodule at the same path, give the "--name" option to give it a place in $GIT_DIR of the superproject that does not conflict with the original submodule. * jl/submodule-add-by-name: submodule add: Fail when .git/modules/<name> already exists unless forced Teach "git submodule add" the --name option
2012-10-29Merge branch 'jl/submodule-rm'Libravatar Jeff King5-15/+550
"git rm submodule" cannot blindly remove a submodule directory as its working tree may have local changes, and worse yet, it may even have its repository embedded in it. Teach it some special cases where it is safe to remove a submodule, specifically, when there is no local changes in the submodule working tree, and its repository is not embedded in its working tree but is elsewhere and uses the gitfile mechanism to point at it. * jl/submodule-rm: submodule: teach rm to remove submodules unless they contain a git directory
2012-10-25Merge branch 'jk/strbuf-detach-always-non-null'Libravatar Jeff King1-1/+3
* jk/strbuf-detach-always-non-null: strbuf: always return a non-NULL value from strbuf_detach
2012-10-25Merge branch 'js/mingw-fflush-errno'Libravatar Jeff King3-6/+26
* js/mingw-fflush-errno: maybe_flush_or_die: move a too-loose Windows specific error
2012-10-25Merge branch 'da/mergetools-p4'Libravatar Jeff King1-0/+25
* da/mergetools-p4: mergetools/p4merge: Handle "/dev/null"
2012-10-25Merge branch 'jc/test-say-color-avoid-echo-escape'Libravatar Jeff King1-1/+1
Recent nd/wildmatch series was the first to reveal this ancient bug in the test scaffolding. * jc/test-say-color-avoid-echo-escape: test-lib: Fix say_color () not to interpret \a\b\c in the message
2012-10-25Merge branch 'nd/attr-match-optim'Libravatar Jeff King1-8/+13
Trivial and obvious optimization for finding attributes that match a given path. * nd/attr-match-optim: attr: avoid searching for basename on every match attr: avoid strlen() on every match
2012-10-25Merge branch 'jk/peel-ref'Libravatar Jeff King5-36/+19
Speeds up "git upload-pack" (what is invoked by "git fetch" on the other side of the connection) by reducing the cost to advertise the branches and tags that are available in the repository. * jk/peel-ref: upload-pack: use peel_ref for ref advertisements peel_ref: check object type before loading peel_ref: do not return a null sha1 peel_ref: use faster deref_tag_noverify
2012-10-25Merge branch 'bw/config-lift-variable-name-length-limit'Libravatar Jeff King1-30/+29
The configuration parser had an unnecessary hardcoded limit on variable names that was not checked consistently. Lift the limit. * bw/config-lift-variable-name-length-limit: Remove the hard coded length limit on variable names in config files
2012-10-25Merge branch 'fa/remote-svn'Libravatar Jeff King16-38/+655
A GSoC project. * fa/remote-svn: Add a test script for remote-svn remote-svn: add marks-file regeneration Add a svnrdump-simulator replaying a dump file for testing remote-svn: add incremental import remote-svn: Activate import/export-marks for fast-import Create a note for every imported commit containing svn metadata vcs-svn: add fast_export_note to create notes Allow reading svn dumps from files via file:// urls remote-svn, vcs-svn: Enable fetching to private refs When debug==1, start fast-import with "--stats" instead of "--quiet" Add documentation for the 'bidi-import' capability of remote-helpers Connect fast-import to the remote-helper via pipe, adding 'bidi-import' capability Add argv_array_detach and argv_array_free_detached Add svndump_init_fd to allow reading dumps from arbitrary FDs Add git-remote-testsvn to Makefile Implement a remote helper for svn in C
2012-10-25Merge branch 'jm/diff-context-config'Libravatar Jeff King3-1/+104
Teaches a new configuration variable to "git diff" Porcelain and its friends. * jm/diff-context-config: t4055: avoid use of sed 'a' command diff: diff.context configuration gives default to -U
2012-10-25Merge branch 'jk/no-more-pre-exec-callback'Libravatar Jeff King3-29/+0
Removes a workaround for buggy version of less older than version 406. * jk/no-more-pre-exec-callback: pager: drop "wait for output to run less" hack
2012-10-21Git 1.8.0Libravatar Junio C Hamano3-10/+19
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-10-18filter-branch: use git-sh-setup's ident parsing functionsLibravatar Jeff King2-35/+16
This saves us some code, but it also reduces the number of processes we start for each filtered commit. Since we can parse both author and committer in the same sed invocation, we save one process. And since the new interface avoids tr, we save 4 processes. It also avoids using "tr", which has had some odd portability problems reported with from Solaris's xpg6 version. We also tweak one of the tests in t7003 to double-check that we are properly exporting the variables (because test-lib.sh exports GIT_AUTHOR_NAME, it will be automatically exported in subprograms. We override this to make sure that filter-branch handles it properly itself). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-10-18git-sh-setup: refactor ident-parsing functionsLibravatar Jeff King1-19/+43
The only ident-parsing function we currently provide is get_author_ident_from_commit. This is not very flexible for two reasons: 1. It takes a commit as an argument, and can't read from commit headers saved on disk. 2. It will only parse authors, not committers. This patch provides a more flexible interface which will parse multiple idents from a commit provide on stdin. We can easily use it as a building block for the current function to retain compatibility. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-10-18status: add --long output format optionLibravatar Jeff King3-6/+30
You can currently set the output format to --short or --porcelain. There is no --long, because we default to it already. However, you may want to override an alias that uses "--short" to get back to the default. This requires a little bit of refactoring, because currently we use STATUS_FORMAT_LONG internally to mean the same as "the user did not specify anything". By expanding the enum to include STATUS_FORMAT_NONE, we can distinguish between the implicit and explicit cases. This effects these conditions: 1. The user has asked for NUL termination. With NONE, we currently default to turning on the porcelain mode. With an explicit --long, we would in theory use NUL termination with the long mode, but it does not support it. So we can just complain and die. 2. When an output format is given to "git commit", we default to "--dry-run". This behavior would now kick in when "--long" is given, too. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-10-18branch: show targets of deleted symrefs, not sha1sLibravatar René Scharfe2-11/+13
git branch reports the abbreviated hash of the head commit of a deleted branch to make it easier for a user to undo the operation. For symref branches this doesn't help. Print the symref target instead for them. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-10-18branch: skip commit checks when deleting symref branchesLibravatar René Scharfe2-2/+17
Before a branch is deleted, we check that it points to a valid commit. With -d we also check that the commit is a merged; this check is not done with -D. The reason for that is that commits pointed to by branches should never go missing; if they do then something broke and it's better to stop instead of adding to the mess. And a non-merged commit may contain changes that are worth preserving, so we require the stronger option -D instead of -d to get rid of them. If a branch consists of a symref, these concerns don't apply. Deleting such a branch can't make a commit become unreferenced, so we don't need to check if it is merged, or even if it is actually a valid commit. Skip them in that case. This allows us to delete dangling symref branches. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-10-18branch: delete symref branch, not its targetLibravatar René Scharfe2-1/+12
If a branch that is to be deleted happens to be a symref to another branch, the current code removes the targeted branch instead of the one it was called for. Change this surprising behaviour and delete the symref branch instead. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-10-18branch: factor out delete_branch_config()Libravatar René Scharfe1-5/+10
Provide a small helper function for deleting branch config sections. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-10-18branch: factor out check_branch_commit()Libravatar René Scharfe1-12/+21
Move the code to perform checks on the tip commit of a branch to its own function. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-10-18strbuf: always return a non-NULL value from strbuf_detachLibravatar Jeff King1-1/+3
The current behavior is to return NULL when strbuf did not actually allocate a string. This can be quite surprising to callers, though, who may feed the strbuf from arbitrary data and expect to always get a valid value. In most cases, it does not make a difference because calling any strbuf function will cause an allocation (even if the function ends up not inserting any data). But if the code is structured like: struct strbuf buf = STRBUF_INIT; if (some_condition) strbuf_addstr(&buf, some_string); return strbuf_detach(&buf, NULL); then you may or may not return NULL, depending on the condition. This can cause us to segfault in http-push (when fed an empty URL) and in http-backend (when an empty parameter like "foo=bar&&" is in the $QUERY_STRING). This patch forces strbuf_detach to allocate an empty NUL-terminated string when it is called on a strbuf that has not been allocated. I investigated all call-sites of strbuf_detach. The majority are either not affected by the change (because they call a strbuf_* function unconditionally), or can handle the empty string just as easily as NULL. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>