Commit graph

27067 commits

Author SHA1 Message Date
Jeff King 29eec71f21 completion: match ctags symbol names in grep patterns
A common thing to grep for is the name of a symbol. This
patch teaches the completion for "git grep" to look in
a 'tags' file, if present, to complete a pattern. For
example, in git.git:

  $ make tags
  $ git grep get_sha1<Tab><Tab>
  get_sha1                 get_sha1_oneline
  get_sha1_1               get_sha1_with_context
  get_sha1_basic           get_sha1_with_context_1
  get_sha1_hex             get_sha1_with_mode
  get_sha1_hex_segment     get_sha1_with_mode_1
  get_sha1_mb

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-21 13:56:54 -07:00
Jeff King 21e4631c07 contrib: add git-jump script
This is a small script for helping your editor jump to
specific points of interest. See the README for details.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-21 13:55:59 -07:00
Junio C Hamano 8963314c77 Sync with maint 2011-10-21 11:24:34 -07:00
Junio C Hamano 8742218f21 Almost ready for 1.7.7.1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-21 11:01:07 -07:00
Junio C Hamano d25a265220 Merge branch 'nd/maint-autofix-tag-in-head' into maint
* nd/maint-autofix-tag-in-head:
  Accept tags in HEAD or MERGE_HEAD
  merge: remove global variable head[]
  merge: use return value of resolve_ref() to determine if HEAD is invalid
  merge: keep stash[] a local variable

Conflicts:
	builtin/merge.c
2011-10-21 10:49:26 -07:00
Junio C Hamano e63f87a6f7 Merge branch 'jc/apply-blank-at-eof-fix' into maint
* jc/apply-blank-at-eof-fix:
  apply --whitespace=error: correctly report new blank lines at end
2011-10-21 10:49:26 -07:00
Junio C Hamano 6e89b37d34 Merge branch 'jn/no-g-plus-s-on-bsd' into maint
* jn/no-g-plus-s-on-bsd:
  Makefile: do not set setgid bit on directories on GNU/kFreeBSD
2011-10-21 10:49:25 -07:00
Junio C Hamano 713b85c758 Merge branch 'rs/diff-cleanup-records-fix' into maint
* rs/diff-cleanup-records-fix:
  diff: resurrect XDF_NEED_MINIMAL with --minimal
  Revert removal of multi-match discard heuristic in 27af01
2011-10-21 10:49:25 -07:00
Junio C Hamano 689b047072 Merge branch 'il/archive-err-signal' into maint
* il/archive-err-signal:
  Support ERR in remote archive like in fetch/push
2011-10-21 10:49:25 -07:00
Junio C Hamano c510259c02 Merge branch 'js/maint-merge-one-file-osx-expr' into maint
* js/maint-merge-one-file-osx-expr:
  merge-one-file: fix "expr: non-numeric argument"
2011-10-21 10:49:25 -07:00
Junio C Hamano cec3e186f7 Merge branch 'jm/maint-apply-detects-corrupt-patch-header' into maint
* jm/maint-apply-detects-corrupt-patch-header:
  fix "git apply --index ..." not to deref NULL
2011-10-21 10:49:24 -07:00
Junio C Hamano df6840855d Merge branch 'jc/checkout-from-tree-keep-local-changes' into maint
* jc/checkout-from-tree-keep-local-changes:
  checkout $tree $path: do not clobber local changes in $path not in $tree
2011-10-21 10:49:24 -07:00
Junio C Hamano 634b29d270 Merge branch 'mm/maint-config-explicit-bool-display' into maint
* mm/maint-config-explicit-bool-display:
  config: display key_delim for config --bool --get-regexp
2011-10-21 10:49:24 -07:00
Lénaïc Huard c1355b7ffb gitweb: provide a way to customize html headers
This allows web sites to add some specific html headers to the pages
generated by gitweb.

The new variable $site_html_head_string can be set to an html snippet that
will be inserted at the end of the <head> section of each page generated
by gitweb.

Signed-off-by: Lénaïc Huard <lenaic@lhuard.fr.eu.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-21 10:18:37 -07:00
Tay Ray Chuan 9e76d4a834 submodule::module_clone(): silence die() message from module_name()
The die() message that may occur in module_name() is not really relevant
to the user when called from module_clone(); the latter handles the
"failure" (no submodule mapping) anyway.

Analysis of other callsites is left to future work.

Acked-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-21 10:02:02 -07:00
Tay Ray Chuan 1e42258acd submodule: whitespace fix
Replace SPs with TAB.

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-21 10:01:50 -07:00
Dan McGee 38d4debb6d pack-objects: don't traverse objects unnecessarily
This brings back some of the performance lost in optimizing recency
order inside pack objects. We were doing extreme amounts of object
re-traversal: for the 2.14 million objects in the Linux kernel
repository, we were calling add_to_write_order() over 1.03 billion times
(a 0.2% hit rate, making 99.8% of of these calls extraneous).

Two optimizations take place here- we can start our objects array
iteration from a known point where we left off before we started trying
to find our tags, and we don't need to do the deep dives required by
add_family_to_write_order() if the object has already been marked as
filled.

These two optimizations bring some pretty spectacular results via `perf
stat`:

task-clock:   83373 ms        --> 43800 ms         (50% faster)
cycles:       221,633,461,676 --> 116,307,209,986  (47% fewer)
instructions: 149,299,179,939 --> 122,998,800,184  (18% fewer)

Helped-by: Ramsay Jones (format string fix in "die" message)
Signed-off-by: Dan McGee <dpmcgee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-20 17:17:49 -07:00
Jeff King 6cf53d7df6 tests: add missing executable bits
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-20 16:52:28 -07:00
Matthieu Moy 9fb79503e6 git-remote-mediawiki: don't include HTTP login/password in author
On the MediaWiki side, the author information is just the MediaWiki login
of the contributor. The import turns it into login@$wiki_name to create
the author's email address on the wiki side. But we don't want this to
include the HTTP password if it's present in the URL ...

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-20 10:17:14 -07:00
Junio C Hamano 5595635002 resolve_ref(): report breakage to the caller without warning
629cd3a (resolve_ref(): emit warnings for improperly-formatted references,
2011-09-15) made resolve_ref() warn against files that are found in the
directories the ref dwimmery looks at. The intent may be good, but these
messages come from a wrong level of the API hierarchy.

Instead record the breakage in "flags" whose purpose is to explain the
result of the function to the caller, who is in a much better position to
make intelligent decision based on the information.

This updates sha1_name.c::dwim_ref() to warn against such a broken
candidate only when it does not appear directly below $GIT_DIR to restore
the traditional behaviour, as we know many files directly underneath
$GIT_DIR/ are not refs.

Warning against "git show config --" with "$GIT_DIR/config does not look
like a well-formed ref" does not make sense, and we may later tweak the
dwimmery not to even consider them as candidates, but that is a longer
term topic.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-19 13:58:15 -07:00
Junio C Hamano 98ac34b2b1 resolve_ref(): expose REF_ISBROKEN flag
Instead of keeping this as an internal API, let the callers find
out the reason why resolve_ref() returned NULL is not because there
was no such file in $GIT_DIR but because a file was corrupt.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-19 13:58:15 -07:00
Junio C Hamano 87009edcbd Update draft release notes to 1.7.8
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-19 11:02:13 -07:00
Brandon Casey 40d6987d24 t/t3000-ls-files-others.sh: use $SHELL_PATH to run git-new-workdir script
Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-19 10:50:18 -07:00
Junio C Hamano 3dfbe68fc2 Merge branch 'js/merge-edit-option'
* js/merge-edit-option:
  Teach merge the '[-e|--edit]' option

Conflicts:
	builtin/merge.c
2011-10-19 10:49:27 -07:00
Junio C Hamano 9b55aa03da Merge branch 'rs/diff-whole-function'
* rs/diff-whole-function:
  diff: add option to show whole functions as context
  xdiff: factor out get_func_line()
2011-10-19 10:49:13 -07:00
Junio C Hamano 662384c499 Merge branch 'rs/pickaxe'
* rs/pickaxe:
  pickaxe: factor out pickaxe
  pickaxe: give diff_grep the same signature as has_changes
  pickaxe: pass diff_options to contains and has_changes
  pickaxe: factor out has_changes
  pickaxe: plug regex/kws leak
  pickaxe: plug regex leak
  pickaxe: plug diff filespec leak with empty needle
2011-10-19 10:49:09 -07:00
Junio C Hamano 541b9cf146 Merge branch 'js/no-cherry-pick-head-after-punted'
* js/no-cherry-pick-head-after-punted:
  cherry-pick: do not give irrelevant advice when cherry-pick punted
  revert.c: defer writing CHERRY_PICK_HEAD till it is safe to do so
2011-10-19 10:49:05 -07:00
Junio C Hamano 2201cc8c97 Merge branch 'bk/submodule-in-recursive-merge'
* bk/submodule-in-recursive-merge:
  submodule: Search for merges only at end of recursive merge
  submodule: Demonstrate known breakage during recursive merge
2011-10-19 10:48:38 -07:00
Junio C Hamano c31b87d111 Merge branch 'jm/maint-apply-detects-corrupt-patch-header'
* jm/maint-apply-detects-corrupt-patch-header:
  fix "git apply --index ..." not to deref NULL
2011-10-19 10:48:29 -07:00
Junio C Hamano e283548b85 Merge branch 'jk/config-test-cleanup'
* jk/config-test-cleanup:
  t1300: attempting to remove a non-existent .git/config is not an error
2011-10-19 10:47:59 -07:00
Johannes Sixt 795290e528 t1300: attempting to remove a non-existent .git/config is not an error
Since some tests before test number 79 ("quoting") are skipped, .git/config
does not exist and 'rm .git/config' fails. Fix this particular case.

While at it, move other instance of 'rm .git/config' that occur in this
file inside the test function to document that the test cases want to
protect themselves from remnants of earlier tests.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-19 10:11:42 -07:00
Junio C Hamano aadf863de8 Merge branch 'js/log-show-children'
* js/log-show-children:
  log --children
2011-10-18 21:59:12 -07:00
Junio C Hamano 43a3b0284f Merge branch 'cb/httpd-test-fix-port'
* cb/httpd-test-fix-port:
  use test number as port number
2011-10-18 21:59:11 -07:00
Junio C Hamano 380f26c29b Merge branch 'jn/gitweb-manpages'
* jn/gitweb-manpages:
  gitweb: Add gitweb manpages to 'gitweb' package in git.spec
  Documentation: Add gitweb config variables to git-config(1)
  Documentation: Link to gitweb(1) and gitweb.conf(5) in other manpages
  gitweb: Add gitweb(1) manpage for gitweb itself
  gitweb: Add gitweb.conf(5) manpage for gitweb configuration files
2011-10-18 21:59:11 -07:00
Junio C Hamano 578183bcb0 Merge branch 'pt/mingw-misc-fixes'
* pt/mingw-misc-fixes:
  t9901: fix line-ending dependency on windows
  mingw: ensure sockets are initialized before calling gethostname
  mergetools: use the correct tool for Beyond Compare 3 on Windows
  t9300: do not run --cat-blob-fd related tests on MinGW
  git-svn: On MSYS, escape and quote SVN_SSH also if set by the user
  t9001: do not fail only due to CR/LF issues
  t1020: disable the pwd test on MinGW
2011-10-18 21:59:11 -07:00
Junio C Hamano 54633cd53b Merge branch 'md/smtp-tls-hello-again'
* md/smtp-tls-hello-again:
  send-email: Honour SMTP domain when using TLS
2011-10-18 21:59:10 -07:00
Junio C Hamano 2c4cf667b0 Merge branch 'maint'
* maint:
  strbuf.c: remove unnecessary strbuf_grow() from strbuf_getwholeline()
2011-10-18 21:42:41 -07:00
Brandon Casey 1844f8d591 strbuf.c: remove unnecessary strbuf_grow() from strbuf_getwholeline()
This use of strbuf_grow() is a historical artifact that was once used to
ensure that strbuf.buf was allocated and properly nul-terminated.  This
was added before the introduction of the slopbuf in b315c5c0, which
guarantees that strbuf.buf always points to a usable nul-terminated string.
So let's remove it.

Signed-off-by: Brandon Casey <drafnel@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-18 13:28:17 -07:00
Junio C Hamano 6942a3d796 libperl-git: refactor Git::config_*
Move common parts of Git::config(), Git::config_bool(), Git::config_int()
and Git::config_path() into _config_common() helper.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-18 12:00:33 -07:00
Sebastian Schuberth 185528a859 inet_ntop.c: Work around GCC 4.6's detection of uninitialized variables
GCC 4.6 claims that

    error: 'best.len' may be used uninitialized in this function

so silence that warning which is treated as an error by also initializing
the "len" members of the struct.

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-18 10:34:07 -07:00
Junio C Hamano 335339758c Makefile: ask "ls-files" to list source files if available
The [ce]tags and cscope targets used to run "find" looking for any paths
that match '*.[chS]' to feed the list of source files to downstream xargs.

Use "git ls-files" if it is already available to us, and otherwise use a
tighter "find" expression that does not list directories and does not go
into our .git directory.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-18 10:03:00 -07:00
Dan McGee f380872f0a pack-objects: rewrite add_descendants_to_write_order() iteratively
This removes the need to call this function recursively, shinking the
code size slightly and netting a small performance increase.

Signed-off-by: Dan McGee <dpmcgee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-18 00:16:32 -07:00
Dan McGee 92bef1a14a pack-objects: use unsigned int for counter and offset values
This is done in some of the new pack layout code introduced in commit
1b4bb16b9e. This more closely matches the nr_objects global that is
unsigned that these variables are based off of and bounded by.

Signed-off-by: Dan McGee <dpmcgee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-18 00:16:32 -07:00
Dan McGee be12681896 pack-objects: mark add_to_write_order() as inline
This function is a whole 26 bytes when compiled on x86_64, but is
currently invoked over 1.037 billion times when running pack-objects on
the Linux kernel git repository. This is hitting the point where
micro-optimizations do make a difference, and inlining it only increases
the object file size by 38 bytes.

As reported by perf, this dropped task-clock from 84183 to 83373 ms, and
total cycles from 223.5 billion to 221.6 billion. Not astronomical, but
worth getting for adding one word.

Signed-off-by: Dan McGee <dpmcgee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-18 00:16:31 -07:00
Jeff King 927a13fe87 contrib: add diff highlight script
This is a simple and stupid script for highlighting
differing parts of lines in a unified diff. See the README
for a discussion of the limitations.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-18 00:01:18 -07:00
Junio C Hamano 08cfdbb88c Update draft release notes to 1.7.8
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-17 22:08:25 -07:00
Junio C Hamano 963838402a Merge branch 'jk/http-auth'
* jk/http-auth:
  http_init: accept separate URL parameter
  http: use hostname in credential description
  http: retry authentication failures for all http requests
  remote-curl: don't retry auth failures with dumb protocol
  improve httpd auth tests
  url: decode buffers that are not NUL-terminated
2011-10-17 21:37:15 -07:00
Junio C Hamano 7f8a9387fd Merge branch 'js/check-ref-format-test-mingw'
* js/check-ref-format-test-mingw:
  t1402-check-ref-format: skip tests of refs beginning with slash on Windows
2011-10-17 21:37:15 -07:00
Junio C Hamano f2b5163525 Merge branch 'jk/pull-rebase-with-work-tree'
* jk/pull-rebase-with-work-tree:
  pull,rebase: handle GIT_WORK_TREE better

Conflicts:
	git-pull.sh
2011-10-17 21:37:14 -07:00
Junio C Hamano 0c762702a0 Merge branch 'jk/config-test-cleanup'
* jk/config-test-cleanup:
  t1300: test mixed-case variable retrieval
  t1300: put git invocations inside test function
2011-10-17 21:37:14 -07:00