1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-11-01 14:57:52 +01:00
Commit graph

20458 commits

Author SHA1 Message Date
Junio C Hamano
e1622bfcba Protect scripted Porcelains from GREP_OPTIONS insanity
If the user has exported the GREP_OPTIONS environment variable, the output
from "grep" and "egrep" in scripted Porcelains may be different from what
they expect.  For example, we may want to count number of matching lines,
by "grep" piped to "wc -l", and GREP_OPTIONS=-C3 will break such use.

The approach taken by this change to address this issue is to protect only
our own use of grep/egrep.  Because we do not unset it at the beginning of
our scripts, hook scripts run from the scripted Porcelains are exposed to
the same insanity this environment variable causes when grep/egrep is used
to implement logic (e.g. "grep | wc -l"), and it is entirely up to the
hook scripts to protect themselves.

On the other hand, applypatch-msg hook may want to show offending words in
the proposed commit log message using grep to the end user, and the user
might want to set GREP_OPTIONS=--color to paint the match more visibly.
The approach to protect only our own use without unsetting the environment
variable globally will allow this use case.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-11-23 16:31:07 -08:00
René Scharfe
7b1042292d mergetool--lib: simplify guess_merge_tool()
Use a case statement instead of calling grep to find out if the editor's
name contains the string "vim".  Remove the check for emacs, as this
branch did the same as the default one anyway.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-11-23 15:38:04 -08:00
René Scharfe
8a3c63e01d strbuf_add_wrapped_text(): skip over colour codes
Ignore display mode escape sequences (colour codes) for the purpose of
text wrapping because they don't have a visible width.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-11-23 15:36:07 -08:00
Johannes Sixt
4fa80cf0e0 t4014-format-patch: do not assume 'test' is available as non-builtin
One test case used 'xargs test', which assumes that 'test' is available
as external program. At least on MinGW it is not.

Moreover, 'git format-patch' was invoked in a pipeline, but not as the
last command. Rewrite the test case to catch breakage in 'git format-patch'
as well.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-11-23 02:55:59 -08:00
Björn Gustavsson
5c931c8da2 Fix over-simplified documentation for 'git log -z'
In commit 64485b4a, the documentation for 'git log -z' was
simplified too much. The -z option actually changes the behavior
of 'git log' in two ways: commits will be ended with a NUL
instead of a LF (correctly documented) and the --raw and
--numstat will have NUL as field terminators (omitted in
the documentation for 'git log').

Signed-off-by: Björn Gustavsson <bgustavsson@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-11-23 01:21:51 -08:00
Junio C Hamano
d21fc9342c Add trivial tests for --stdin option to log family
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-11-23 00:49:47 -08:00
Junio C Hamano
65c042d44d Merge branch 'bg/fetch-multi'
* bg/fetch-multi:
  Re-implement 'git remote update' using 'git fetch'
  builtin-fetch: add --dry-run option
  builtin-fetch: add --prune option
  teach warn_dangling_symref to take a FILE argument
  remote: refactor some logic into get_stale_heads()
  Add missing test for 'git remote update --prune'
  Add the configuration option skipFetchAll
  Teach the --multiple option to 'git fetch'
  Teach the --all option to 'git fetch'
2009-11-23 00:03:15 -08:00
Christian Couder
fc13aa3d09 bisect: simplify calling visualizer using '--bisect' option
In commit ad3f9a7 (Add '--bisect' revision machinery argument) the
'--bisect' option was added to easily pass bisection refs to
commands using the revision machinery.

So it is now shorter and safer to use the new '--bisect' revision
machinery option, than to compute the refs that we must pass.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-11-22 22:59:05 -08:00
Martin Storsjö
d21f9794ce Disable CURLOPT_NOBODY before enabling CURLOPT_PUT and CURLOPT_POST
This works around a bug in curl versions up to 7.19.4, where disabling the
CURLOPT_NOBODY option sets the internal state incorrectly considering that
CURLOPT_PUT was enabled earlier.

The bug is discussed at http://curl.haxx.se/bug/view.cgi?id=2727981 and is
corrected in the latest version of curl in CVS.

This bug usually has no impact on git, but may surface if using multi-pass
authentication methods.

Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-11-22 22:56:54 -08:00
Matthew Ogilvie
7b357240f0 config documentation: some configs are auto-set by git-init
Add documentation for core.ignorecase, and mention git-init
in core.filemode and core.symlinks.

Signed-off-by: Matthew Ogilvie <mmogilvi_git@miniinfo.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-11-22 22:56:38 -08:00
Matthew Ogilvie
2fdc0cfcd9 cvsserver doc: database generally can not be reproduced consistently
A regenerated git-cvsserver database is at risk of having different
CVS revision numbers from an incrementally updated database.  Mention
this in the the documentation, and remove an erroneous statement
to the contrary.

Signed-off-by: Matthew Ogilvie <mmogilvi_git@miniinfo.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-11-22 22:56:32 -08:00
Junio C Hamano
12fb25dce8 Git v1.6.6-rc0
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-11-22 19:17:32 -08:00
Junio C Hamano
f341feb86a Merge branch 'maint'
* maint:
  Documentation: undocument gc'd function graph_release()
2009-11-22 19:04:30 -08:00
Junio C Hamano
c1c30ab31d Merge git://git.bogomips.org/git-svn
* git://git.bogomips.org/git-svn:
  git svn: strip leading path when making empty dirs
  git svn: always reuse existing remotes on fetch
2009-11-22 19:01:15 -08:00
Eric Wong
9be30eed61 git svn: strip leading path when making empty dirs
Since unhandled.log stores paths relative to the repository
root, we need to strip out leading path components if the
directories we're tracking are not the repository root.

Reported-by: Björn Steinbrink
Signed-off-by: Eric Wong <normalperson@yhbt.net>
2009-11-22 18:15:42 -08:00
Junio C Hamano
0a8a38433d Merge branch 'th/maint-remote-update-help-string'
* th/maint-remote-update-help-string:
  Update 'git remote update' usage string to match man page.
2009-11-22 16:41:54 -08:00
Junio C Hamano
f81be17e1c Merge branch 'jn/faster-completion-startup'
* jn/faster-completion-startup:
  Speed up bash completion loading
2009-11-22 16:41:43 -08:00
Junio C Hamano
038188637e Merge branch 'rj/maint-t9700'
* rj/maint-t9700:
  t9700-perl-git.sh: Fix a test failure on Cygwin
2009-11-22 16:40:52 -08:00
Junio C Hamano
6d975c24a9 Merge branch 'ls/maint-mailinfo-no-inbody'
* ls/maint-mailinfo-no-inbody:
  git am/mailinfo: Don't look at in-body headers when rebasing
2009-11-22 16:40:26 -08:00
Junio C Hamano
4075d27a65 Merge branch 'mo/maint-crlf-doc'
* mo/maint-crlf-doc:
  core.autocrlf documentation: mention the crlf attribute
2009-11-22 16:29:57 -08:00
Junio C Hamano
f328f35880 Merge branch 'th/remote-usage'
* th/remote-usage:
  git remote: Separate usage strings for subcommands
2009-11-22 16:29:50 -08:00
Junio C Hamano
37e3b6104e Merge branch 'pb/maint-use-custom-perl'
* pb/maint-use-custom-perl:
  Make sure $PERL_PATH is defined when the test suite is run.
2009-11-22 16:28:46 -08:00
Junio C Hamano
eb2fc8f899 Merge branch 'mm/config-pathname-tilde-expand'
* mm/config-pathname-tilde-expand:
  Documentation: avoid xmlto input error
  expand_user_path: expand ~ to $HOME, not to the actual homedir.
  Expand ~ and ~user in core.excludesfile, commit.template
2009-11-22 16:28:38 -08:00
Junio C Hamano
3fa384d27e Merge branch 'bc/grep-i-F'
* bc/grep-i-F:
  grep: Allow case insensitive search of fixed-strings
2009-11-22 16:28:29 -08:00
Junio C Hamano
a1b01c45d5 Merge branch 'jk/maint-break-rename-reduce-memory'
* jk/maint-break-rename-reduce-memory:
  diffcore-rename: reduce memory footprint by freeing blob data early
  diffcore-break: save cnt_data for other phases
  diffcore-break: free filespec data as we go
2009-11-22 16:28:23 -08:00
Junio C Hamano
82f05d5dd7 Merge branch 'tc/format-attribute'
* tc/format-attribute:
  Check the format of more printf-type functions
2009-11-22 16:28:14 -08:00
Junio C Hamano
c50230f751 Merge branch 'tr/maint-merge-ours-clarification' (early part)
* 'tr/maint-merge-ours-clarification' (early part):
  rebase docs: clarify --merge and --strategy
  Documentation: clarify 'ours' merge strategy
2009-11-22 16:28:06 -08:00
René Scharfe
3288f20171 log --format: document %w
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-11-22 16:22:18 -08:00
René Scharfe
37bb5d7443 strbuf_add_wrapped_text(): factor out strbuf_add_indented_text()
Add a new helper function, strbuf_add_indented_text(), to indent text
without a width limit, and call it from strbuf_add_wrapped_text().  It
respects both indent (applied to the first line) and indent2 (applied to
the rest of the lines); indent2 was ignored by the indent-only path of
strbuf_add_wrapped_text() before the patch.

Two simple test cases are added, one exercising strbuf_add_wrapped_text()
and the other strbuf_add_indented_text().

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-11-22 16:22:02 -08:00
René Scharfe
b482759983 grep: unset GREP_OPTIONS before spawning external grep
While we're at it, also unset GREP_COLOR and GREP_COLORS in case colouring
is not enabled, to be on the safe side.  The presence of these variables
alone is not sufficient to trigger coloured output with GNU grep, but
other implementations may behave differently.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-11-22 16:20:59 -08:00
Björn Gustavsson
73a1d050c4 User Manual: Write "Git" instead of "GIT"
In the Table of Contents, there is a notable inconsistency:
first there is "GIT Glossary", followed by "Git Quick Reference"
on the very next line.

Running "grep -c" on user-manual.txt, I find 780 occurrrences of
"git", 37 occurrences of "Git", and 9 occurrences of "GIT".
In general, "git" is the preferred spelling, except at the
beginning of a sentence.

Therefore, change "GIT Glossary" to "Git Glossary" for consistency
with the rest of the document.

Looking at the other eight occurrences of "GIT" I found one other
occurrence that should be changed:

* The mention of "StGIT". Looking at the web pages for "Stacked Git"
  at http://www.procode.org/stgit, I only saw the spelling "StGit",
  except in http://wiki.procode.org/cgi-bin/wiki.cgi/StGIT_Tutorial,
  but that page was last updated in 2006.

The other seven occurrences should not be changed:

* Three occurrences were in the output of 'git show-branch' run
  on the git.git repository.

* One occurrence was in the output of 'git cat-file'.

* One occurrence was as part of the file name "GIT-VERSION-GEN".

* Two occurrences were in comments in scripts quoted in a description
  of Tony Luck's workflow.

Signed-off-by: Björn Gustavsson <bgustavsson@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-11-22 16:20:28 -08:00
Björn Gustavsson
625a860cb7 Fix truncated usage messages
The usage messages for some commands (such as 'git diff-tree')
are truncated because they don't fit in a fixed buffer of
1024 bytes.

It would be tempting to eliminate the buffer and the problem once
and for all by doing the output in three steps, but doing so could
(according to commit d048a96e) increase the likelyhood of messing
up the display.

So we just increase the size of the buffer.

Signed-off-by: Björn Gustavsson <bgustavsson@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-11-22 16:14:48 -08:00
Matthieu Moy
e63ec003b2 user-manual: Document that "git merge" doesn't like uncommited changes.
We explain the user why uncommited changes can be problematic with merge,
and point to "commit" and "stash" for the solution. While talking about
commited Vs uncommited changes, we also make it clear that the result of
a merge is normally commited.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-11-22 16:07:28 -08:00
Matthieu Moy
4c371f9127 merge-recursive: point the user to commit when file would be overwritten.
The commit-before-pull is well accepted in the DVCS community, but is
confusing some new users. This should get them back in the right way when
the problem occurs.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-11-22 16:07:27 -08:00
Eric Wong
4d0157d699 git svn: always reuse existing remotes on fetch
The internal no_reuse_existing flag is set to allow initializing
multiple remotes with the same URL, common with SVM users.

Unfortunately, this flag caused misbehavior when used
with the -R command-line flag for fetching.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
2009-11-22 12:54:59 -08:00
Junio C Hamano
4f333bc1d3 t9001: test --envelope-sender option of send-email
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-11-22 12:08:44 -08:00
Björn Gustavsson
c34ec65567 apply: Use the term "working tree" consistently
The documentation for 'git apply' uses both the terms
"work tree" and "working tree". Since the glossary uses
the term "working tree", change all occurrences of
"work tree" to "working tree".

Signed-off-by: Björn Gustavsson <bgustavsson@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-11-22 12:08:08 -08:00
Björn Gustavsson
f9821e2b21 apply: Format all options using back-quotes
Signed-off-by: Björn Gustavsson <bgustavsson@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-11-22 12:08:07 -08:00
Björn Gustavsson
38a39647b4 apply: apply works outside a repository
The documentation for 'git apply' talks about applying a
patch/diff to the index and to the working tree, which seems
to imply that it will not work outside a git repository.

Actually 'git patch' works outside a repository (which can
be useful especially for applying binary or rename patches that
the standard "patch" utility cannot handle), so the documentation
should mention it.

Thanks to Junio for suggesting better wording.

Signed-off-by: Björn Gustavsson <bgustavsson@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-11-22 12:08:04 -08:00
Björn Gustavsson
64485b4aba Clarify and correct -z
The description for -z is too vague and general for the
apply, diff*, and log commands.

Change the description of -z for 'git log' to note that
commits will be separated by NULs.

Change the description of -z for 'git diff*' and 'git apply'
to note that it applies to the --numstat option, and for
'git diff*' also for --raw option.

Also correct the description of the "munging" of pathanmes that
takes place in the absence of -z for the 'git diff*' and
'git apply' commands, namely that apart from the characters mentioned,
double quotes will also be escaped and that the pathname will be
enclosed in double quotes if any characters are escaped.

Signed-off-by: Björn Gustavsson <bgustavsson@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-11-22 12:08:00 -08:00
Junio C Hamano
0f7fb21a7a Documentation: avoid xmlto input error
Do not write literal "~/" or "~user" but use "{tilde}/" and "{tilde}user";
otherwise the text between them gets enclosed in
"<subscript>...</subscript>".

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-11-21 00:37:26 -08:00
Junio C Hamano
39add7a36f Merge branch 'jc/fix-tree-walk' (early part)
* 'jc/fix-tree-walk' (early part):
  unpack_callback(): use unpack_failed() consistently
  unpack-trees: typofix
  diff-lib.c: fix misleading comments on oneway_diff()
2009-11-20 23:55:50 -08:00
Junio C Hamano
885d492f69 Merge branch 'jh/notes' (early part)
* 'jh/notes' (early part):
  Add selftests verifying concatenation of multiple notes for the same commit
  Refactor notes code to concatenate multiple notes annotating the same object
  Add selftests verifying that we can parse notes trees with various fanouts
  Teach the notes lookup code to parse notes trees with various fanout schemes
  Teach notes code to free its internal data structures on request
  Add '%N'-format for pretty-printing commit notes
  Add flags to get_commit_notes() to control the format of the note string
  t3302-notes-index-expensive: Speed up create_repo()
  fast-import: Add support for importing commit notes
  Teach "-m <msg>" and "-F <file>" to "git notes edit"
  Add an expensive test for git-notes
  Speed up git notes lookup
  Add a script to edit/inspect notes
  Introduce commit notes

Conflicts:
	.gitignore
	Documentation/pretty-formats.txt
	pretty.c
2009-11-20 23:53:55 -08:00
Junio C Hamano
905bf7742c Merge branch 'sp/smart-http'
* sp/smart-http: (37 commits)
  http-backend: Let gcc check the format of more printf-type functions.
  http-backend: Fix access beyond end of string.
  http-backend: Fix bad treatment of uintmax_t in Content-Length
  t5551-http-fetch: Work around broken Accept header in libcurl
  t5551-http-fetch: Work around some libcurl versions
  http-backend: Protect GIT_PROJECT_ROOT from /../ requests
  Git-aware CGI to provide dumb HTTP transport
  http-backend: Test configuration options
  http-backend: Use http.getanyfile to disable dumb HTTP serving
  test smart http fetch and push
  http tests: use /dumb/ URL prefix
  set httpd port before sourcing lib-httpd
  t5540-http-push: remove redundant fetches
  Smart HTTP fetch: gzip requests
  Smart fetch over HTTP: client side
  Smart push over HTTP: client side
  Discover refs via smart HTTP server when available
  http-backend: more explict LocationMatch
  http-backend: add example for gitweb on same URL
  http-backend: use mod_alias instead of mod_rewrite
  ...

Conflicts:
	.gitignore
	remote-curl.c
2009-11-20 23:51:23 -08:00
Junio C Hamano
7dacc6c068 Merge branch 'bw/autoconf-more'
* bw/autoconf-more:
  configure: add settings for gitconfig, editor and pager
  configure: add macro to set arbitrary make variables
2009-11-20 23:48:57 -08:00
Junio C Hamano
376f39fbea Merge branch 'jn/editor-pager'
* jn/editor-pager:
  Provide a build time default-pager setting
  Provide a build time default-editor setting
  am -i, git-svn: use "git var GIT_PAGER"
  add -i, send-email, svn, p4, etc: use "git var GIT_EDITOR"
  Teach git var about GIT_PAGER
  Teach git var about GIT_EDITOR
  Suppress warnings from "git var -l"
  Do not use VISUAL editor on dumb terminals
  Handle more shell metacharacters in editor names
2009-11-20 23:48:52 -08:00
Junio C Hamano
7a4383cf13 Merge branch 'rj/cygwin-msvc'
* rj/cygwin-msvc:
  MSVC: Add support for building with NO_MMAP
  Makefile: keep MSVC and Cygwin configuration separate
2009-11-20 23:48:11 -08:00
Junio C Hamano
8102453318 Merge branch 'rj/maint-simplify-cygwin-makefile'
* rj/maint-simplify-cygwin-makefile:
  Makefile: merge two Cygwin configuration sections into one
2009-11-20 23:47:43 -08:00
Junio C Hamano
1a02a85d63 Merge branch 'bg/format-patch-doc-update'
* bg/format-patch-doc-update:
  format-patch: Add "--no-stat" as a synonym for "-p"
  format-patch documentation: Fix formatting
  format-patch documentation: Remove diff options that are not useful
  format-patch: Always generate a patch
2009-11-20 23:47:10 -08:00
Junio C Hamano
aa437791d8 Merge branch 'tr/filter-branch'
* tr/filter-branch:
  filter-branch: nearest-ancestor rewriting outside subdir filter
  filter-branch: stop special-casing $filter_subdir argument
2009-11-20 23:46:14 -08:00