Граф коммитов

2210 Коммитов

Автор SHA1 Сообщение Дата
Célestin Matte 6b825a4622 git-remote-mediawiki: change style in a regexp
In this regexp, ' |\n' is used, whereas its equivalent '[ \n]', which is
clearer, is used elsewhere. Make the style coherent.

Signed-off-by: Célestin Matte <celestin.matte@ensimag.fr>
Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-14 09:02:16 -07:00
Célestin Matte 857f21a3c1 git-remote-mediawiki: change separator of some regexps
Use {}{} instead of /// when slashes are used inside the regexp so as not to
escape it.

Signed-off-by: Célestin Matte <celestin.matte@ensimag.fr>
Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-14 09:02:16 -07:00
Célestin Matte 1149957368 git-remote-mediawiki: change the behaviour of a split
A "split ' '" is turned into a "split / /", which changes its behaviour: the
old method matched a run of whitespaces (/\s*/), while the new one will match a
single space, which is what we want here. Indeed, in other contexts,
changing split(' ') to split(/ /) could potentially be a regression, however,
here, when parsing the output of "rev-list --parents", whose output SHA-1's are
each separated by a single space, splitting on a single space is perfectly
correct.

Signed-off-by: Célestin Matte <celestin.matte@ensimag.fr>
Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-14 09:02:16 -07:00
Célestin Matte eb96b75039 git-remote-mediawiki: remove useless regexp modifier (m)
m// and // is used randomly. It is better to use the m modifier only when
needed, e.g., when the regexp uses another separator than //.

Signed-off-by: Célestin Matte <celestin.matte@ensimag.fr>
Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-14 09:02:16 -07:00
Célestin Matte 6c2fbe25fb git-remote-mediawiki: rewrite unclear line of instructions
Subroutines' parameters should be assigned to variable before doing anything
else
Besides, existing instruction affected a variable inside a "if", which break
Git's coding style

Signed-off-by: Célestin Matte <celestin.matte@ensimag.fr>
Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-14 09:02:16 -07:00
Célestin Matte 81f6a7a43d git-remote-mediawiki: change syntax of map calls
Put first parameter of map inside a block, for better readability.
Follow BuiltinFunctions::RequireBlockMap

Signed-off-by: Célestin Matte <celestin.matte@ensimag.fr>
Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-14 09:02:16 -07:00
Célestin Matte 0afd29e2d3 git-remote-mediawiki: move a variable declaration at the top of the code
%basetimestamps declaration was lost in the middle of subroutines

Signed-off-by: Célestin Matte <celestin.matte@ensimag.fr>
Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-14 09:02:16 -07:00
Célestin Matte 1aff8c627b git-remote-mediawiki: always end a subroutine with a return
Follow Subroutines::RequireFinalReturn

Signed-off-by: Célestin Matte <celestin.matte@ensimag.fr>
Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-14 09:02:16 -07:00
Célestin Matte 6a504a3f45 git-remote-mediawiki: replace :utf8 by :encoding(UTF-8)
Follow perlcritic's InputOutput::RequireEncodingWithUTF8Layer policy

Signed-off-by: Célestin Matte <celestin.matte@ensimag.fr>
Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-14 09:02:15 -07:00
Célestin Matte 668eec6f74 git-remote-mediawiki: move "use warnings;" before any instruction
Signed-off-by: Célestin Matte <celestin.matte@ensimag.fr>
Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-14 09:02:15 -07:00
Célestin Matte 05d4c7b1c4 git-remote-mediawiki: make a regexp clearer
Perl's split function takes a regex pattern argument. You can also
feed it an expression, which is then compiled into a regex at runtime.
It therefore works to pass your pattern via single quotes, but it is
much less obvious to a reader that the argument is meant to be a
regex, not a static string. Using the traditional slash-delimiters
makes this easier to read.

Signed-off-by: Célestin Matte <celestin.matte@ensimag.fr>
Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-14 09:02:15 -07:00
Junio C Hamano bdff0e3a37 Merge branch 'rr/complete-difftool-fixup'
"git difftool" can take both revs to be compared and pathspecs.
"git show" takes revs, revs:path and pathspecs.

* rr/complete-difftool-fixup:
  completion: show can take both revlist and paths
  completion: difftool takes both revs and files
2013-06-14 08:46:23 -07:00
Junio C Hamano 7a9cc7b064 Merge branch 'bp/mediawiki-credential'
The bridge to MediaWiki has been updated to use the credential
helper interface in Git.pm, losing its own and the original
implementation the former was based on.

* bp/mediawiki-credential:
  git-remote-mediawiki: use Git.pm functions for credentials
2013-06-14 08:46:17 -07:00
Junio C Hamano 91d34bc47b Merge branch 'rr/remove-contrib-some'
Remove stale contrib/ material.

* rr/remove-contrib-some:
  contrib: drop blameview/ directory
  contrib: remove continuous/ and patches/
2013-06-14 08:45:57 -07:00
Ramkumar Ramachandra 2847cae835 prompt: squelch error output from cat
The files $g/rebase-{merge,apply}/{head-name,msgnum,end} are not
guaranteed to exist.  When attempting to cat them, squelch the error
output.

In addition to guarding against stray directories, this patch addresses
a real problem:

  # on terminal 1
  $ git rebase -i master
  # ignore editor, and switch to terminal 2
  cat: .git/rebase-merge/msgnum: No such file or directory
  cat: .git/rebase-merge/end: No such file or directory
  $

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-14 08:27:09 -07:00
Jeff King 1af6a877c5 contrib: drop blameview/ directory
Blameview was a quick-and-dirty demonstration of how blame's
incremental output could be used in an interface. These days
one can find much better (and less ugly!) demonstrations in
"git gui blame" and "tig blame".

The only advantage blameview has is that its code is perhaps
simpler to read. However, that is balanced by the fact that
it probably has bugs, as nobody uses it nor has touched the
code in 6 years. An implementor is probably better off just
reading the "incremental output" section of "man git-blame".

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-12 13:35:10 -07:00
Célestin Matte 5ada868799 git-remote-mediawiki: display message when launched directly
Users may be confused when they run the perl script directly.
A good way to detect this is to check the number of parameters used to call the
script, which is never different from 2 in a normal use.
Display a proper error message to avoid any confusion.

Signed-off-by: Célestin Matte <celestin.matte@ensimag.fr>
Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-11 14:27:15 -07:00
Junio C Hamano f1e74148fa Merge branch 'mm/mediawiki-https-fail-message'
Hint users when https:// connection failed to check the certificate.

* mm/mediawiki-https-fail-message:
  git-remote-mediawiki: better error message when HTTP(S) access fails
2013-06-11 13:30:43 -07:00
Junio C Hamano cb4d6c2b7d Merge branch 'xq/credential-osxkeychain'
* xq/credential-osxkeychain:
  credential-osxkeychain: support more protocols
2013-06-11 13:30:31 -07:00
Junio C Hamano 221ea21e88 Merge branch 'fc/remote-bzr'
* fc/remote-bzr:
  remote-bzr: add fallback check for a partial clone
  remote-bzr: reorganize the way 'wanted' works
  remote-bzr: trivial cleanups
  remote-bzr: change global repo
  remote-bzr: delay cloning/pulling
  remote-bzr: simplify get_remote_branch()
  remote-bzr: fix for files with spaces
  remote-bzr: recover from failed clones
2013-06-11 13:30:26 -07:00
Junio C Hamano 8d3b97ae51 Merge branch 'fc/remote-hg'
* fc/remote-hg: (50 commits)
  remote-hg: add support for --force
  remote-hg: add support for --dry-run
  remote-hg: check if a fetch is needed
  remote-hg: trivial cleanup
  remote-helpers: improve marks usage
  remote-hg: add check_push() helper
  remote-hg: add setup_big_push() helper
  remote-hg: remove files before modifications
  remote-hg: improve lightweight tag author
  remote-hg: use remote 'default' not local one
  remote-hg: improve branch listing
  remote-hg: simplify branch_tip()
  remote-hg: check diverged bookmarks
  remote-hg: pass around revision refs
  remote-hg: implement custom checkheads()
  remote-hg: implement custom push()
  remote-hg: only update necessary revisions
  remote-hg: force remote bookmark push selectively
  remote-hg: reorganize bookmark handling
  remote-hg: add test for failed double push
  ...
2013-06-11 13:30:24 -07:00
Junio C Hamano a62d73e7c6 Merge branch 'fc/completion-less-ls-remote'
* fc/completion-less-ls-remote:
  completion: avoid ls-remote in certain scenarios
2013-06-11 13:30:16 -07:00
Ramkumar Ramachandra 5269f7f8c6 completion: show can take both revlist and paths
The 'git show' completion uses __git_complete_file (aliased to
__git_complete_revlist_file), because accepts <tree-ish>:<path> as
well as <commit-ish>.  But the command also accepts range of commits
in A..B notation, so using __git_complete_revlist_file is more
appropriate.

There still remain two users of __git_complete_file, completions for
"archive" and "ls-tree".  As these commands do not take range
notation, and "git show" no longer uses __git_complete_file, the
implementation of it can be updated not to complete ranges, but that
is a separate topic.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-09 15:56:35 -07:00
Junio C Hamano 5adb374101 Merge branch 'fc/show-branch-in-rebase-am'
The bash prompt code (in contrib/) displayed the name of the branch
being rebased when "rebase -i/-m/-p" modes are in use, but not the
plain vanilla "rebase".

* fc/show-branch-in-rebase-am:
  prompt: fix for simple rebase
2013-06-06 12:18:41 -07:00
Junio C Hamano 8cb9b5f787 Merge branch 'tg/maint-zsh-svn-remote-prompt'
zsh prompt script that borrowed from bash prompt script did not
work due to slight differences in array variable notation between
these two shells.

* tg/maint-zsh-svn-remote-prompt:
  prompt: fix show upstream with svn and zsh
2013-06-05 14:56:41 -07:00
Junio C Hamano 779fd737d7 Merge branch 'dm/unbash-subtree'
It turns out that git-subtree script does not have to be run with
bash.

* dm/unbash-subtree:
  contrib/git-subtree: Use /bin/sh interpreter instead of /bin/bash
2013-06-05 14:56:24 -07:00
Junio C Hamano eb2694762c Merge branch 'rr/zsh-color-prompt'
Prompt support (in contrib/) for zsh is updated to use colors.

* rr/zsh-color-prompt:
  prompt: colorize ZSH prompt
  prompt: factor out gitstring coloring logic
  prompt: introduce GIT_PS1_STATESEPARATOR
2013-06-05 14:55:10 -07:00
Benoit Person da608b124c git-remote-mediawiki: use Git.pm functions for credentials
In 52dce6d, a new credential function was added to Git.pm, based on
git-remote-mediawiki's functions. The logical follow-up is to use
those functions in git-remote-mediawiki.

Signed-off-by: Benoit Person <benoit.person@ensimag.fr>
Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-05 11:15:24 -07:00
Ramkumar Ramachandra d8517cc667 completion: difftool takes both revs and files
'git difftool' is clearly a frontend to 'git diff' and is used in
exactly the same way, but it uses a misleadingly named completion
function __git_complete_file.  It happens to work only because it
calls __git_complete_revlist_file that completes both revs and
paths.

Change it to use __git_complete_revlist_file, just like 'git diff'.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-03 10:30:04 -07:00
Felipe Contreras e832f5c096 completion: avoid ls-remote in certain scenarios
It's _very_ slow in many cases, and there's really no point in fetching
*everything* from the remote just for completion. In many cases it might
be faster for the user to type the whole thing.

If the user manually specifies 'refs/*', then the full ls-remote
completion is triggered.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-02 16:11:55 -07:00
Junio C Hamano f241c08d40 Merge branch 'fc/completion'
* fc/completion:
  completion: remove __git_index_file_list_filter()
  completion: add space after completed filename
  completion: add hack to enable file mode in bash < 4
  completion: refactor __git_complete_index_file()
  completion: refactor diff_index wrappers
  completion: use __gitcompadd for __gitcomp_file
  completion; remove unuseful comments
  completion: document tilde expansion failure in tests
  completion: add file completion tests
2013-06-02 15:48:12 -07:00
Junio C Hamano 6bf931a54f Merge branch 'fc/zsh-leftover-bits'
* fc/zsh-leftover-bits:
  completion: zsh: improve bash script loading
  completion: synchronize zsh wrapper
  completion: cleanup zsh wrapper
2013-06-02 15:47:33 -07:00
Ramkumar Ramachandra 9721ac9010 contrib: remove continuous/ and patches/
They haven't been touched in six years.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-02 15:42:44 -07:00
Junio C Hamano feffa04437 Merge branch 'jk/subtree-do-not-push-if-split-fails'
"git subtree" (in contrib/) had one codepath with loose error
checks to lose data at the remote side.

* jk/subtree-do-not-push-if-split-fails:
  contrib/subtree: don't delete remote branches if split fails
2013-05-29 14:29:53 -07:00
Felipe Contreras 3646b1a5ab completion: zsh: improve bash script loading
It's better to check in multiple locations, so the user doesn't have to.

And update the documentation.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-29 12:56:30 -07:00
Felipe Contreras 1306321ebe prompt: fix for simple rebase
When we are rebasing without options ('am' mode), the head rebased lives
in '$g/rebase-apply/head-name', so lets use that information so it's
reported the same way as if we were doing other rebases (-i or -m).

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-29 11:27:56 -07:00
Matthieu Moy 0aa0321212 git-remote-mediawiki: better error message when HTTP(S) access fails
My use-case is an invalid SSL certificate. Pulling from the wiki with a
recent version of libwww-perl fails, and git-remote-mediawiki gave no
clue about the reason. Give the mediawiki API detailed error message, and
since it is not so informative, hint the user about an invalid SSL
certificate on https:// urls.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-29 10:00:32 -07:00
Xidorn Quan de56ccf799 credential-osxkeychain: support more protocols
Add protocol imap, imaps, ftp and smtp for credential-osxkeychain.

Signed-off-by: Xidorn Quan <quanxunzhen@gmail.com>
Acked-by: John Szakmeister <john@szakmeister.net>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28 11:29:47 -07:00
Felipe Contreras c9eaef125b remote-hg: add support for --force
And get rid of the remote-hg.force-push option hack.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28 08:02:25 -07:00
Felipe Contreras e3751a1763 remote-hg: add support for --dry-run
This needs a specific patch from Git not applied yet.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28 08:02:24 -07:00
Felipe Contreras ba091c200d remote-hg: check if a fetch is needed
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28 08:02:24 -07:00
Felipe Contreras ab64bc9d21 remote-hg: trivial cleanup
It's better to catch the exception later on.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28 08:02:24 -07:00
Felipe Contreras 8316d18da3 remote-helpers: improve marks usage
Always convert to strings (they are unicode because they come from JSON).

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28 08:02:24 -07:00
Felipe Contreras 42cbbcc73b remote-hg: add check_push() helper
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28 08:02:24 -07:00
Felipe Contreras 2b02a40587 remote-hg: add setup_big_push() helper
So we don't duplicate these commands.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28 08:02:24 -07:00
Felipe Contreras 66f46aa14f remote-hg: remove files before modifications
Otherwise replacing a file with a directory doesn't work.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28 08:02:23 -07:00
Felipe Contreras d462469b4d remote-hg: improve lightweight tag author
Use git's committer.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28 08:02:05 -07:00
Felipe Contreras b688911a78 remote-hg: use remote 'default' not local one
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28 08:02:05 -07:00
Felipe Contreras c2f7a82032 remote-hg: improve branch listing
We want to show the remote heads, not the internal ones, which might
have garbage.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28 08:02:05 -07:00
Felipe Contreras 611024e606 remote-hg: simplify branch_tip()
It simply picks the last head that is not closed, but we have a stored
list of open heads.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28 08:02:05 -07:00
Felipe Contreras d3c460b5b4 remote-hg: check diverged bookmarks
So that we can report a proper error.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28 08:02:05 -07:00
Felipe Contreras 883d7be110 remote-hg: pass around revision refs
So that when a diverge is detected, we know which ref to report an error
for.

Also, since we are not throwing an exception, return a proper error
code.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28 08:02:05 -07:00
Felipe Contreras 19a8cefc44 remote-hg: implement custom checkheads()
The version from Mercurial is extremely inefficient and convoluted, this
version achieves basically the same, at least for our purposes.

No functional changes.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28 08:02:04 -07:00
Felipe Contreras 4f37bdbdb6 remote-hg: implement custom push()
The one from mercurial does a ton of things we are not interested in,
and we need some special modifications which are impossible otherwise.

Most of the code is borrowed from Mercurial, and cleaned up, but should
be functionally the same for our purposes, except that multiple heads
are not detected.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28 08:02:04 -07:00
Felipe Contreras d226945471 remote-hg: only update necessary revisions
We don't care about the rest, and in fact, we shouldn't try to push
everything, as there might be garbage from previous failed pushes.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28 08:02:04 -07:00
Felipe Contreras dfcef29f2f remote-hg: force remote bookmark push selectively
If we update the 'old' node, we might be updating the remote bookmark
even when our 'new' node is not related at all to what the remote has,
effectively forcing an update.

Let's do that only when forced push is configured.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28 08:02:04 -07:00
Felipe Contreras aaadca28b6 remote-hg: reorganize bookmark handling
We don't need to update both internal and remote bookmarks, so let's do
one or the other, and move the shared code earlier, so it's simpler.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28 08:02:04 -07:00
Felipe Contreras 0bf9ee5720 remote-hg: add test for failed double push
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28 08:02:03 -07:00
Felipe Contreras d2c7633028 remote-hg: add test for big push
With lots branches and bookmarks, non-ff, updated and new.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28 08:02:03 -07:00
Felipe Contreras ad22b92a81 remote-hg: add test for new bookmark special
From the point of view of Mercurial, this creates a new branch head,
and requires a forced push.

Ideally, however, we would want it to work just like in git; new
branches can be pushed without problems.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28 08:01:49 -07:00
Felipe Contreras 747b61c6a6 remote-hg: add test for bookmark diverge
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28 08:00:35 -07:00
Felipe Contreras 1a810864e8 remote-hg: add test for diverged push
Neither mercurial nor git allows pushing to a remote when it's a
non-fast-forward push. We should be able to detect these errors and
report them properly, as opposed to throwing an exception
stack-trace.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28 08:00:13 -07:00
Felipe Contreras e14432f798 remote-hg: add test to push new bookmark
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28 07:59:57 -07:00
Felipe Contreras e6e803be79 remote-hg: add remote tests
The logic when working with a local repository is totally different from
the one where we work with a remote repository; we need to pull and push
from it.

All this logic is currently not tested at all, so let's introduce a
variable to force the remote behavior.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28 07:59:57 -07:00
Felipe Contreras 731ce6cf75 remote-hg: update bookmarks when using a remote
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28 07:59:56 -07:00
Felipe Contreras b082b4f94f remote-hg: add check_bookmark() test helper
And check in a more proper way.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28 07:59:56 -07:00
Felipe Contreras 0067ecc82b remote-bzr: simplify test checks
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28 07:59:31 -07:00
Felipe Contreras 9f36d61e7b remote-hg: add tests for 'master' bookmark
We want to make sure everything works correctly, even if there's a
'master' bookmark in Mercurial.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28 07:59:31 -07:00
Felipe Contreras 91347ea3e1 remote-hg: always point HEAD to master
Mercurial always checks out the 'default' branch, so there's no point in
complicating our lives trying to do something fancier, which causes
different behavior depending on whether the repository is local or
remote.

So let's always use 'default' (which we translate to 'master'), unless
we are in hg-git mode, which expects us to use the 'master' bookmark
instead.

Also, update the tests that used to check for different checkout
behaviors to simply check that the refs are there, remove unnecessary
ones, and fix the ones that expect something different.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28 07:59:30 -07:00
Felipe Contreras 63f54cf216 remote-hg: improve progress calculation
No need to manually keep track of the revision count.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28 07:59:30 -07:00
Felipe Contreras 34d75e78f4 remote-hg: trivial cleanups
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28 07:59:30 -07:00
Felipe Contreras 9529cce86e remote-hg: ensure remote rebasing works
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28 07:59:30 -07:00
Felipe Contreras 68b1611678 remote-hg: upgrade version 1 marks
As suggested by Jed Brown; there's no need to re-import all the commits.

Cc: Jed Brown <jed@59a2.org>
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28 07:59:30 -07:00
Felipe Contreras 93ae203495 remote-hg: switch from revisions to SHA-1 noteids
Otherwise we won't know if revisions are replaced.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28 07:59:29 -07:00
Felipe Contreras c43c06b186 remote-hg: add version checks to the marks
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28 07:59:29 -07:00
Felipe Contreras e936a5d484 remote-hg: improve node traversing
We won't be able to count the unmarked commits, but we are not going to
be able to do that anyway when we switch to SHA-1 ids.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28 07:59:29 -07:00
Felipe Contreras 52036431ff remote-hg: shuffle some code
In preparation to shift to SHA-1's.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28 07:59:20 -07:00
Felipe Contreras 6796d49ed0 remote-hg: use a shared repository store
This way we don't have to have duplicated Mercurial objects.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28 07:59:20 -07:00
Felipe Contreras cab3829d2b remote-hg: load all extensions
The user might have then configured differently, plus, all of them will
be loaded anyway later on.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28 07:59:19 -07:00
Felipe Contreras f6f00b46ae remote-hg: test: simplify previous branch checkout
@{-1} does the same thing.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28 07:59:19 -07:00
Felipe Contreras 5f5e92fb79 remote-helpers: test: simplify remote URLs
No need to specify $PWD any more.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28 07:59:19 -07:00
Felipe Contreras 531594e5aa remote-helpers: tests: general improvements
So that we don't need a temporary directory.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28 07:59:19 -07:00
Felipe Contreras dde67d794c remote-helpers: test: cleanup style
So it's more standardized between all the tests.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28 07:59:19 -07:00
Felipe Contreras 4080ac81e5 remote-helpers: test: cleanup white-spaces
We prefer tabs to spaces.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28 07:59:19 -07:00
Felipe Contreras 294ff7b233 remote-hg: trivial reorganization
We only need to get the remote dict once.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28 07:59:18 -07:00
Felipe Contreras cf08a7e15f remote-hg: test: be a little more quiet
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28 07:59:18 -07:00
Felipe Contreras 85f931d3d5 remote-bzr: add fallback check for a partial clone
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28 07:43:25 -07:00
Felipe Contreras e56660a73f remote-bzr: reorganize the way 'wanted' works
If the user specified a list of branches, we ignore what the remote
repository lists, and simply use the branches directly. Since some
remotes don't report the branches correctly, this is useful.

Otherwise either fetch the repo, or the branch.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28 07:43:25 -07:00
Felipe Contreras a8ffc3ade2 remote-bzr: trivial cleanups
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28 07:43:18 -07:00
Felipe Contreras 0454c399c9 remote-bzr: change global repo
It's not used anyway.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28 07:43:18 -07:00
Felipe Contreras 2ae078e847 remote-bzr: delay cloning/pulling
Until the branch is actually going to be used.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28 07:43:18 -07:00
Felipe Contreras 1bf09d4fbf remote-bzr: simplify get_remote_branch()
No need for 'origin', it's only needed for the bzrdir 'sprout' method,
which can be greatly simplified.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28 07:43:18 -07:00
Felipe Contreras ad44a72095 remote-bzr: fix for files with spaces
Set the maximum number of splits to make when dividing the diff stat
lines based on space characters.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28 07:43:18 -07:00
Felipe Contreras 99a4fdb950 remote-bzr: recover from failed clones
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28 07:43:18 -07:00
Thomas Gummerer d0583da838 prompt: fix show upstream with svn and zsh
Currently the __git_ps1 git prompt gives the following error with a
repository converted by git-svn, when used with zsh:

   __git_ps1_show_upstream:19: bad pattern: svn_remote[
   __git_ps1_show_upstream:45: bad substitution

To reproduce the problem, the __git_ps1_show_upstream function can be
executed in a repository converted with git-svn.  Both those errors are
triggered by spaces after the '['.

Zsh also doesn't support initializing an array with `local var=(...)`.
This triggers the following error:

   __git_ps1_show_upstream:41: bad pattern: svn_upstream=(commit

Use
   local -a
   var=(...)
instead to make is compatible.

This was introduced by 6d158cba (bash completion: Support "divergence
from upstream" messages in __git_ps1), when the script was for bash
only.

Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com>
Acked-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-22 10:14:01 -07:00
Felipe Contreras 0c27c12d21 remote-hg: tests: fix hg merge
Let's specify a merge tool, otherwise mercurial might open one and hang
our tests waiting for user input.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-21 11:59:48 -07:00
Felipe Contreras 02a607260f remote-helpers: tests: use python directly
These remote helpers use 'env python', not PYTHON_PATH, so that's where
we should check for the extensions. Otherwise, if 'python' is not
PYTHON_PATH (e.g. /usr/bin/python: Makefile's default), there will be a
mismatch between the python libraries actually accessible to the remote
helpers.

Suggested by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-21 11:59:44 -07:00
Felipe Contreras 5e49f30c85 remote-hg: fix order of configuration comments
The other configurations were added in the wrong place.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-21 09:33:24 -07:00
Felipe Contreras 92c4369907 remote-hg: trivial configuration note cleanup
Follow the style of the previous configurations.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-21 09:33:21 -07:00
Felipe Contreras 737044517f completion: regression fix for zsh
zsh completion wrapper doesn't reimplement __gitcompadd(). Although it
should be trivial to do that, let's use __gitcomp_nl() which achieves
exactly the same thing, specially since the suffix ($4) has to be empty.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-21 09:28:45 -07:00
Dmitry Marakasov 6912ea952b contrib/git-subtree: Use /bin/sh interpreter instead of /bin/bash
Use /bin/sh interpreter instead of /bin/bash for contrib/git-subtree:
it's required for systems which don't use bash by default (for example,
FreeBSD), while there seem to be no bashisms in the script (confirmed
by looking through the source and tesing subtree functionality with
FreeBSD's /bin/sh) to require specifically bash and not the generic
posix shell.

Signed-off-by: Dmitry Marakasov <amdmi3@amdmi3.ru>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-21 09:24:17 -07:00
Amit Bakshi 5dbe064d8c remote-hg: set stdout to binary mode on win32
git clone hangs on windows, and file.write would return errno 22 inside
of mercurial's windows.winstdout wrapper class. This patch sets stdout's
mode to binary, fixing both issues.

[fc: cleaned up]

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-20 11:18:43 -07:00
Felipe Contreras 31eb360b43 remote-bzr: fixes for older versions of bzr
Down to v2.0, by using older but still valid interfaces.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-17 11:43:36 -07:00
Sandor Bodo-Merle a70ae5873d remote-bzr: fix old organization destroy
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-17 10:59:08 -07:00
Ramkumar Ramachandra 9678696c4a prompt: colorize ZSH prompt
Add colors suitable for use in the ZSH prompt.  Having learnt that the
ZSH equivalent of PROMPT_COMMAND is precmd (), you can now use
GIT_PS1_SHOWCOLORHINTS with ZSH.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-17 10:01:28 -07:00
Ramkumar Ramachandra 18562ad1a0 prompt: factor out gitstring coloring logic
So that we can extend it with ZSH-colors in a later patch.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-17 10:01:23 -07:00
Ramkumar Ramachandra 15a54fb809 prompt: introduce GIT_PS1_STATESEPARATOR
A typical prompt looks like:

    artagnon|master *=:~/src/git$
                   ^
                   why do we have this space?

Nobody has branch names that end with +, *, =, < or > anyway, so it
doesn't serve the purpose of disambiguation.

Make this separator configurable via GIT_PS1_STATESEPARATOR.  This means
that you can set it to "" and get this prompt:

    artagnon|master*=:~/src/git$

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-17 10:01:17 -07:00
Felipe Contreras 629b60a77d Revert "remote-hg: update bookmarks when pulling"
This reverts commit 24317ef32a.

Different versions of Mercurial have different arguments for
bookmarks.updatefromremote(), while it should be possible to call the
right function with the right arguments depending on the version, it's
safer to restore the old behavior for now.

Reported by Rodney Lorrimar.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-16 15:54:18 -07:00
Felipe Contreras 4f4e7e9b62 remote-bzr: fix cloning of non-listable repos
Commit 95b0c60 (remote-bzr: add support for bzr repos) introduced a
regression by assuming all bzr remote repos are listable, but they are
not.

If they are not listable they are basically useless, so let's assume
there is no bzr repo.

Reported-by: Thorsten Kranzkowski <dl8bcu@dl8bcu.de>
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-16 09:29:26 -07:00
Junio C Hamano 0c2b1cf812 Merge branch 'fc/remote-hg' (early part)
* 'fc/remote-hg' (early part):
  remote-hg: update bookmarks when pulling
  remote-hg: don't push fake 'master' bookmark
  remote-hg: disable forced push by default
  remote-hg: fix new branch creation
  remote-hg: add new get_config_bool() helper
  remote-hg: enable track-branches in hg-git mode
  remote-hg: get rid of unused exception checks
  remote-hg: trivial cleanups
2013-05-15 14:58:56 -07:00
Felipe Contreras 24317ef32a remote-hg: update bookmarks when pulling
Otherwise, the user would never ever see new bookmarks, only the
ones that (s)he initially cloned.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-15 12:41:13 -07:00
Felipe Contreras 9ed920a680 remote-hg: don't push fake 'master' bookmark
We skip it locally, but not for the remote, so let's do so.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-15 12:40:59 -07:00
Felipe Contreras 06f4213355 remote-hg: disable forced push by default
In certain situations we might end up pushing garbage revisions
(e.g. in a rebase), and the patches to deal with that haven't been
merged yet.  So let's disable forced pushes by default.

We are essentially reverting back to the old v1.8.2 behavior, to
minimize the possibility of regressions, but in a way the user can
configure.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-15 12:40:16 -07:00
Felipe Contreras 637333673a remote-hg: fix new branch creation
When a user creates a new branch with git:

 % git checkout -b branches/devel

and then pushes this branch

 % git push origin branches/devel

which is the way to push new mercurial branches, we do want to
create a branch, but the command would fail without newbranch=True.

This only matters when force_push=False, but setting newbranch=True
unconditionally does not hurt.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-15 12:35:51 -07:00
Felipe Contreras 760ee1c70a remote-hg: add new get_config_bool() helper
No functional changes.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-15 12:33:39 -07:00
Felipe Contreras 679e87c02b remote-hg: enable track-branches in hg-git mode
The user can turn this off.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-15 12:33:15 -07:00
Felipe Contreras 557399e9bd remote-hg: get rid of unused exception checks
Remove try/except check because we are no longer calling
check_output(), which may throw an exception.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-15 12:31:54 -07:00
Felipe Contreras eb7976e7dd remote-hg: trivial cleanups
Drop unused "global", and remove redundant comparison of two files.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-15 12:30:36 -07:00
Felipe Contreras 6a3ac18ba3 remote-bzr: update old organization
If a clone exists with the old organization (v1.8.2) it will prevent
the new shared bzr repository organization from working, so let's
remove this repository, which is not used any more.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-14 15:51:00 -07:00
Torsten Bögershausen 8d97506e4b test-bzr: do not use unportable sed '\+'
Using sed -e '/[0-9]\+//' to find "one or more digits" is not
portable.

Use the Basic Regular Expression '/[0-9][0-9]*//' instead.

Signed-off-by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-11 12:51:19 -07:00
Paul Walmsley a7b102302a git-svn: added an --include-path flag
The SVN::Fetcher module is now able to filter for inclusion as well
as exclusion (as used by --ignore-path). Also added tests, documentation
changes and git completion script.

If you have an SVN repository with many top level directories and you
only want a git-svn clone of some of them then using --ignore-path is
difficult as it requires a very long regexp. In this case it's much
easier to filter for inclusion.

[ew: remove trailing whitespace]

Signed-off-by: Paul Walmsley <pjwhams@gmail.com>
Signed-off-by: Eric Wong <normalperson@yhbt.net>
2013-05-09 01:13:36 +00:00
Felipe Contreras 734b2f0532 completion: synchronize zsh wrapper
So it's closer to the full zsh wrapper.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-08 11:44:32 -07:00
Felipe Contreras 2bcf694b18 completion: cleanup zsh wrapper
There's no need for a separate function; we can call
'emulate -k ksh func'.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-08 11:44:30 -07:00
Felipe Contreras 0df860383e remote-helpers: trivial cleanup
The comment was copied from hg-fast-export, not used anymore.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-07 22:42:20 -07:00
Felipe Contreras 435f39a3e8 remote-bzr: fix for disappeared revisions
It's possible that the previous tip goes away, we should not assume it's
always present. Fortunately we are only using it to calculate the
progress to display to the user, so only that needs to be fixed.

Also, add a test that triggers this issue.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-07 22:38:40 -07:00
Junio C Hamano bba5367183 Merge branch 'fc/remote-bzr'
* fc/remote-bzr:
  remote-bzr: avoid bad refs
  remote-bzr: convert all unicode keys to str
  remote-bzr: access branches only when needed
  remote-bzr: delay peer branch usage
  remote-bzr: iterate revisions properly
  remote-bzr: improve progress reporting
  remote-bzr: add option to specify branches
  remote-bzr: add custom method to find branches
  remote-bzr: improve author sanitazion
  remote-bzr: add support for shared repo
  remote-bzr: fix branch names
  remote-bzr: add support for bzr repos
  remote-bzr: use branch variable when appropriate
  remote-bzr: fix partially pushed merge
  remote-bzr: fixes for branch diverge
  remote-bzr: add support to push merges
  remote-bzr: always try to update the worktree
  remote-bzr: fix order of locking in CustomTree
  remote-bzr: delay blob fetching until the very end
  remote-bzr: cleanup CustomTree
2013-05-06 22:16:26 -07:00
Felipe Contreras 4c00819910 remote-bzr: avoid bad refs
Versions of fast-export before v1.8.2 throws a bad 'reset' commands
because of a behavior in transport-helper that is not even needed.
We should ignore them, otherwise we will treat them as branches and
fail.

This was fixed in v1.8.2, but some people use this script in older
versions of git.

Also, check if the ref was a tag, and skip it for now.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-06 18:19:55 -07:00
Felipe Contreras 081811216e remote-bzr: convert all unicode keys to str
Otherwise some versions of bazaar might barf.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-06 09:18:52 -07:00
Junio C Hamano 1c937682c2 Sync with maint
* maint:
  completion: zsh: don't override suffix on _detault
  Documentation/git-commit: Typo under --edit
2013-05-03 15:17:38 -07:00
Felipe Contreras 6606a69f45 completion: zsh: don't override suffix on _detault
zsh is smart enough to add the right suffix while completing, there's no
point in trying to do the same as bash.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-03 15:10:05 -07:00
Junio C Hamano b9347eb224 Merge branch 'zk/prompt-rebase-step'
* zk/prompt-rebase-step:
  bash-prompt.sh: show where rebase is at when stopped
2013-05-01 15:23:57 -07:00
John Keeping 3212d56ce5 contrib/subtree: don't delete remote branches if split fails
When using "git subtree push" to split out a subtree and push it to a
remote repository, we do not detect if the split command fails which
causes the LHS of the refspec to be empty, deleting the remote branch.

Fix this by pulling the result of the split command into a variable so
that we can die if the command fails.

Reported-by: Steffen Jaeckel <steffen.jaeckel@stzedn.de>
Signed-off-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-01 10:13:32 -07:00
Felipe Contreras d421c02b41 remote-bzr: access branches only when needed
Bazaar doesn't seem to be tested for multiple usage of branches, so
resources seem to be leaked all over. Let's try to minimize this by
accessing the Branch objects only when needed.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-30 22:06:47 -07:00
Felipe Contreras 747c9a377f remote-bzr: delay peer branch usage
So it doesn't time out.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-30 22:06:47 -07:00
Felipe Contreras 38cecbdf52 remote-bzr: iterate revisions properly
This way we don't need to store the list of all the revisions, which
doesn't seem to be very memory efficient with bazaar's design, for
whatever reason.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-30 22:06:47 -07:00
Felipe Contreras a397699950 remote-bzr: improve progress reporting
No need to manually count the revisions, and also, this would help to
iterate more properly.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-30 22:06:47 -07:00
Felipe Contreras 248663c4ff remote-bzr: add option to specify branches
We might not want all the branches. And branch handling in bazaar is
rather tricky, so it's safer to simply specify them.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-30 22:06:47 -07:00
Felipe Contreras 850dd25c9a remote-bzr: add custom method to find branches
The official method is incredibly inefficient and slow.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-30 22:06:47 -07:00
Felipe Contreras 3f6e7c0af1 remote-bzr: improve author sanitazion
So that we don't end up with '<None>', and also synchronize it with the
one from remote-hg.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-30 22:06:47 -07:00
Felipe Contreras c95c35f4b8 remote-bzr: add support for shared repo
This way all the remotes share the same data, so adding multiple
remotes, or renaming them doesn't create extra overhead.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-30 22:06:47 -07:00
Felipe Contreras 42b48ef25d remote-bzr: fix branch names
When branches have '/' in their name (aka. sub-branches), bazaar seems
to choke while creating the new directory.

Also, git cannot have both 'foo' and 'foo/bar'.

So let's replace slashes with a plus sign.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-30 22:06:47 -07:00
Felipe Contreras 95b0c60831 remote-bzr: add support for bzr repos
In bazaar, a repository can contain multiple branches, and previously we
were supporting only one branch at a time. Now we fetch them all.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-30 22:06:47 -07:00
Felipe Contreras 5df4fad319 remote-bzr: use branch variable when appropriate
There should be no functional changes. Basically we want to reserve the
'repo' variable.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-30 22:06:47 -07:00
Felipe Contreras b25df87fad remote-bzr: fix partially pushed merge
If part of the merge was already pushed, we don't have the blob_marks
available, however, the commits are already stored in bazaar, so we can
use the revision_tree to fetch the contents.

We want to do this only when there's no other option.

There's no easy way to test this.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-30 22:06:47 -07:00
Felipe Contreras 38e7167e9b remote-bzr: fixes for branch diverge
If the branches diverge we want to reset the pointer to where the remote
actually is. Since we can access remote branches just as easily as local
ones, let's do so.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-30 22:06:47 -07:00
Felipe Contreras f38dfc4c32 remote-bzr: add support to push merges
In order to do that, we need to store the marks of every file, so that
they can be fetched when needed. Unfortunately we can't tell bazaar that
nothing changed, we need to send the data so that it can figure it out
by itself.

And since it will be requesting a bunch of information by the file_id,
it's better to have a helper dict (rev_files), so that we can fetch it
quickly.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-30 22:06:46 -07:00
Felipe Contreras 715d64fe99 remote-bzr: always try to update the worktree
And fail properly when we can't.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-30 22:06:46 -07:00
Felipe Contreras aa12a431f3 remote-bzr: fix order of locking in CustomTree
It doesn't seem to make any difference, but revision_tree() requires a
lock.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-30 22:06:46 -07:00
Felipe Contreras 1816620800 remote-bzr: delay blob fetching until the very end
Might be more efficient, but the real reason to use the marks will be
revealed in upcoming patches.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-30 22:06:46 -07:00
Felipe Contreras c80f4c7763 remote-bzr: cleanup CustomTree
This code was not used at all.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-30 22:06:46 -07:00
Ramkumar Ramachandra 7e6a0cc47d git-completion.bash: add remote.pushdefault to config list
224c2171 (remote.c: introduce remote.pushdefault, 2013-04-02)
introduced the remote.pushdefault configuration variable, but forgot
to teach git-completion.bash about it.  Fix this.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-29 09:57:47 -07:00
Ramkumar Ramachandra 72f7507710 git-completion.bash: add branch.*.pushremote to config list
9f765ce (remote.c: introduce branch.<name>.pushremote, 2013-04-02)
introduced the configuration variable branch.*.pushremote, but forgot
to teach git-completion.bash about it.  Fix this.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-29 09:57:44 -07:00
Junio C Hamano 01449e314f Merge branch 'maint'
* maint:
  complete: zsh: use zsh completion for the main cmd
  complete: zsh: trivial simplification
  git-completion.bash: complete branch.*.rebase as boolean
  git-completion.bash: add diff.submodule to config list
  git-completion.bash: lexical sorting for diff.statGraphWidth
2013-04-29 09:57:38 -07:00
Junio C Hamano 8301b976ed Merge branch 'fc/zsh-completion' into maint
* fc/zsh-completion:
  complete: zsh: use zsh completion for the main cmd
  complete: zsh: trivial simplification
2013-04-29 09:52:18 -07:00
Felipe Contreras 4911589bd1 complete: zsh: use zsh completion for the main cmd
So that we can have a nice zsh completion output:

% git <tab>
add       -- add file contents to the index
bisect    -- find by binary search the change that introduced a bug
branch    -- list, create, or delete branches
checkout  -- checkout a branch or paths to the working tree
clone     -- clone a repository into a new directory
commit    -- record changes to the repository
diff      -- show changes between commits, commit and working tree, etc
fetch     -- download objects and refs from another repository
grep      -- print lines matching a pattern
init      -- create an empty Git repository or reinitialize an existing one
log       -- show commit logs
merge     -- join two or more development histories together
mv        -- move or rename a file, a directory, or a symlink
pull      -- fetch from and merge with another repository or a local branch
push      -- update remote refs along with associated objects
rebase    -- forward-port local commits to the updated upstream head
reset     -- reset current HEAD to the specified state
rm        -- remove files from the working tree and from the index
show      -- show various types of objects
status    -- show the working tree status
tag       -- create, list, delete or verify a tag object signed with GPG

And other niceties, like 'git --git-dir=<tab>' showing only directories.

For the rest, the bash completion stuff is still used.

Also, add my copyright, since this more than a thin wrapper.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-29 09:52:06 -07:00
Felipe Contreras 1ca6d4bc42 complete: zsh: trivial simplification
There should be no functional changes.

The only reason I wrapped this code around a sub-function is because zsh
did the same in it's bashcompinit script in order to declare the special
variable 'words' as hidden, but only in this context.

There's no need for that any more since we access __git_main directly,
so 'words' is not modified, so there's no need for the sub-function.

In zsh mode the array indexes are different though.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-29 09:52:06 -07:00
Ramkumar Ramachandra a05490edbf git-completion.bash: complete branch.*.rebase as boolean
6fac1b83 (completion: add missing config variables, 2009-06-29) added
"rebase" to the list of completions for "branch.*.*", but forgot to
specify completions for the values that this configuration variable
can take (namely "false" and "true").  Fix this.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-29 08:07:23 -07:00
Ramkumar Ramachandra 2651baaea9 git-completion.bash: add diff.submodule to config list
c47ef57 (diff: introduce diff.submodule configuration variable,
2012-11-13) introduced the diff.submodule configuration variable, but
forgot to teach git-completion.bash about it.  Fix this.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-29 08:07:23 -07:00
Ramkumar Ramachandra de7c201a10 git-completion.bash: lexical sorting for diff.statGraphWidth
df44483a (diff --stat: add config option to limit graph width,
2012-03-01) added the option diff.startGraphWidth to the list of
configuration variables in git-completion.bash, but failed to notice
that the list is sorted alphabetically.  Move it to its rightful place
in the list.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-29 08:07:22 -07:00
Felipe Contreras ea57352182 completion: add missing format-patch options
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-27 16:09:47 -07:00
Felipe Contreras c29e317994 completion: remove __git_index_file_list_filter()
Refactor the code into the only caller; __git_index_files().

Also, Somehow messing up with the 'path' variable messes up the 'PATH'
variable. So let's not do that.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-27 14:32:29 -07:00
Felipe Contreras fbe451182e completion: add space after completed filename
Just like before fea16b4 (git-completion.bash: add support for path
completion).

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-27 14:32:29 -07:00
Felipe Contreras 3ffa4df4b2 completion: add hack to enable file mode in bash < 4
This way we don't need all the compat stuff, different filters, and so
on. Also, now we complete exactly the same in bash 3 and bash 4.

This is the way bash-completion did it for quite some time, when bash 3
was supported. For more information about the hack:

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=272660#64

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-27 14:32:29 -07:00
Felipe Contreras fda54ef1aa completion: refactor __git_complete_index_file()
The calls to __gitcomp_file() are essentially the same, but with
different prefix.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-27 14:32:29 -07:00
Felipe Contreras f825972c38 completion: refactor diff_index wrappers
At the end of the day what we really need is to find out the files that
have been staged, or modified, because those files are the ones that
make sense to pass as arguments to 'git commit'.

We need diff-index to find those out, since 'git ls-files' doesn't do
that.

But we don't need wrappers and wrappers basically identical to the ones
used for 'git ls-files', when we can pretend it receives a --committable
option that would return what we need.

That way, we can remove a bunch of code without any functional changes.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-27 14:32:29 -07:00
Felipe Contreras 0afe8e9e98 completion: use __gitcompadd for __gitcomp_file
Like the rest of the script does; let's not access COMPREPLY directly.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-27 14:32:28 -07:00
Felipe Contreras 9ab8d18322 completion; remove unuseful comments
The only caller, __git_complete_index_file() doesn't specify any limits
to the options for 'git ls-files', neither should this function.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-27 14:32:28 -07:00
Felipe Contreras 877ee9cc7e remote-bzr: strip extra newline
It's added by fast-export, the user didn't type it.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-26 15:20:27 -07:00
Felipe Contreras 4d74cd4725 remote-bzr: tell bazaar to be quiet
Otherwise we get notification, progress bars, and what not.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-26 15:20:27 -07:00
Felipe Contreras d82c912c43 remote-bzr: store converted URL
Bazaar might convert the URL to something more appropriate, like an
absolute path. Lets store that instead of the original URL, which won't
work from a different working directory if it's relative.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-26 15:20:27 -07:00
Felipe Contreras 6134caf2c1 remote-hg: use hashlib instead of hg sha1 util
To be in sync with remote-bzr.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-26 15:20:27 -07:00
Felipe Contreras aa93845661 remote-bzr: add support to push URLs
Just like in remote-hg.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-26 15:20:27 -07:00
Felipe Contreras d6bb9136c9 remote-bzr: fix bad state issue
Carried from remote-hg.

The problem reportedly happened after doing a push that fails, the abort
causes the state of remote-hg to go bad, this happens because
remote-hg's marks are not stored, but 'git fast-export' marks are.

Ensure that the marks are _always_ stored.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-26 15:20:26 -07:00
Felipe Contreras 23df5e40f0 remote-hg: remove extra check
Not needed since we use xrange ourselves.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-26 15:20:26 -07:00
Felipe Contreras 75301a4588 remote-helpers: trivial cleanups
No functional changes. Typos, unused variables, redundant operations,
and white-spaces.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-26 15:20:26 -07:00
Junio C Hamano c8c82b1ba3 Merge branch 'fc/remote-hg'
* fc/remote-hg:
  remote-hg: strip extra newline
  remote-hg: use marks instead of inlined files
  remote-hg: small performance improvement
  remote-hg: allow refs with spaces
  remote-hg: don't update bookmarks unnecessarily
  remote-hg: add support for schemes extension
  remote-hg: improve email sanitation
  remote-hg: add custom local tag write code
  remote-hg: write tags in the appropriate branch
  remote-hg: custom method to write tags
  remote-hg: add support for tag objects
  remote-hg: add branch_tip() helper
  remote-hg: properly mark branches up-to-date
  remote-hg: use python urlparse
  remote-hg: safer bookmark pushing
  remote-helpers: avoid has_key
2013-04-26 15:19:03 -07:00
Junio C Hamano df8597258e Merge branch 'fc/remote-bzr'
* fc/remote-bzr:
  remote-bzr: use proper push method
2013-04-26 15:18:26 -07:00
Junio C Hamano e27004e341 Sync with 1.8.2.2 2013-04-26 13:00:48 -07:00
Junio C Hamano 1a475c4a2f Merge branch 'fc/untracked-zsh-prompt' into maint
* fc/untracked-zsh-prompt:
  prompt: fix untracked files for zsh
2013-04-26 11:12:30 -07:00
Torsten Bögershausen 86c5e148c9 test-hg-hg-git.sh: do not use export X=Y
The shell syntax "export X=Y" is not understood by all shells.

Signed-off-by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-26 09:53:52 -07:00
Torsten Bögershausen 93cd8d970b test-hg-bidi.sh: 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>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-26 09:53:31 -07:00
Felipe Contreras fbd3f0e53c remote-bzr: use proper push method
Do not just randomly synchronize the revisions with no checks at
all.

I don't have any evidence that there's anything wrong with the
current code, which Bazaar seems to use, but for different purposes.
Let's use the logic Bazaar UI uses to avoid surprises.

Also, add a non-ff check.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-25 15:34:37 -07:00
Zoltan Klinger b71dc3e1a0 bash-prompt.sh: show where rebase is at when stopped
When a rebase stops (e.g. interrupted by a merge conflict), it could
be useful to know how far a rebase has progressed and how many
commits in total this rebase will apply. Teach the __git_ps1()
command to display the number of commits so far applied and the
total number of commits to be applied, like this:

  ((3ec0a6a...)|REBASE 2/5)

In the example above the rebase has stopped at the second commit due to
a merge conflict and there are a total number of five commits to be
applied by this rebase.

This information can be already obtained from the following files which are
being generated during the rebase:

    GIT_DIR/.git/rebase-merge/msgnum (git-rebase--merge.sh)
    GIT_DIR/.git/rebase-merge/end    (git-rebase--merge.sh)
    GIT_DIR/.git/rebase-apply/next   (git-am.sh)
    GIT_DIR/.git/rebase-apply/last   (git-am.sh)

but "rebase -i" does not leave necessary clues.

Implement this feature by doing these three things:

  1) Modify git-rebase--interactive.sh to also create

	GIT_DIR/.git/rebase-merge/msgnum
	GIT_DIR/.git/rebase-merge/end

     files for the number of commits so far applied and the total
     number of commits to be applied.

  2) Modify git-prompt.sh to read and display info from the above
     files.

  3) Update test t9903-bash-prompt.sh to reflect changes introduced
     by this patch.

Signed-off-by: Zoltan Klinger <zoltan.klinger@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-25 09:59:34 -07:00
Junio C Hamano 2d0b07178d Sync with maint
* maint:
  Update draft release notes to 1.8.2.2
  completion: remove duplicate block for "git commit -c"
  cherry-pick/revert: make usage say '<commit-ish>...'
2013-04-24 16:30:04 -07:00
Mårten Kongstad 7612e61e33 completion: remove duplicate block for "git commit -c"
Remove one of two consecutive, identical blocks for "git commit -c".

This was caused by a mechanical mismerge at d931e2fb25 (Merge
branch 'mp/complete-paths', 2013-02-08).  The side branch wanted to
add this block at fea16b47 but the same fix was done independently
at 685397585 already.

Signed-off-by: Mårten Kongstad <marten.kongstad@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-24 16:05:07 -07:00
Junio C Hamano 741917f40c Merge branch 'fc/untracked-zsh-prompt'
* fc/untracked-zsh-prompt:
  prompt: fix untracked files for zsh
2013-04-23 11:16:58 -07:00
Felipe Contreras 160695949a remote-hg: strip extra newline
There's no functional change since mercurial commit operation strips
that anyway, but that's no excuse for us not to do the right thing. So
let's be explicit about it.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-22 15:33:37 -07:00
Felipe Contreras 97253a2332 remote-hg: use marks instead of inlined files
So that we can find already exported ones. We can never be 100% sure
that we already exported such data, due to mercurial design, it at least
sometimes we should detect them, and so should give us some performance
boost.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-22 15:33:32 -07:00
Felipe Contreras 1a2636c297 remote-hg: small performance improvement
Load previous manifest first as Mercurial does; for caching reasons.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-22 15:25:55 -07:00
Felipe Contreras b0f6c5835d remote-hg: allow refs with spaces
Mercurial supports them, Git doesn't.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-22 15:25:55 -07:00
Felipe Contreras 7c0580586f remote-hg: don't update bookmarks unnecessarily
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-22 15:25:55 -07:00
Felipe Contreras 891122266f remote-hg: add support for schemes extension
So that we can use shortened URLs, for example 'bb:://felipec/repo'
(Bitbucket).

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-22 15:25:55 -07:00
Felipe Contreras a2e462c5b5 remote-hg: improve email sanitation
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-22 15:25:54 -07:00
Felipe Contreras a2f7b6f8a9 remote-hg: add custom local tag write code
There's no point in calling the tag method for such simple action. Not
that we care much about the hg-git compat mode, it's mostly just for
comparison testing purposes.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-22 15:25:54 -07:00
Felipe Contreras e1760f8c2c remote-hg: write tags in the appropriate branch
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-22 15:25:54 -07:00
Felipe Contreras 68d4f4f3e9 remote-hg: custom method to write tags
The one from mercurial is meant for users, on top of the latest tip.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-22 15:25:54 -07:00
Felipe Contreras 299789c22c remote-hg: add support for tag objects
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-22 15:25:54 -07:00
Felipe Contreras aeebca0bd2 remote-hg: add branch_tip() helper
Idea from gitifyhg, the backwards compatibility is how Mercurial used to
do it.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-22 15:25:53 -07:00
Felipe Contreras 7e31e1fea5 remote-hg: properly mark branches up-to-date
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-22 15:25:53 -07:00
Felipe Contreras 846cc77676 remote-hg: use python urlparse
It's simpler, and we don't need to depend on certain Mercurial versions.

Also, now we don't update the URL if 'file://' is not present.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-22 15:25:53 -07:00
Felipe Contreras e5ea5e7547 remote-hg: safer bookmark pushing
It is possible that the remote has changed the bookmarks, so let's fetch
them before we make any assumptions, just the way mercurial does.

Probably doesn't make a difference, but better be safe than sorry.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-22 15:25:53 -07:00
Dusty Phillips 3473ecd7ff remote-helpers: avoid has_key
It is deprecated.

[fc: do the same in remote-bzr]

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-22 15:25:53 -07:00
Junio C Hamano ad62fd0c2c Merge branch 'rr/prompt-revert-head' into maint
* rr/prompt-revert-head:
  bash: teach __git_ps1 about REVERT_HEAD
2013-04-22 11:26:54 -07:00
Junio C Hamano 37d32de72a Merge branch 'fc/remote-hg'
Updates remote-hg helper (in contrib/).

* fc/remote-hg: (21 commits)
  remote-hg: activate graphlog extension for hg_log()
  remote-hg: fix bad file paths
  remote-hg: document location of stored hg repository
  remote-hg: fix bad state issue
  remote-hg: add 'insecure' option
  remote-hg: add simple mail test
  remote-hg: add basic author tests
  remote-hg: show more proper errors
  remote-hg: force remote push
  remote-hg: push to the appropriate branch
  remote-hg: update tags globally
  remote-hg: update remote bookmarks
  remote-hg: refactor export
  remote-hg: split bookmark handling
  remote-hg: redirect buggy mercurial output
  remote-hg: trivial test cleanups
  remote-hg: make sure fake bookmarks are updated
  remote-hg: fix for files with spaces
  remote-hg: properly report errors on bookmark pushes
  remote-hg: add missing config variable in doc
  ...
2013-04-21 18:39:58 -07:00
Felipe Contreras 24b6132e57 prompt: fix untracked files for zsh
We signal presense of untracked files by adding a per-cent sign '%'
to the prompt.  But because '%' is used as an escape character to
introduce prompt customization in zsh (just like bash prompt uses
'\' to escape '\u', '\h', etc.), we need to say '%%' to get a
literal per-cent.

Helped-by: Andreas Schwab <schwab@linux-m68k.org>
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-21 18:01:37 -07:00
Junio C Hamano c5926ac377 Merge branch 'maint'
* maint:
  remote-hg: fix commit messages
2013-04-18 12:03:01 -07:00
Junio C Hamano 5734fa4608 Merge branch 'fc/completion'
In addition to a user visible change to offer more options to cherry-pick,
generally cleans up and simplifies the code.

* fc/completion:
  completion: small optimization
  completion: inline __gitcomp_1 to its sole callsite
  completion: get rid of compgen
  completion: add __gitcomp_nl tests
  completion: add new __gitcompadd helper
  completion: get rid of empty COMPREPLY assignments
  completion: trivial test improvement
  completion: add more cherry-pick options
2013-04-18 11:46:42 -07:00
Felipe Contreras 845241d544 remote-hg: fix commit messages
git fast-import expects an extra newline after the commit message data,
but we are adding it only on hg-git compat mode, which is why the
bidirectionality tests pass.

We should add it unconditionally.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-17 23:41:25 -07:00
Felipe Contreras afad200558 remote-bzr: fix prefix of tags
In the current transport-helper code, refs without namespaced refspecs don't
work correctly, so let's always use them.

Some people reported issues with 'git clone --mirror', and this fixes them, as
well as possibly others.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-15 16:08:40 -07:00
Felipe Contreras ddc996d767 completion: small optimization
No need to calculate a new $c with a space if we are not going to do
anything it with it.

There should be no functional changes, except that a word "foo " with no
suffixes can't be matched. But $cur cannot have a space at the end
anyway. So it's safe.

Based on the code from SZEDER Gábor.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-14 23:18:58 -07:00
Felipe Contreras b4cfbc969c completion: inline __gitcomp_1 to its sole callsite
There is no point in calling a separate function that is only used
in one place. Especially considering that there's no need to call
compgen, and we traverse the words ourselves both in __gitcompadd,
and __gitcomp_1.

Let's squash the functions together, and traverse only once.

This improves performance. For N number of words:

  == 1 ==
  original: 0.002s
  new: 0.000s
  == 10 ==
  original: 0.005s
  new: 0.001s
  == 100 ==
  original: 0.009s
  new: 0.006s
  == 1000 ==
  original: 0.027s
  new: 0.019s
  == 10000 ==
  original: 0.163s
  new: 0.151s
  == 100000 ==
  original: 1.555s
  new: 1.497s

No functional changes.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-14 23:18:58 -07:00
Felipe Contreras 7d13e0a3af completion: get rid of compgen
The functionality we use from compgen is not much, we can do the same
manually, with drastic improvements in speed, especially when dealing
with only a few words.

This patch also has the sideffect that brekage reported by Jeroen Meijer
and SZEDER Gábor gets fixed because we no longer expand the resulting
words.

Here are some numbers filtering N amount of words:

  == 1 ==
  original: 0.002s
  new: 0.000s
  == 10 ==
  original: 0.002s
  new: 0.000s
  == 100 ==
  original: 0.003s
  new: 0.002s
  == 1000 ==
  original: 0.012s
  new: 0.011s
  == 10000 ==
  original: 0.056s
  new: 0.066s
  == 100000 ==
  original: 2.669s
  new: 0.622s

If the results are not narrowed:

  == 1 ==
  original: 0.002s
  new: 0.000s
  == 10 ==
  original: 0.002s
  new: 0.001s
  == 100 ==
  original: 0.004s
  new: 0.004s
  == 1000 ==
  original: 0.020s
  new: 0.015s
  == 10000 ==
  original: 0.101s
  new: 0.355s
  == 100000 ==
  original: 2.850s
  new: 31.941s

So, unless 'git checkout <tab>' usually gives you more than 10000
results, you'll get an improvement :)

Other possible solutions perform better after 1000 words, but worst if
less than that:

  COMPREPLY=($(awk -v cur="$3" -v pre="$2" -v suf="$4"
	'$0 ~ cur { print pre$0suf }' <<< "$1" ))

  COMPREPLY=($(printf -- "$2%s$4\n" $1 | grep "^$2$3"))

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-14 23:18:58 -07:00
Felipe Contreras 1ce23aad34 completion: add new __gitcompadd helper
The idea is to never touch the COMPREPLY variable directly.

This allows other completion systems (i.e. zsh) to override
__gitcompadd, and do something different instead.

Also, this allows further optimizations down the line.

There should be no functional changes.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-14 23:18:58 -07:00
Torsten Bögershausen 924f6c3d39 test-bzr: portable shell and utf-8 strings for Mac OS
Make the shell script more portable:
- Split export X=Y into 2 lines
- Use printf instead of echo -e

Use UTF-8 code points which are not decomposed by the filesystem:
 Code points like "á" will be decomposed by Mac OS X.
 bzr is unable to find the file "á" on disk.
 Use code points from unicode which can not be decomposed.
 In other words, the precompsed form use the same bytes as decomposed.

Signed-off-by: Torsten Bögershausen <tboegi@web.de>
Acked-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-12 14:58:08 -07:00
Junio C Hamano caa7d79f1f Sync with 'maint'
* maint:
  Correct common spelling mistakes in comments and tests
  kwset: fix spelling in comments
  precompose-utf8: fix spelling of "want" in error message
  compat/nedmalloc: fix spelling in comments
  compat/regex: fix spelling and grammar in comments
  obstack: fix spelling of similar
  contrib/subtree: fix spelling of accidentally
  git-remote-mediawiki: spelling fixes
  doc: various spelling fixes
  fast-export: fix argument name in error messages
  Documentation: distinguish between ref and offset deltas in pack-format
  i18n: make the translation of -u advice in one go
2013-04-12 13:54:01 -07:00
Stefano Lattarini d0008b3c66 contrib/subtree: fix spelling of accidentally
Noticed with Lucas De Marchi's codespell tool.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-12 12:23:12 -07:00
Stefano Lattarini 2582ab18e4 git-remote-mediawiki: spelling fixes
Most of these were found using Lucas De Marchi's codespell tool.
Others were pointed out by Eric Sunshine.

Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-12 12:13:05 -07:00
Felipe Contreras 0285118e59 completion: get rid of empty COMPREPLY assignments
There's no functional reason for those, the only purpose they are
supposed to serve is to say "we don't provide any words here", but
even for that it's not used consistently.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-12 10:45:53 -07:00
Felipe Contreras 7655fa7fa9 completion: add more cherry-pick options
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-12 10:43:20 -07:00
Antoine Pelisse 9a57988b3f remote-hg: activate graphlog extension for hg_log()
The hg_log() test helper uses the "--graph" parameter that is
implemented by the GraphLog extension. If the extension is not activated
by the user, the parameter is not available. Activate the extension in
setup().

Also changes the way we grep the output in hg_log(). The pipe operator
can hide the return code of hg command. As a matter of fact, if log
fails because it doesn't know about "--graph", it doesn't report any
failure and let's you think everything worked.

Signed-off-by: Antoine Pelisse <apelisse@gmail.com>
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-11 10:46:48 -07:00
Felipe Contreras 20c4b59c35 remote-hg: fix bad file paths
Mercurial allows absolute file paths, and Git doesn't like that.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-11 10:46:48 -07:00
Simon Ruderich 7b21ec24a5 remote-hg: document location of stored hg repository
Signed-off-by: Simon Ruderich <simon@ruderich.org>
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-11 10:46:48 -07:00
Felipe Contreras 2594a79ea9 remote-hg: fix bad state issue
The problem reportedly happened after doing a push that fails, the abort
causes the state of remote-hg to go bad, this happens because
remote-hg's marks are not stored, but 'git fast-export' marks are.

Ensure that the marks are _always_ stored.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-11 10:46:47 -07:00
Simon Ruderich 2e8e813232 remote-hg: add 'insecure' option
If set to true acts as hg's clone/pull --insecure option.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-11 10:46:47 -07:00
Felipe Contreras b3ab6fd1ac remote-hg: add simple mail test
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-11 10:46:47 -07:00
Felipe Contreras 6181b9a63c remote-hg: add basic author tests
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-11 10:46:47 -07:00
Felipe Contreras cbf6237c2b remote-hg: show more proper errors
When cloning or pushing fails, we don't want to show a stack-trace.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-11 10:46:47 -07:00
Felipe Contreras b0c3db860c remote-hg: force remote push
Ideally we shouldn't do this, as it's not recommended in mercurial
documentation, but there's no other way to push multiple bookmarks (on
the same branch), which would be the behavior most similar to git.

At the same time, add a configuration option for the people that don't
want to risk creating new remote heads.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-11 10:46:47 -07:00
Dusty Phillips 11dc88f49c remote-hg: push to the appropriate branch
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-11 10:46:47 -07:00
Felipe Contreras 7a6c1859b6 remote-hg: update tags globally
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-11 10:46:47 -07:00
Felipe Contreras d7314b3acf remote-hg: update remote bookmarks
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-11 10:46:47 -07:00
Felipe Contreras 0ff1b61770 remote-hg: refactor export
No functional changes.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-11 10:46:47 -07:00
Felipe Contreras f04f489f6b remote-hg: split bookmark handling
Will be useful for remote bookmarks.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-11 10:46:47 -07:00
Felipe Contreras 25027b983e remote-hg: redirect buggy mercurial output
Mercurial emits messages like "searching for changes", "no changes
found", etc. meant for the use of its own UI layer, which break the pipe
between transport helper and remote helper.

Since there's no way to silence Mercurial, let's redirect to standard
error.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-11 10:46:46 -07:00
Felipe Contreras 71c6c95c31 remote-hg: trivial test cleanups
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-11 10:46:46 -07:00
Felipe Contreras 8120014e2b remote-hg: make sure fake bookmarks are updated
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-11 10:46:46 -07:00
Peter van Zetten 15a8d901dd remote-hg: fix for files with spaces
Set the maximum number of splits to make when dividing the diff stat
lines based on space characters.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-11 10:46:46 -07:00
Felipe Contreras 031873f8f1 remote-hg: properly report errors on bookmark pushes
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-11 10:46:46 -07:00
Dusty Phillips e1219e45bd remote-hg: add missing config variable in doc
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-11 10:46:46 -07:00
Felipe Contreras a57ad51d1a remote-hg: trivial cleanups
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-11 10:46:46 -07:00
Felipe Contreras fa7285dc3d remote-bzr: improve tag handling
revision_history() is deprecated and doesn't do what we want (revno
instead of dotted_revno?).

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-08 14:17:07 -07:00
Christophe Simonis 5ff4fc649e remote-bzr: fix utf-8 support for fetching
The previous patches didn't deal with all the scenarios.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-08 14:09:31 -07:00
Junio C Hamano 52a3e011c7 Sync with 1.8.2.1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-07 15:28:50 -07:00
Junio C Hamano 41e9da40a8 Merge branch 'fc/remote-helpers-test-updates'
* fc/remote-helpers-test-updates:
  remote-hg: fix hg-git test-case
  remote-bzr: remove stale check code for tests
  remote-helpers: fix the run of all tests
  remote-bzr: avoid echo -n
2013-04-07 14:33:02 -07:00
Junio C Hamano 6466fbbeef Sync with 1.8.1.6 2013-04-07 13:17:50 -07:00
Torsten Bögershausen 0e9b327227 remote-helpers/test-bzr.sh: do not use "grep '\s'"
Using grep "devel\s\+3:" to find at least one whitspace is not
portable on all grep versions; not all grep versions understand "\s"
as a "whitespace".

Use a literal TAB followed by SPACE.

The + as a qualifier for "one or more" is not a basic regular
expression; use egrep instead of grep.

Signed-off-by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-07 08:41:34 -07:00
Felipe Contreras 6ff8d4e748 remote-bzr: add utf-8 support for pushing
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-07 00:39:28 -07:00
Timotheus Pokorra 5445b24e22 remote-bzr: add utf-8 support for fetching
[fc: added tests]

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-07 00:39:27 -07:00
Felipe Contreras 8954441ac7 remote-bzr: avoid unreferred tags
They have no content, there's nothing we can do with them.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-07 00:39:27 -07:00
Felipe Contreras f00f2511d9 remote-bzr: only update workingtree on local repos
Apparently, that's the only way it's possible.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-07 00:39:27 -07:00
David Engster 9d9d698c43 remote-bzr: set author if available
[fc: added tests]

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-07 00:39:27 -07:00
Christophe Simonis bc51f7c3e2 remote-bzr: remove files before modifications
Allow re-add of a deleted file in the same commit.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-07 00:39:26 -07:00
Christophe Simonis 82447e3361 remote-bzr: fix directory renaming
Git does not handle directories, renaming a directory is renaming every
files in this directory.

[fc: added tests]

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-07 00:39:26 -07:00
Junio C Hamano bfd70c53b3 Sync with maint
* maint:
  mailmap: update Pasky's address
  git-remote-mediawiki: new wiki URL in documentation
2013-04-04 13:03:50 -07:00
Matthieu Moy 9b924eee98 git-remote-mediawiki: new wiki URL in documentation
The Bibzball wiki is not maintained anymore.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-04 09:54:38 -07:00
Felipe Contreras 091e051e88 remote-hg: fix hg-git test-case
There was some lingering code that shouldn't have been there in the
first place.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-04 09:35:51 -07:00
Felipe Contreras c0e1ba4e17 remote-bzr: remove stale check code for tests
The fastimport plugin was only required in the early stage of
development.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-04 09:35:42 -07:00
Felipe Contreras e4f0e34c89 remote-helpers: fix the run of all tests
We don't need to check for duplicate test numbers, we don't have them,
and either way test-lint-duplicates doesn't work in this situation.

Also, while we are on it, enable test-lint-shell-syntax to check for sh
errors.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-04 09:35:20 -07:00
Felipe Contreras afeb525980 remote-bzr: avoid echo -n
It's not portable, as reported by test-lint.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-04 09:35:00 -07:00
Junio C Hamano 5ab3e4c1b2 Merge branch 'rr/prompt-revert-head'
The prompt string generator did not notice when we are in a middle
of a "git revert" session.

* rr/prompt-revert-head:
  bash: teach __git_ps1 about REVERT_HEAD
2013-04-03 09:34:43 -07:00
Junio C Hamano 41e603af58 Merge branch 'da/downcase-u-in-usage' into maint
* da/downcase-u-in-usage:
  contrib/mw-to-git/t/install-wiki.sh: use a lowercase "usage:" string
  contrib/examples/git-remote.perl: use a lowercase "usage:" string
  tests: use a lowercase "usage:" string
  git-svn: use a lowercase "usage:" string
  Documentation/user-manual.txt: use a lowercase "usage:" string
  templates/hooks--update.sample: use a lowercase "usage:" string
  contrib/hooks/setgitperms.perl: use a lowercase "usage:" string
  contrib/examples: use a lowercase "usage:" string
  contrib/fast-import/import-zips.py: use spaces instead of tabs
  contrib/fast-import/import-zips.py: fix broken error message
  contrib/fast-import: use a lowercase "usage:" string
  contrib/credential: use a lowercase "usage:" string
  git-cvsimport: use a lowercase "usage:" string
  git-cvsimport: use a lowercase "usage:" string
  git-cvsexportcommit: use a lowercase "usage:" string
  git-archimport: use a lowercase "usage:" string
  git-merge-one-file: use a lowercase "usage:" string
  git-relink: use a lowercase "usage:" string
  git-svn: use a lowercase "usage:" string
  git-sh-setup: use a lowercase "usage:" string
2013-04-01 09:19:04 -07:00
Robin Rosenberg 3ee4452837 bash: teach __git_ps1 about REVERT_HEAD
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-31 19:07:26 -07:00
Junio C Hamano b03b41e24c Merge branch 'jl/submodule-deinit'
There was no Porcelain way to say "I no longer am interested in
this submodule", once you express your interest in a submodule with
"submodule init".  "submodule deinit" is the way to do so.

* jl/submodule-deinit:
  submodule: add 'deinit' command
2013-03-25 14:00:29 -07:00
Junio C Hamano ea11711210 Merge branch 'tz/credential-authinfo'
A new read-only credential helper (in contrib/) to interact with
the .netrc/.authinfo files.  Hopefully mn/send-email-authinfo topic
can rebuild on top of something like this.

* tz/credential-authinfo:
  Add contrib/credentials/netrc with GPG support
2013-03-21 14:03:00 -07:00
Junio C Hamano c2bf648b84 Merge branch 'da/downcase-u-in-usage'
* da/downcase-u-in-usage:
  contrib/mw-to-git/t/install-wiki.sh: use a lowercase "usage:" string
  contrib/examples/git-remote.perl: use a lowercase "usage:" string
  tests: use a lowercase "usage:" string
  git-svn: use a lowercase "usage:" string
  Documentation/user-manual.txt: use a lowercase "usage:" string
  templates/hooks--update.sample: use a lowercase "usage:" string
  contrib/hooks/setgitperms.perl: use a lowercase "usage:" string
  contrib/examples: use a lowercase "usage:" string
  contrib/fast-import/import-zips.py: use spaces instead of tabs
  contrib/fast-import/import-zips.py: fix broken error message
  contrib/fast-import: use a lowercase "usage:" string
  contrib/credential: use a lowercase "usage:" string
  git-cvsimport: use a lowercase "usage:" string
  git-cvsimport: use a lowercase "usage:" string
  git-cvsexportcommit: use a lowercase "usage:" string
  git-archimport: use a lowercase "usage:" string
  git-merge-one-file: use a lowercase "usage:" string
  git-relink: use a lowercase "usage:" string
  git-svn: use a lowercase "usage:" string
  git-sh-setup: use a lowercase "usage:" string
2013-03-19 12:15:54 -07:00
Junio C Hamano f1eba9f055 Merge branch 'mp/complete-paths'
* mp/complete-paths:
  git-completion.bash: zsh does not implement function redirection correctly
2013-03-11 10:32:16 -07:00
Matthieu Moy 35ba83ccf6 git-completion.bash: zsh does not implement function redirection correctly
A recent change added functions whose entire standard error stream
is redirected to /dev/null using a construct that is valid POSIX.1
but is not widely used:

	funcname () {
		cd "$1" && run some command "$2"
	} 2>/dev/null

Even though this file is "git-completion.bash", zsh completion
support dot-sources it (instead of asking bash to grok it like tcsh
completion does), and zsh does not implement this redirection
correctly.

With zsh, trying to complete an inexistant directory gave this:

  git add no-such-dir/__git_ls_files_helper💿2: no such file or directory: no-such-dir/

Also these functions use "cd" to first go somewhere else before
running a command, but the location the caller wants them to go that
is given as an argument to them should not be affected by CDPATH
variable the users may have set for their interactive session.

To fix both of these, wrap the body of the function in a subshell,
unset CDPATH at the beginning of the subshell, and redirect the
standard error stream of the subshell to /dev/null.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-11 10:22:56 -07:00
Junio C Hamano c5443b2a1e Merge branch 'mp/complete-paths'
* mp/complete-paths:
  git-completion.zsh: define __gitcomp_file compatibility function
2013-03-07 13:11:55 -08:00
Matthieu Moy 926eb7ba4c git-completion.zsh: define __gitcomp_file compatibility function
Commit fea16b47b6 (Fri Jan 11 19:48:43 2013, Manlio Perillo,
git-completion.bash: add support for path completion), introduced a new
__gitcomp_file function that uses the bash builtin "compgen". The
function was redefined for ZSH in the deprecated section of
git-completion.bash, but not in the new git-completion.zsh script.

As a result, users of git-completion.zsh trying to complete "git add
fo<tab>" get an error:

git add fo__gitcomp_file:8: command not found: compgen

This patch adds the redefinition and removes the error.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-05 08:54:03 -08:00
Jens Lehmann cf41982806 submodule: add 'deinit' command
With "git submodule init" the user is able to tell git he cares about one
or more submodules and wants to have it populated on the next call to "git
submodule update". But currently there is no easy way he could tell git he
does not care about a submodule anymore and wants to get rid of his local
work tree (except he knows a lot about submodule internals and removes the
"submodule.$name.url" setting from .git/config together with the work tree
himself).

Help those users by providing a 'deinit' command. This removes the
whole submodule.<name> section from .git/config (either for the given
submodule(s) or for all those which have been initialized if '.' is used)
together with their work tree. Fail if the current work tree contains
modifications (unless forced), but don't complain when either the work
tree is already removed or no settings are found in .git/config.

Add tests and link the man pages of "git submodule deinit" and "git rm"
to assist the user in deciding whether removing or unregistering the
submodule is the right thing to do for him. Also add the deinit subcommand
to the completion list.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-04 14:48:02 -08:00
Karsten Blees 8b2d219a3d wincred: improve compatibility with windows versions
On WinXP, the windows credential helper doesn't work at all (due to missing
Cred[Un]PackAuthenticationBuffer APIs). On Win7, the credential format used
by wincred is incompatible with native Windows tools (such as the control
panel applet or 'cmdkey.exe /generic'). These Windows tools only set the
TargetName, UserName and CredentialBlob members of the CREDENTIAL
structure (where CredentialBlob is the UTF-16-encoded password).

Remove the unnecessary packing / unpacking of the password, along with the
related API definitions, for compatibility with Windows XP.

Don't use CREDENTIAL_ATTRIBUTEs to identify credentials for compatibility
with Windows credential manager tools. Parse the protocol, username, host
and path fields from the credential's target name instead.

Credentials created with an old wincred version will have mangled or empty
passwords after this change.

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
2013-02-26 17:42:46 +01:00
Karsten Blees 3b12f46ab3 wincred: accept CRLF on stdin to simplify console usage
The windows credential helper currently only accepts LF on stdin, but bash
and cmd.exe both send CRLF. This prevents interactive use in the console.

Change the stdin parser to optionally accept CRLF.

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
2013-02-26 17:42:24 +01:00
Ted Zlatanov 5482920919 Add contrib/credentials/netrc with GPG support
This credential helper supports multiple files, returning the first one
that matches.  It checks file permissions and owner.  For *.gpg files,
it will run GPG to decrypt the file.

Signed-off-by: Ted Zlatanov <tzz@lifelogs.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-02-25 13:46:14 -08:00
David Aguilar ebffb3d03c contrib/mw-to-git/t/install-wiki.sh: use a lowercase "usage:" string
Make the usage string consistent with Git.

Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-02-24 21:30:18 -08:00
David Aguilar f86cad7164 contrib/examples/git-remote.perl: use a lowercase "usage:" string
Make the usage string consistent with Git.

Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-02-24 21:30:15 -08:00
David Aguilar 00eae5ef13 contrib/hooks/setgitperms.perl: use a lowercase "usage:" string
Make the usage string consistent with Git.

Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-02-24 13:31:09 -08:00
David Aguilar beb5ab184c contrib/examples: use a lowercase "usage:" string
Make the usage string consistent with Git.

Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-02-24 13:31:09 -08:00
David Aguilar e257f0551f contrib/fast-import/import-zips.py: use spaces instead of tabs
Follow the conventional Python style by using 4-space indents
instead of hard tabs.

Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-02-24 13:31:08 -08:00
David Aguilar 61a7aaccf4 contrib/fast-import/import-zips.py: fix broken error message
The 'sys' module is not imported but all of the bits
we want from it are.  Adjust the script to not fail
when run on old Python versions and fix the inconsistent
use of tabs.

Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-02-24 13:31:08 -08:00
David Aguilar dd3a4ad95f contrib/fast-import: use a lowercase "usage:" string
Make the usage string consistent with Git.

Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-02-24 13:31:08 -08:00
David Aguilar c358ed756e contrib/credential: use a lowercase "usage:" string
Make the usage string consistent with Git.

Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-02-24 13:31:08 -08:00
Martin Erik Werner 31e6a4e613 shell-prompt: clean up nested if-then
Minor clean up of if-then nesting in checks for environment variables
and config options. No functional changes.

Signed-off-by: Martin Erik Werner <martinerikwerner@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-02-18 15:33:31 -08:00
Junio C Hamano abea4dc76a Merge branch 'mp/diff-algo-config'
Add diff.algorithm configuration so that the user does not type
"diff --histogram".

* mp/diff-algo-config:
  diff: Introduce --diff-algorithm command line option
  config: Introduce diff.algorithm variable
  git-completion.bash: Autocomplete --minimal and --histogram for git-diff
2013-02-17 15:25:52 -08:00
Junio C Hamano adbbc6f291 Merge branch 'mw/bash-prompt-show-untracked-config'
Allows skipping the untracked check GIT_PS1_SHOWUNTRACKEDFILES
asks for the git-prompt (in contrib/) per repository.

* mw/bash-prompt-show-untracked-config:
  t9903: add extra tests for bash.showDirtyState
  t9903: add tests for bash.showUntrackedFiles
  shell prompt: add bash.showUntrackedFiles option
2013-02-17 15:25:46 -08:00
Junio C Hamano b1bcb973af Merge branch 'mm/config-local-completion'
* mm/config-local-completion:
  completion: support 'git config --local'
2013-02-14 16:06:19 -08:00
Junio C Hamano 97a8f025e5 Merge branch 'mm/remote-mediawiki-build'
* mm/remote-mediawiki-build:
  git-remote-mediawiki: use toplevel's Makefile
  Makefile: make script-related rules usable from subdirectories
2013-02-14 10:29:49 -08:00
Junio C Hamano 260adc87b3 Merge branch 'dg/subtree-fixes'
contrib/subtree updates, but here are only the ones that looked
ready.  The remainder of the patches will have another day.

* dg/subtree-fixes:
  contrib/subtree: make the manual directory if needed
  contrib/subtree: honor DESTDIR
  contrib/subtree: fix synopsis
  contrib/subtree: better error handling for 'subtree add'
  contrib/subtree: use %B for split subject/body
  contrib/subtree: remove test number comments
2013-02-14 10:28:26 -08:00
Martin Erik Werner 66cb5d4420 shell prompt: add bash.showUntrackedFiles option
Add a config option 'bash.showUntrackedFiles' which allows enabling
the prompt showing untracked files on a per-repository basis. This is
useful for some repositories where the 'git ls-files ...' command may
take a long time.

Signed-off-by: Martin Erik Werner <martinerikwerner@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-02-13 08:06:57 -08:00
Matthieu Moy 66c0786ca5 completion: support 'git config --local'
This needs to be done in two places: __git_config_get_set_variables to
allow clever completion of "git config --local --get foo<tab>", and
_git_config to allow "git config --loc<tab>" to complete to --local.

While we're there, change the order of options in the code to match
git-config.txt.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-02-12 10:06:25 -08:00
Junio C Hamano d03d820a8c Merge branch 'mk/tcsh-complete-only-known-paths'
The "complete with known paths only" update to completion scripts
returns directory names without trailing slash to compensate the
addition of '/' done by bash that reads from our completion result.
tcsh completion code that reads from our internal completion result
does not add '/', so let it ask our complletion code to keep the '/'
at the end.

* mk/tcsh-complete-only-known-paths:
  completion: handle path completion and colon for tcsh script
2013-02-08 15:28:51 -08:00
Junio C Hamano d931e2fb25 Merge branch 'mp/complete-paths'
The completion script used to let the default completer to suggest
pathnames, which gave too many irrelevant choices (e.g. "git add"
would not want to add an unmodified path).  Teach it to use a more
git-aware logic to enumerate only relevant ones.

* mp/complete-paths:
  git-completion.bash: add support for path completion
2013-02-08 15:28:42 -08:00
Matthieu Moy 1986768f9c git-remote-mediawiki: use toplevel's Makefile
This makes the Makefile simpler, while providing more features, and more
consistency (the exact same rules with the exact same configuration as
Git official commands are applied with the new version).

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-02-08 10:02:32 -08:00
Junio C Hamano 696c35972f Merge branch 'jc/do-not-let-random-file-interfere-with-completion-tests' into maint
Scripts to test bash completion was inherently flaky as it was
affected by whatever random things the user may have on $PATH.

* jc/do-not-let-random-file-interfere-with-completion-tests:
  t9902: protect test from stray build artifacts
2013-02-07 15:15:23 -08:00
Jesper L. Nielsen 8165be064e contrib/subtree: make the manual directory if needed
Before install git-subtree documentation, make sure the manpage
directory exists.

Signed-off-by: Jesper L. Nielsen <lyager@gmail.com>
Signed-off-by: David A. Greene <greened@obbligato.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-02-05 15:23:41 -08:00
Adam Tkac d86848228f contrib/subtree: honor DESTDIR
Teach git-subtree's Makefile to honor DESTDIR.

Signed-off-by: Adam Tkac <atkac@redhat.com>
Signed-off-by: David A. Greene <greened@obbligato.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-02-05 15:23:19 -08:00
David A. Greene 111dc0eea0 contrib/subtree: fix synopsis
Fix the documentation of add to show that a repository can be
specified along with a commit.

Suggested by Yann Dirson <dirson@bertin.fr>.

Signed-off-by: David A. Greene <greened@obbligato.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-02-05 15:23:05 -08:00
David A. Greene 10a49587fa contrib/subtree: better error handling for 'subtree add'
Check refspecs for validity before passing them on to other commands.
This lets us generate more helpful error messages.

Signed-off-by: David A. Greene <greened@obbligato.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-02-05 15:22:36 -08:00
Techlive Zheng a5b8e28e4e contrib/subtree: use %B for split subject/body
Use %B to format the commit message and body to avoid an extra newline
if a commit only has a subject line.

Signed-off-by: Techlive Zheng <techlivezheng@gmail.com>
Signed-off-by: David A. Greene <greened@obbligato.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-02-05 15:22:12 -08:00
David A. Greene 144797d720 contrib/subtree: remove test number comments
Delete the comments indicating test numbers as it causes maintenance
headaches.  t*.sh -i will help us find any broken tests and these
numbers are not helping us anyway.

Signed-off-by: David A. Greene <greened@obbligato.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-02-05 15:19:35 -08:00
Junio C Hamano 3e515b0d40 Merge branch 'jk/remote-helpers-in-python-3'
Prepare remote-helper test written in Python to be run with Python3.

* jk/remote-helpers-in-python-3:
  git_remote_helpers: remove GIT-PYTHON-VERSION upon "clean"
  git-remote-testpy: fix path hashing on Python 3
  git-remote-testpy: call print as a function
  git-remote-testpy: don't do unbuffered text I/O
  git-remote-testpy: hash bytes explicitly
  svn-fe: allow svnrdump_sim.py to run with Python 3
  git_remote_helpers: use 2to3 if building with Python 3
  git_remote_helpers: force rebuild if python version changes
  git_remote_helpers: fix input when running under Python 3
  git_remote_helpers: allow building with Python 3
2013-02-04 10:25:34 -08:00
Junio C Hamano 5617394f71 Merge branch 'bc/fix-array-syntax-for-3.0-in-completion-bash' into maint
Command line completion code was inadvertently made incompatible with
older versions of bash by using a newer array notation.

* bc/fix-array-syntax-for-3.0-in-completion-bash:
  git-completion.bash: replace zsh notation that breaks bash 3.X
2013-02-04 10:03:13 -08:00
Marc Khouzam c6929ff239 completion: handle path completion and colon for tcsh script
Recent enhancements to git-completion.bash provide intelligent path
completion for git commands.  Such completions do not provide the
'/' at the end of directories for recent versions of bash; instead,
bash itself will add the trailing slash to directories to the result
provided by git-completion.bash.  However, the completion for tcsh
uses the result of the bash completion script directly, so it either
needs to add the necessary slash itself, or needs to ask the bash
script to keep the trailing slash.

Adding the slash itself is difficult because we have to check the
each path in the output of the bash script to see if it is meant to
be a directory or something else.  For example, assuming there is a
directory named 'commit' in the current directory, then, when
completing

  git add commit<tab>

we would need to add a slash, but for

  git help commit<tab>

we should not.

Figuring out such differences would require adding much intelligence
to the tcsh completion script.  Instead, it is simpler to ask the
bash script to keep the trailing slash.  This patch does this.

Also, tcsh does not handle the colon as a completion separator so we
remove it from the list of separators.

Signed-off-by: Marc Khouzam <marc.khouzam@ericsson.com>
2013-02-03 18:59:34 -08:00
Junio C Hamano 51a1d232a7 Merge branch 'jc/do-not-let-random-file-interfere-with-completion-tests'
Scripts to test bash completion was inherently flaky as it was
affected by whatever random things the user may have on $PATH.

* jc/do-not-let-random-file-interfere-with-completion-tests:
  t9902: protect test from stray build artifacts
2013-02-01 12:39:46 -08:00
Junio C Hamano 7025616048 Merge branch 'ds/completion-silence-in-tree-path-probe' into maint
* ds/completion-silence-in-tree-path-probe:
  git-completion.bash: silence "not a valid object" errors
2013-01-28 11:12:47 -08:00
Junio C Hamano 095d65d73b Merge branch 'jn/maint-trim-vim-contrib' into maint
* jn/maint-trim-vim-contrib:
  contrib/vim: simplify instructions for old vim support
2013-01-28 11:12:36 -08:00
Junio C Hamano c1640aa5d3 Merge branch 'mk/complete-tcsh' into maint
Command line completion for "tcsh" emitted an unwanted space
after completing a single directory name.

* mk/complete-tcsh:
  Prevent space after directories in tcsh completion
2013-01-28 11:11:51 -08:00
Junio C Hamano 38f7636410 Merge branch 'bc/fix-array-syntax-for-3.0-in-completion-bash'
Fix use of an array notation that older versions of bash do not
understand.

* bc/fix-array-syntax-for-3.0-in-completion-bash:
  git-completion.bash: replace zsh notation that breaks bash 3.X
2013-01-28 10:59:07 -08:00
John Keeping cadbf5c7ed svn-fe: allow svnrdump_sim.py to run with Python 3
The changes to allow this script to run with Python 3 are minimal and do
not affect its functionality on the versions of Python 2 that are
already supported (2.4 onwards).

Signed-off-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-24 19:32:35 -08:00
Junio C Hamano 5047822347 t9902: protect test from stray build artifacts
When you have random build artifacts in your build directory, left
behind by running "make" while on another branch, the "git help -a"
command run by __git_list_all_commands in the completion script that
is being tested does not have a way to know that they are not part
of the subcommands this build will ship.  Such extra subcommands may
come from the user's $PATH.  They will interfere with the tests that
expect a certain prefix to uniquely expand to a known completion.

Instrument the completion script and give it a way for us to tell
what (subset of) subcommands we are going to ship.

Also add a test to "git --help <prefix><TAB>" expansion.  It needs
to show not just commands but some selected documentation pages.

Based on an idea by Jeff King.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-24 15:08:37 -08:00
Junio C Hamano 86db746449 Merge branch 'ch/add-auto-submitted-in-sample-post-receive-email'
* ch/add-auto-submitted-in-sample-post-receive-email:
  Add Auto-Submitted header to post-receive-email
2013-01-23 21:19:19 -08:00
Junio C Hamano a39b15b4f6 Merge branch 'as/check-ignore'
Add a new command "git check-ignore" for debugging .gitignore
files.

The variable names may want to get cleaned up but that can be done
in-tree.

* as/check-ignore:
  clean.c, ls-files.c: respect encapsulation of exclude_list_groups
  t0008: avoid brace expansion
  add git-check-ignore sub-command
  setup.c: document get_pathspec()
  add.c: extract new die_if_path_beyond_symlink() for reuse
  add.c: extract check_path_for_gitlink() from treat_gitlinks() for reuse
  pathspec.c: rename newly public functions for clarity
  add.c: move pathspec matchers into new pathspec.c for reuse
  add.c: remove unused argument from validate_pathspec()
  dir.c: improve docs for match_pathspec() and match_pathspec_depth()
  dir.c: provide clear_directory() for reclaiming dir_struct memory
  dir.c: keep track of where patterns came from
  dir.c: use a single struct exclude_list per source of excludes

Conflicts:
	builtin/ls-files.c
	dir.c
2013-01-23 21:19:10 -08:00
Junio C Hamano 864b5c41e4 Merge branch 'mh/remote-hg-mode-bits-fix'
Update to the Hg remote helper (in contrib/).

* mh/remote-hg-mode-bits-fix:
  remote-hg: fix handling of file perms when pushing
2013-01-21 20:15:40 -08:00
Junio C Hamano 9a69ef1e70 Merge branch 'fc/remote-hg-fixup-url'
Update to the Hg remote helper (in contrib/).

* fc/remote-hg-fixup-url:
  remote-hg: store converted URL
2013-01-21 20:15:32 -08:00
Brandon Casey 50c5885e05 git-completion.bash: replace zsh notation that breaks bash 3.X
When commit d8b45314 began separating the zsh completion from the bash
completion, it introduced a zsh completion "bridge" section into the bash
completion script for zsh users to use until they migrated to the zsh
script.  The zsh '+=()' append-to-array notation prevents bash 3.00.15 on
CentOS 4.x from loading the completion script and breaks test 9902.  We can
easily work around this by using standard Bash array notation.

Signed-off-by: Brandon Casey <drafnel@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-18 12:16:38 -08:00
Junio C Hamano 7829253684 Merge branch 'ds/completion-silence-in-tree-path-probe'
An internal ls-tree call made by completion code only to probe if
a path exists in the tree recorded in a commit object leaked error
messages when the path is not there.  It is not an error at all and
should not be shown to the end user.

* ds/completion-silence-in-tree-path-probe:
  git-completion.bash: silence "not a valid object" errors
2013-01-18 11:20:03 -08:00
Junio C Hamano bd2734ae0d Merge branch 'jn/maint-trim-vim-contrib'
Remove instructions for old vim support, which is better described
in the upstream vim documentation.

* jn/maint-trim-vim-contrib:
  contrib/vim: simplify instructions for old vim support
2013-01-18 11:19:39 -08:00
Junio C Hamano 3a1bba7e38 Merge branch 'mk/complete-tcsh'
Update tcsh command line completion so that an unwanted space is
not added to a single directory name.

* mk/complete-tcsh:
  Prevent space after directories in tcsh completion
2013-01-18 11:19:28 -08:00
Chris Hiestand 7811aabbe7 Add Auto-Submitted header to post-receive-email
This conforms to RFC3834 and is useful in preventing eg
vacation auto-responders from replying by default

Signed-off-by: Chris Hiestand <chiestand@salk.edu>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-17 12:47:27 -08:00
Michal Privoznik 07924d4d50 diff: Introduce --diff-algorithm command line option
Since command line options have higher priority than config file
variables and taking previous commit into account, we need a way
how to specify myers algorithm on command line. However,
inventing `--myers` is not the right answer. We need far more
general option, and that is `--diff-algorithm`.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-16 09:41:18 -08:00
Michal Privoznik 07ab4dec80 config: Introduce diff.algorithm variable
Some users or projects prefer different algorithms over others, e.g.
patience over myers or similar. However, specifying appropriate
argument every time diff is to be used is impractical. Moreover,
creating an alias doesn't play nicely with other tools based on diff
(git-show for instance). Hence, a configuration variable which is able
to set specific algorithm is needed. For now, these four values are
accepted: 'myers' (which has the same effect as not setting the config
variable at all), 'minimal', 'patience' and 'histogram'.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-16 09:37:45 -08:00
Max Horn 3968e302f8 remote-hg: fix handling of file perms when pushing
Previously, when changing and committing an executable file, the file
would loose its executable bit on the hg side. Likewise, symlinks ended
up as "normal" files". This was not immediately apparent on the git side
unless one did a fresh clone.

Signed-off-by: Max Horn <max@quendi.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-15 10:01:11 -08:00
Felipe Contreras e6bc8a3328 remote-hg: store converted URL
Mercurial might convert the URL to something more appropriate, like an
absolute path. Lets store that instead of the original URL, which won't
work from a different working directory if it's relative.

Suggested-by: Max Horn <max@quendi.de>
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Max Horn <max@quendi.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-15 09:57:57 -08:00
Michal Privoznik 216120ab83 git-completion.bash: Autocomplete --minimal and --histogram for git-diff
Even though --patience was already there, we missed --minimal and
--histogram for some reason.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-14 10:31:13 -08:00
Junio C Hamano dca93d2b01 Merge branch 'jk/complete-commit-c' into maint
* jk/complete-commit-c:
  completion: complete refs for "git commit -c"
2013-01-14 08:02:35 -08:00
Manlio Perillo fea16b47b6 git-completion.bash: add support for path completion
The git-completion.bash script did not implemented full, git aware,
support to complete paths, for git commands that operate on files within
the current working directory or the index.

As an example:

	git add <TAB>

will suggest all files in the current working directory, including
ignored files and files that have not been modified.

Support path completion, for git commands where the non-option arguments
always refer to paths within the current working directory or the index,
as follows:

* the path completion for the "git rm" and "git ls-files"
  commands will suggest all cached files.

* the path completion for the "git add" command will suggest all
  untracked and modified files.  Ignored files are excluded.

* the path completion for the "git clean" command will suggest all
  untracked files.  Ignored files are excluded.

* the path completion for the "git mv" command will suggest all cached
  files when expanding the first argument, and all untracked and cached
  files for subsequent arguments.  In the latter case, empty directories
  are included and ignored files are excluded.

* the path completion for the "git commit" command will suggest all
  files that have been modified from the HEAD, if HEAD exists, otherwise
  it will suggest all cached files.

For all affected commands, completion will always stop at directory
boundary.  Only standard ignored files are excluded, using the
--exclude-standard option of the ls-files command.

When using a recent Bash version, Git path completion will be the same
as builtin file completion, e.g.

	git add contrib/

will suggest relative file names.

Signed-off-by: Manlio Perillo <manlio.perillo@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-11 13:22:15 -08:00
Dylan Smith ca87dd623d git-completion.bash: silence "not a valid object" errors
Trying to complete the command

  git show master:./file

would cause a "Not a valid object name" error to be output on standard
error. Silence the error so it won't appear on the command line.

Signed-off-by: Dylan Smith <dylan.ah.smith@gmail.com>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-11 08:44:08 -08:00
Jonathan Nieder 9a6dcb37bd contrib/vim: simplify instructions for old vim support
Rely on the upstream filetype.vim instead of duplicating its rules in
git's instructions for syntax highlighting support on pre-7.2 vim
versions.

The result is a shorter contrib/vim/README.  More importantly, it lets
us punt on maintenance of the autocmd rules.

So now when we fix the upstream gitsendemail rule in light of commit
eed6ca7, new git users stuck on old vim reading contrib/vim/README can
automagically get the fix without any further changes needed to git.

Once the world has moved on to vim 7.2+ completely, we can get rid of
these instructions, but for now if they are this simple it's
effortless to keep them.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-10 14:58:54 -08:00
Junio C Hamano a70472f4d6 Merge branch 'fc/remote-bzr'
New remote helper for bzr, with minimum fix squashed in.

* fc/remote-bzr:
  remote-bzr: detect local repositories
  remote-bzr: add support for older versions of bzr
  remote-bzr: add support to push special modes
  remote-bzr: add support for fecthing special modes
  remote-bzr: add simple tests
  remote-bzr: update working tree upon pushing
  remote-bzr: add support for remote repositories
  remote-bzr: add support for pushing
  Add new remote-bzr transport helper
2013-01-09 08:26:26 -08:00
Junio C Hamano 48b7f52455 Merge branch 'er/python-version-requirements'
Some python scripts we ship cannot be run with older versions of the
interpreter.

* er/python-version-requirements:
  Add checks to Python scripts for version dependencies.
2013-01-09 08:25:48 -08:00
Junio C Hamano 414c78ccff Merge branch 'maint'
* maint:
  t1402: work around shell quoting issue on NetBSD
  remote-hg: Fix biridectionality -> bidirectionality typos
2013-01-08 13:23:46 -08:00
Junio C Hamano 4208fa5ce4 Merge branch 'ms/subtree-fixlets' into maint
* ms/subtree-fixlets:
  git-subtree: fix typo in manpage
  git-subtree: ignore git-subtree executable
2013-01-08 11:17:10 -08:00
W. Trevor King 831d57a0f5 remote-hg: Fix biridectionality -> bidirectionality typos
Signed-off-by: W. Trevor King <wking@tremily.us>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-08 09:37:05 -08:00
Marc Khouzam 92f1c04243 Prevent space after directories in tcsh completion
If git-completion.bash returns a single directory as a completion,
tcsh will automatically add a space after it, which is not what the
user wants.

This commit prevents tcsh from doing this.

Also, a check is added to make sure the tcsh version used is recent
enough to allow completion to work as expected.

Signed-off-by: Marc Khouzam <marc.khouzam@ericsson.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-07 11:51:26 -08:00
Adam Spiers 368aa52952 add git-check-ignore sub-command
This works in a similar manner to git-check-attr.

Thanks to Jeff King and Junio C Hamano for the idea:
http://thread.gmane.org/gmane.comp.version-control.git/108671/focus=108815

Signed-off-by: Adam Spiers <git@adamspiers.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-06 14:26:38 -08:00
Junio C Hamano d2638e1561 Merge branch 'jk/complete-commit-c'
Complete "git commmit -c foo<TAB>" into a refname that begins with
"foo".

* jk/complete-commit-c:
  completion: complete refs for "git commit -c"
2013-01-05 23:41:53 -08:00
Junio C Hamano b81827b6b6 Merge branch 'ms/subtree-fixlets'
* ms/subtree-fixlets:
  git-subtree: fix typo in manpage
  git-subtree: ignore git-subtree executable
2013-01-03 10:29:29 -08:00
Felipe Contreras 073c3ffa58 remote-bzr: detect local repositories
So we don't create a clone unnecessarily.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-02 20:07:00 -08:00
Felipe Contreras 570e7ecd4a remote-bzr: add support for older versions of bzr
At least as old as 2.0.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-02 20:06:59 -08:00
Felipe Contreras 7edea5c958 remote-bzr: add support to push special modes
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-02 20:06:59 -08:00
Felipe Contreras bdeeb809d7 remote-bzr: add support for fecthing special modes
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-02 20:06:59 -08:00
Felipe Contreras 77b71edfb5 remote-bzr: add simple tests
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-02 20:06:59 -08:00
Eric S. Raymond a33faf2827 Add checks to Python scripts for version dependencies.
Signed-off-by: Eric S. Raymond <esr@thyrsus.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-12-28 11:35:04 -08:00
Junio C Hamano 3b73c7d1c8 Merge branch 'so/prompt-command'
Finishing touches...

* so/prompt-command:
  make __git_ps1 accept a third parameter in pcmode
2012-12-27 16:00:07 -08:00
Simon Oosthoek 126b59692b make __git_ps1 accept a third parameter in pcmode
The optional third parameter when __git_ps1 is used in
PROMPT_COMMAND mode as format string for printf to further
customize the way the git status string is embedded in the
user's PS1 prompt.

Signed-off-by: Simon Oosthoek <s.oosthoek@xs4all.nl>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-12-26 11:52:36 -08:00
Michael Schubert 248a8849fa git-subtree: fix typo in manpage
Signed-off-by: Michael Schubert <mschub@elegosoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-12-22 20:21:48 -08:00
Michael Schubert f228dade3d git-subtree: ignore git-subtree executable
Signed-off-by: Michael Schubert <mschub@elegosoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-12-22 20:21:26 -08:00
Junio C Hamano 675a0fe297 Merge branch 'jk/mailmap-cleanup'
Update various entries in our .mailmap file.

* jk/mailmap-cleanup:
  contrib: update stats/mailmap script
  .mailmap: normalize emails for Linus Torvalds
  .mailmap: normalize emails for Jeff King
  .mailmap: fix broken entry for Martin Langhoff
  .mailmap: match up some obvious names/emails
2012-12-21 15:18:20 -08:00
Jeff King 6853975857 completion: complete refs for "git commit -c"
The "-c" and "-C" options take an existing commit, so let's
complete refs, just as we would for --squash or --fixup.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-12-15 10:48:06 -08:00
Felipe Contreras adec972e52 remote-bzr: update working tree upon pushing
A 'git push' doesn't update the working directory on the remote, but
a 'bzr push' does.  Teach the remote helper for bzr to update the
working tree on the bzr side upon pushing via the "export" command.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-12-13 15:55:41 -08:00
Jeff King 53474eb92f contrib: update stats/mailmap script
This version changes quite a few things:

  1. The original parsed the mailmap file itself, and it did
     it wrong (it did not understand entries with an extra
     email key).

     Instead, this version uses git's "%aE" and "%aN"
     formats to have git perform the mapping, meaning we do
     not have to read .mailmap at all, but still operate on
     the current state that git sees (and it also works
     properly from subdirs).

  2. The original would find multiple names for an email,
     but not the other way around.

     This version can do either or both. If we find multiple
     emails for a name, the resolution is less obvious than
     the other way around. However, it can still be a
     starting point for a human to investigate.

  3. The original would order only by count, not by recency.

     This version can do either. Combined with showing the
     counts, it can be easier to decide how to resolve.

  4. This version shows similar entries in a blank-delimited
     stanza, which makes it more clear which options you are
     picking from.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-12-12 11:09:11 -08:00