summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2011-10-21completion: remove broken dead code from __git_heads() and __git_tags()Libravatar SZEDER Gábor1-20/+2
__git_heads() was introduced in 5de40f5 (Teach bash about git-repo-config., 2006-11-27), and __git_tags() in 88e21dc (Teach bash about completing arguments for git-tag, 2007-08-31). As their name suggests, __git_heads() is supposed to list only branches, and __git_tags() only tags. Since their introduction both of these functions consist of two distinct parts. The first part gets branches or tags, respectively, from a local repositoty using 'git for-each-ref'. The second part queries a remote repository given as argument using 'git ls-remote'. These remote-querying parts are broken in both functions since their introduction, because they list both branches and tags from the remote repository. (The 'git ls-remote' query is not limited to list only heads or tags, respectively, and the for loop filtering the query results prints everything except dereferenced tags.) This breakage could be easily fixed by passing the '--heads' or '--tags' options or appropriate refs patterns to the 'git ls-remote' invocations. However, that no one noticed this breakage yet is probably not a coincidence: neither of these two functions were used to query a remote repository, the remote-querying parts were dead code already upon thier introduction and remained dead ever since. Since those parts of code are broken, are and were never used, stop the bit-rotting and remove them. Signed-off-by: SZEDER Gábor <szeder@ira.uka.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-21completion: fast initial completion for config 'remote.*.fetch' valueLibravatar SZEDER Gábor1-0/+4
Refspecs for branches in a remote repository start with 'refs/heads/', so completing those refspecs with 'git config remote.origin.fetch <TAB>' always offers 'refs/heads/' first, because that's the unique part of the possible refspecs. But it does so only after querying the remote with 'git ls-remote', which can take a while when the request goes through some slower network to a remote server. Don't waste the user's time and offer 'refs/heads/' right away for 'git config remote.origin.fetch <TAB>'. The reason for putting 'refs/heads/' directly into COMPREPLY instead of using __gitcomp() is to avoid __gitcomp() adding a trailing space. Signed-off-by: SZEDER Gábor <szeder@ira.uka.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-21completion: improve ls-remote output filtering in __git_refs_remotes()Libravatar SZEDER Gábor1-9/+4
This follows suit of a previous patch for __git_refs(): use a while-read loop and let bash's word splitting get rid of object names from 'git ls-remote's output. Signed-off-by: SZEDER Gábor <szeder@ira.uka.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-21completion: query only refs/heads/ in __git_refs_remotes()Libravatar SZEDER Gábor1-8/+5
__git_refs_remotes() is used to provide completion for refspecs to set 'remote.*.fetch' config variables for branches on the given remote. So it's really only interested in refs under 'refs/heads/', but it queries the remote for all its refs and then filters out all refs outside of 'refs/heads/'. Let 'git ls-remote' do the filtering. Also remove the unused $cmd variable from __git_refs_remotes(). Signed-off-by: SZEDER Gábor <szeder@ira.uka.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-21completion: support full refs from remote repositoriesLibravatar SZEDER Gábor1-8/+21
When the __git_refs() completion helper function lists refs from a local repository, it usually lists the refs' short name, except when it needs to provide completion for words starting with refs, because in that case it lists full ref names, see 608efb87 (bash: complete full refs, 2008-11-28). Add the same functionality to the code path dealing with remote repositories, too. Signed-off-by: SZEDER Gábor <szeder@ira.uka.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-21completion: improve ls-remote output filtering in __git_refs()Libravatar SZEDER Gábor1-7/+7
The remote-handling part of __git_refs() has a nice for loop and state machine case statement to iterate over all words from the output of 'git ls-remote' to identify object names and ref names. Since each line in the output of 'git ls-remote' consists of an object name and a ref name, we can do more effective filtering by using a while-read loop and letting bash's word splitting take care of object names. This way the code is easier to understand and the loop will need only half the number of iterations than before. Signed-off-by: SZEDER Gábor <szeder@ira.uka.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-21completion: make refs completion consistent for local and remote reposLibravatar SZEDER Gábor1-4/+2
For a local repository the __git_refs() completion helper function lists refs under 'refs/(tags|heads|remotes)/', plus some special refs like HEAD and ORIG_HEAD. For a remote repository, however, it lists all refs. Fix this inconsistency by specifying refs filter patterns for 'git ls-remote' to only list refs under 'refs/(tags|heads|remotes)/'. For now this makes it impossible to complete refs outside of 'refs/(tags|heads|remotes)/' in a remote repository, but a followup patch will resurrect that. Signed-off-by: SZEDER Gábor <szeder@ira.uka.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-21completion: optimize refs completionLibravatar SZEDER Gábor1-45/+70
After a unique command or option is completed, in most cases it is a good thing to add a trailing a space, but sometimes it doesn't make sense, e.g. when the completed word is an option taking an argument ('--option=') or a configuration section ('core.'). Therefore the completion script uses the '-o nospace' option to prevent bash from automatically appending a space to unique completions, and it has the __gitcomp() function to add that trailing space only when necessary. See 72e5e989 (bash: Add space after unique command name is completed., 2007-02-04), 78d4d6a2 (bash: Support unique completion on git-config., 2007-02-04), and b3391775 (bash: Support unique completion when possible., 2007-02-04). __gitcomp() therefore iterates over all possible completion words it got as argument, and checks each word whether a trailing space is necessary or not. This is ok for commands, options, etc., i.e. when the number of words is relatively small, but can be noticeably slow for large number of refs. However, while options might or might not need that trailing space, refs are always handled uniformly and always get that trailing space (or a trailing '.' for 'git config branch.<head>.'). Since refs listed by __git_refs() & co. are separated by newline, this allows us some optimizations with 'compgen'. So, add a specialized variant of __gitcomp() that only deals with possible completion words separated by a newline and uniformly appends the trailing space to all words using 'compgen -S " "' (or any other suffix, if specified), so no iteration over all words is needed. But we need to fiddle with IFS, because the default IFS containing a space would cause the added space suffix to be stripped off when compgen's output is stored in the COMPREPLY array. Therefore we use only newline as IFS, hence the requirement for the newline-separated possible completion words. Convert all callsites of __gitcomp() where it's called with refs, i.e. when it gets the output of either __git_refs(), __git_heads(), __git_tags(), __git_refs2(), __git_refs_remotes(), or the odd 'git for-each-ref' somewhere in _git_config(). Also convert callsites where it gets other uniformly handled newline separated word lists, i.e. either remotes from __git_remotes(), names of set configuration variables from __git_config_get_set_variables(), stashes, or commands. Here are some timing results for dealing with 10000 refs. Before: $ refs="$(__git_refs ~/tmp/git/repo-with-10k-refs/)" $ time __gitcomp "$refs" real 0m1.134s user 0m1.060s sys 0m0.130s After: $ time __gitcomp_nl "$refs" real 0m0.373s user 0m0.360s sys 0m0.020s Signed-off-by: SZEDER Gábor <szeder@ira.uka.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-21completion: document __gitcomp()Libravatar SZEDER Gábor1-2/+7
I always forget which argument is which, and got tired of figuring it out over and over again. Signed-off-by: SZEDER Gábor <szeder@ira.uka.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-17Merge branch 'sg/completion'Libravatar Junio C Hamano1-18/+6
* sg/completion: completion: unite --format and --pretty for 'log' and 'show' completion: unite --reuse-message and --reedit-message for 'notes'
2011-10-17Merge branch 'mm/maint-config-explicit-bool-display'Libravatar Junio C Hamano2-7/+19
* mm/maint-config-explicit-bool-display: config: display key_delim for config --bool --get-regexp
2011-10-17Merge branch 'tc/fetch-leak'Libravatar Junio C Hamano1-4/+9
* tc/fetch-leak: fetch: plug two leaks on error exit in store_updated_refs Conflicts: builtin/fetch.c
2011-10-17Merge branch 'jk/name-hash-dirent'Libravatar Junio C Hamano2-7/+9
* jk/name-hash-dirent: fix phantom untracked files when core.ignorecase is set
2011-10-17Merge branch 'ef/mingw-syslog'Libravatar Junio C Hamano1-12/+18
* ef/mingw-syslog: mingw: avoid using strbuf in syslog
2011-10-17Merge branch 'tm/completion-push-set-upstream'Libravatar Junio C Hamano1-1/+1
* tm/completion-push-set-upstream: completion: push --set-upstream
2011-10-17Merge branch 'tm/completion-commit-fixup-squash'Libravatar Junio C Hamano1-7/+4
* tm/completion-commit-fixup-squash: completion: commit --fixup and --squash completion: unite --reuse-message and --reedit-message handling
2011-10-17Merge branch 'ph/push-to-delete-nothing'Libravatar Junio C Hamano2-8/+215
* ph/push-to-delete-nothing: receive-pack: don't pass non-existent refs to post-{receive,update} hooks Conflicts: builtin/receive-pack.c
2011-10-17Merge branch 'jc/checkout-from-tree-keep-local-changes'Libravatar Junio C Hamano2-1/+47
* jc/checkout-from-tree-keep-local-changes: checkout $tree $path: do not clobber local changes in $path not in $tree
2011-10-17Merge branch 'js/bisect-no-checkout'Libravatar Junio C Hamano1-1/+2
* js/bisect-no-checkout: bisect: fix exiting when checkout failed in bisect_start()
2011-10-17resolve_gitlink_packed_ref(): fix mismergeLibravatar Junio C Hamano2-1/+30
2c5c66b (Merge branch 'jp/get-ref-dir-unsorted', 2011-10-10) merged a topic that forked from the mainline before a new helper function get_packed_refs() refactored code to read packed-refs file. The merge made the call to the helper function with an incorrect argument. The parameter to the function has to be a path to the submodule. Fix the mismerge. Helped-by: Mark Levedahl <mlevedahl@gmail.com> Helped-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-16Update draft release notes to 1.7.8Libravatar Junio C Hamano1-1/+3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-16Merge git://repo.or.cz/git-guiLibravatar Junio C Hamano9-29/+159
* git://repo.or.cz/git-gui: git-gui: incremental goto line in blame view git-gui: clear the goto line input when hiding git-gui: only accept numbers in the goto-line input git-gui: search and linenumber input are mutual exclusive in the blame view git-gui: deal with unknown files when pressing the "Stage Changed" button git-gui: drop the 'n' and 'Shift-n' bindings from the last patch. git-gui: Add keyboard shortcuts for search and goto commands in blame view. git-gui: Enable jumping to a specific line number in blame view. Fix tooltip display with multiple monitors on windows. Fix typo: existant->existent git-gui: updated translator README for current procedures. git-gui: warn when trying to commit on a detached head git-gui: Corrected a typo in the Swedish translation of 'Continue'
2011-10-16git-svn: Allow certain refs to be ignoredLibravatar Michael Olson1-5/+33
Implement a new --ignore-refs option which specifies a regex of refs to ignore while importing svn history. This is a useful supplement to the --ignore-paths option, as that option only operates on the contents of branches and tags, not the branches and tags themselves. Signed-off-by: Michael Olson <mwolson@gnu.org> Acked-by: Eric Wong <normalperson@yhbt.net>
2011-10-16git svn dcommit: new option --interactive.Libravatar Frédéric Heitzmann3-1/+146
Allow the user to check the patch set before it is commited to SVN. It is then possible to accept/discard one patch, accept all, or quit. This interactive mode is similar with 'git send email' behaviour. However, 'git svn dcommit' returns as soon as one patch is discarded. Part of the code was taken from git-send-email.perl (see 'ask' function) Tests several combinations of potential answers to 'git svn dcommit --interactive'. For each of them, test whether patches were commited to SVN or not. Thanks-to Eric Wong <normalperson@yhbt.net> for the initial idea. Acked-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Frédéric Heitzmann <frederic.heitzmann@gmail.com>
2011-10-15Sync with maintLibravatar Junio C Hamano2-41/+39
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-15Prepare for 1.7.7.1Libravatar Junio C Hamano2-1/+40
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-15Merge branch 'ms/patch-id-with-overlong-line' into maintLibravatar Junio C Hamano1-4/+6
* ms/patch-id-with-overlong-line: patch-id.c: use strbuf instead of a fixed buffer
2011-10-15Merge branch 'jc/maint-bundle-too-quiet' into maintLibravatar Junio C Hamano4-5/+10
* jc/maint-bundle-too-quiet: Teach progress eye-candy to fetch_refs_from_bundle()
2011-10-15Merge branch 'jk/filter-branch-require-clean-work-tree' into maintLibravatar Junio C Hamano1-3/+1
* jk/filter-branch-require-clean-work-tree: filter-branch: use require_clean_work_tree
2011-10-15Merge branch 'jc/maint-fsck-fwrite-size-check' into maintLibravatar Junio C Hamano1-6/+3
* jc/maint-fsck-fwrite-size-check: fsck: do not abort upon finding an empty blob
2011-10-15Merge branch 'bk/ancestry-path' into maintLibravatar Junio C Hamano3-10/+101
* bk/ancestry-path: t6019: avoid refname collision on case-insensitive systems revision: do not include sibling history in --ancestry-path output revision: keep track of the end-user input from the command line rev-list: Demonstrate breakage with --ancestry-path --all
2011-10-15Merge branch 'jk/maint-fetch-submodule-check-fix' into maintLibravatar Junio C Hamano1-5/+72
* jk/maint-fetch-submodule-check-fix: fetch: avoid quadratic loop checking for updated submodules
2011-10-15Merge branch 'tr/mergetool-valgrind' into maintLibravatar Junio C Hamano1-0/+2
* tr/mergetool-valgrind: Symlink mergetools scriptlets into valgrind wrappers
2011-10-15Merge branch 'nm/grep-object-sha1-lock' into maintLibravatar Junio C Hamano1-0/+3
* nm/grep-object-sha1-lock: grep: Fix race condition in delta_base_cache Conflicts: builtin/grep.c
2011-10-15Merge branch 'jc/diff-index-unpack' into maintLibravatar Junio C Hamano5-6/+38
* jc/diff-index-unpack: diff-index: pass pathspec down to unpack-trees machinery unpack-trees: allow pruning with pathspec traverse_trees(): allow pruning with pathspec
2011-10-15Merge branch 'mm/rebase-i-exec-edit' into maintLibravatar Junio C Hamano2-4/+40
* mm/rebase-i-exec-edit: rebase -i: notice and warn if "exec $cmd" modifies the index or the working tree rebase -i: clean error message for --continue after failed exec
2011-10-15Merge branch 'jc/grep-untracked-exclude'Libravatar Junio C Hamano1-1/+1
* jc/grep-untracked-exclude: grep: fix the error message that mentions --exclude
2011-10-15Merge branch 'jc/maint-grep-untracked-exclude' into jc/grep-untracked-excludeLibravatar Junio C Hamano1-1/+1
* jc/maint-grep-untracked-exclude: grep: fix the error message that mentions --exclude Conflicts: builtin/grep.c
2011-10-15grep: fix the error message that mentions --excludeLibravatar Bert Wesarg1-1/+1
Missing rename from --exclude to --standard-exclude. Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-15git-gui: incremental goto line in blame viewLibravatar Bert Wesarg1-4/+11
The view jumps now to the given line number after each key press. Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2011-10-15git-gui: clear the goto line input when hidingLibravatar Bert Wesarg1-0/+1
Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2011-10-15git-gui: only accept numbers in the goto-line inputLibravatar Bert Wesarg1-2/+11
Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2011-10-15git-gui: search and linenumber input are mutual exclusive in the blame viewLibravatar Bert Wesarg1-6/+16
It was possible to open the search input (Ctrl+S) and the goto-line input (Ctrl+G) at the same time. Prevent this. Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2011-10-14send-email: Fix %config_path_settings handlingLibravatar Cord Seele2-2/+38
cec5dae (use new Git::config_path() for aliasesfile, 2011-09-30) broke the expansion of aliases. This was caused by treating %config_path_settings, newly introduced in said patch, like %config_bool_settings instead of like %config_settings. Copy from %config_settings, making it more readable. While at it add basic test for expansion of aliases, and for path expansion, which would catch this error. Nb. there were a few issues that were responsible for this error: 1. %config_bool_settings and %config_settings despite similar name have different semantic. %config_bool_settings values are arrays where the first element is (reference to) the variable to set, and second element is default value... which admittedly is a bit cryptic. More readable if more verbose option would be to use hash reference, e.g.: my %config_bool_settings = ( "thread" => { variable => \$thread, default => 1}, [...] %config_settings values are either either reference to scalar variable or reference to array. In second case it means that option (or config option) is multi-valued. BTW. this is similar to what Getopt::Long does. 2. In cec5dae (use new Git::config_path() for aliasesfile, 2011-09-30) the setting "aliasesfile" was moved from %config_settings to newly introduced %config_path_settings. But the loop that parses settings from %config_path_settings was copy'n'pasted *wrongly* from %config_bool_settings instead of from %config_settings. It looks like cec5dae author cargo-culted this change... 3. 994d6c6 (send-email: address expansion for common mailers, 2006-05-14) didn't add test for alias expansion to t9001-send-email.sh Signed-off-by: Cord Seele <cowose@gmail.com> Tested-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-14Merge branch 'maint'Libravatar Junio C Hamano1-0/+5
* maint: t1304: fall back to $USER if $LOGNAME is not defined
2011-10-14t1304: fall back to $USER if $LOGNAME is not definedLibravatar René Scharfe1-0/+5
For some reason $LOGNAME is not set anymore for me after an upgrade from Ubuntu 11.04 to 11.10. Use $USER in such a case. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-13Update draft release notes to 1.7.8Libravatar Junio C Hamano1-1/+40
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-13Merge branch 'js/maint-merge-one-file-osx-expr'Libravatar Junio C Hamano1-1/+1
* js/maint-merge-one-file-osx-expr: merge-one-file: fix "expr: non-numeric argument"
2011-10-13Merge branch 'jn/ident-from-etc-mailname'Libravatar Junio C Hamano2-23/+69
* jn/ident-from-etc-mailname: ident: do not retrieve default ident when unnecessary ident: check /etc/mailname if email is unknown
2011-10-13Merge branch 'il/archive-err-signal'Libravatar Junio C Hamano1-0/+2
* il/archive-err-signal: Support ERR in remote archive like in fetch/push