Commit graph

18964 commits

Author SHA1 Message Date
Stephen Boyd e064c170b4 git-sh-setup: introduce say() for quiet options
Scripts should use say() when they want to output non-error messages.
This function helps future script writers easily implement a quiet
option by setting GIT_QUIET to enable suppression of non-error messages.

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-18 09:50:31 -07:00
Stephen Boyd 3ddd170323 am: suppress apply errors when using 3-way
git-am with 3-way outputs errors when applying, even though the
3-way will usually be successful. We suppress these errors from
git-apply because they are not "true" errors until the 3-way has been
attempted.

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-18 09:50:25 -07:00
Stephen Boyd b3c32ead20 t4150: test applying with a newline in subject
Commit 4b7cc26 (git-am: use printf instead of echo on user-supplied
strings, 2007-05-25) fixed a bug where subjects with newlines would
cause git-am to echo multiple lines when it says "Applying: <subject>".

This test ensures that fix stays valid.

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-18 09:50:14 -07:00
Junio C Hamano 4f4fa9c228 Merge branch 'maint'
* maint:
  git-rerere.txt: grammatical fixups and cleanups
2009-06-13 17:10:18 -07:00
Junio C Hamano 50a991ec46 Merge branch 'maint-1.6.2' into maint
* maint-1.6.2:
  git-rerere.txt: grammatical fixups and cleanups
2009-06-13 17:10:08 -07:00
Junio C Hamano 9b7dc71835 Merge branch 'maint-1.6.1' into maint-1.6.2
* maint-1.6.1:
  git-rerere.txt: grammatical fixups and cleanups
2009-06-13 17:09:50 -07:00
Junio C Hamano dfe50511c7 Merge branch 'maint-1.6.0' into maint-1.6.1
* maint-1.6.0:
  git-rerere.txt: grammatical fixups and cleanups
  http-push.c::remove_locks(): fix use after free
2009-06-13 17:09:45 -07:00
Junio C Hamano 08ba24898a Merge branch 'mh/fix-send-email-threaded'
* mh/fix-send-email-threaded:
  send-email: fix a typo in a comment
  send-email: fix threaded mails without chain-reply-to
  add a test for git-send-email for threaded mails without chain-reply-to
  doc/send-email: clarify the behavior of --in-reply-to with --no-thread
  send-email: fix non-threaded mails
  add a test for git-send-email for non-threaded mails
2009-06-13 12:55:50 -07:00
Junio C Hamano e2486193c5 Merge branch 'rc/http-push'
* rc/http-push: (22 commits)
  http*: add helper methods for fetching objects (loose)
  http*: add helper methods for fetching packs
  http: use new http API in fetch_index()
  http*: add http_get_info_packs
  http-push.c::fetch_symref(): use the new http API
  http-push.c::remote_exists(): use the new http API
  http.c::http_fetch_ref(): use the new http API
  transport.c::get_refs_via_curl(): use the new http API
  http.c: new functions for the http API
  http: create function end_url_with_slash
  http*: move common variables and macros to http.[ch]
  transport.c::get_refs_via_curl(): do not leak refs_url
  Don't expect verify_pack() callers to set pack_size
  http-push: do not SEGV after fetching a bad pack idx file
  http*: copy string returned by sha1_to_hex
  http-walker: verify remote packs
  http-push, http-walker: style fixes
  t5550-http-fetch: test fetching of packed objects
  http-push: fix missing "#ifdef USE_CURL_MULTI" around "is_running_queue"
  http-push: send out fetch requests on queue
  ...
2009-06-13 12:53:19 -07:00
Junio C Hamano cec3f989da Merge branch 'cc/bisect' (early part)
* 'cc/bisect' (early part):
  t6030: test skipping away from an already skipped commit
  bisect: when skipping, choose a commit away from a skipped commit
  bisect: add parameters to "filter_skipped"
  bisect: display first bad commit without forking a new process
  bisect: drop unparse_commit() and use clear_commit_marks()
2009-06-13 12:53:06 -07:00
Junio C Hamano fa71e80525 Merge branch 'rc/maint-http-local-slot-fix'
* rc/maint-http-local-slot-fix:
  http*: cleanup slot->local after fclose
2009-06-13 12:51:09 -07:00
Junio C Hamano 95ad2a65fb Merge branch 'sp/msysgit'
* sp/msysgit:
  compat/ has subdirectories: do not omit them in 'make clean'
  Fix typo in nedmalloc warning fix
  MinGW: Teach Makefile to detect msysgit and apply specific settings
  Fix warnings in nedmalloc when compiling with GCC 4.4.0
  Add custom memory allocator to MinGW and MacOS builds
  MinGW readdir reimplementation to support d_type
  connect.c: Support PuTTY plink and TortoisePlink as SSH on Windows
  git: browsing paths with spaces when using the start command
  MinGW: fix warning about implicit declaration of _getch()
  test-chmtime: work around Windows limitation
  Work around a regression in Windows 7, causing erase_in_line() to crash sometimes
  Quiet make: do not leave Windows behind
  MinGW: GCC >= 4 does not need SNPRINTF_SIZE_CORR anymore

Conflicts:
	Makefile
2009-06-13 12:50:42 -07:00
Junio C Hamano 0a17b2cd7e Merge branch 'cb/maint-no-double-merge'
* cb/maint-no-double-merge:
  refuse to merge during a merge
2009-06-13 12:50:22 -07:00
Junio C Hamano 7d40f89137 Merge branch 'ph/submodule-rebase' (early part)
* 'ph/submodule-rebase' (early part):
  Rename submodule.<name>.rebase to submodule.<name>.update
  git-submodule: add support for --rebase.

Conflicts:
	Documentation/git-submodule.txt
	git-submodule.sh
2009-06-13 12:49:50 -07:00
Junio C Hamano 436f66b7e9 Merge branch 'bc/solaris'
* bc/solaris:
  configure: test whether -lresolv is needed
  Makefile: insert SANE_TOOL_PATH to PATH before /bin or /usr/bin
  git-compat-util.h: avoid using c99 flex array feature with Sun compiler 5.8
  Makefile: add section for SunOS 5.7
  Makefile: introduce SANE_TOOL_PATH for prepending required elements to PATH
  Makefile: define __sun__ on SunOS
  git-compat-util.h: tweak the way _XOPEN_SOURCE is set on Solaris
  On Solaris choose the OLD_ICONV iconv() declaration based on the UNIX spec
  Makefile: add NEEDS_RESOLV to optionally add -lresolv to compile arguments
  Makefile: use /usr/ucb/install on SunOS platforms rather than ginstall

Conflicts:
	Makefile
2009-06-13 12:48:34 -07:00
Junio C Hamano 57c57a97e1 Merge branch 'cb/match_refs_internal_tail'
* cb/match_refs_internal_tail:
  match_refs: search ref list tail internally
2009-06-13 12:47:52 -07:00
Junio C Hamano 49c7e4643b Merge branch 'nw/maint-cvsexportcommit'
* nw/maint-cvsexportcommit:
  git-cvsexportcommit can't commit files which have been removed from CVS
2009-06-13 12:47:47 -07:00
Junio C Hamano 1bbc820414 Merge branch 'da/araxis-mergetool'
* da/araxis-mergetool:
  mergetool--lib: add support for araxis merge
2009-06-13 12:47:08 -07:00
Stephen Boyd c97038d1cf git-rerere.txt: grammatical fixups and cleanups
Rewrite the gc section using unresolved and resolved instead of "not
recorded". Add plurals and missing articles. Make some sentences have
consistent tense. Try and be more active by removing "that" and
simplifying sentences.

The terms "hand-resolve" and "hand resolve" were used, so just use "hand
resolve" to be more consistent.

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-13 12:44:41 -07:00
Junio C Hamano 95a877a34c Merge branch 'mh/maint-fix-send-email-threaded' into mh/fix-send-email-threaded
* mh/maint-fix-send-email-threaded:
  doc/send-email: clarify the behavior of --in-reply-to with --no-thread
  send-email: fix non-threaded mails
  add a test for git-send-email for non-threaded mails

Conflicts:
	git-send-email.perl
	t/t9001-send-email.sh
2009-06-12 09:23:43 -07:00
Markus Heidelberg a1b5b37199 send-email: fix a typo in a comment
Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-12 09:22:17 -07:00
Markus Heidelberg f74fe34b96 send-email: fix threaded mails without chain-reply-to
An earlier commit 15da108 ("send-email: 'References:' should only
reference what is sent", 2009-04-13) broke logic to set up threading
information for the next message by rewriting "!" to "not" without
understanding the precedence rules of the language.

Namely,

    ! defined $reply_to || length($reply_to) == 0

was changed to

    not defined $reply_to || length($reply_to) == 0

which is

    not (defined $reply_to || length($reply_to) == 0)

and different from what was intended, which is

    (not defined $reply_to) || (length($reply_to) == 0)

Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-12 09:22:15 -07:00
Markus Heidelberg d67114a5f3 add a test for git-send-email for threaded mails without chain-reply-to
Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-12 09:22:14 -07:00
Markus Heidelberg 0fd41f2d66 doc/send-email: clarify the behavior of --in-reply-to with --no-thread
Also remove the argument from --[no-]chain-reply-to.

Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-12 09:20:22 -07:00
Markus Heidelberg 5e9758e296 send-email: fix non-threaded mails
After commit 3e0c4ff (send-email: respect in-reply-to regardless of
threading, 2009-03-01) the variable $thread was only used for prompting
for an "In-Reply-To", but not for controlling whether the "In-Reply-To"
and "References" fields should be written into the email.

Thus these fields were always used beginning with the second mail and it
was not possible to produce non-threaded mails anymore.

However, a later commit 15da108 ("send-email: 'References:' should only
reference what is sent", 2009-04-13) introduced a regression with the
side effect to make non-threaded mails possible again, but only when
--no-chain-reply-to was used.

Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-12 09:20:21 -07:00
Markus Heidelberg 32ae83194b add a test for git-send-email for non-threaded mails
Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-12 09:20:18 -07:00
Junio C Hamano b8364903c3 Merge branch 'maint'
* maint:
  Documentation: git-send-mail can take rev-list arg to drive format-patch
  rebase--interactive: remote stray closing parenthesis
2009-06-11 23:35:46 -07:00
Paolo Bonzini 94af7c31a5 Documentation: git-send-mail can take rev-list arg to drive format-patch
The git-send-email docs do not mention except in the usage lines
the combined patch formatting/sending ability of git-send-email.
This patch expands on the possible arguments to git-send-email
and explains the meaning of the rev-list argument.

Signed-off-by: Paolo Bonzini <bonzini@gnu.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-11 23:35:05 -07:00
Johannes Sixt 021fcd99bd compat/ has subdirectories: do not omit them in 'make clean'
[1. text/plain]

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-11 14:19:10 -07:00
Johannes Sixt 2ae8239d03 Fix typo in nedmalloc warning fix
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-11 14:18:52 -07:00
Junio C Hamano a0c0447b8e Merge branch 'uk/maint-1.5.3-rebase-i-reflog' into maint
* uk/maint-1.5.3-rebase-i-reflog:
  rebase--interactive: remote stray closing parenthesis

Conflicts:
	git-rebase--interactive.sh
2009-06-11 14:14:00 -07:00
Uwe Kleine-König 795cbe938f rebase--interactive: remote stray closing parenthesis
it was introduced in 68a163c9b4

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Jöhännës "Dschö" Schindëlin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-11 14:01:15 -07:00
Pierre Habouzit cb9d398c35 parse-options: add parse_options_check to validate option specs.
It only searches for now for the dreaded LASTARG_DEFAULT | OPTARG
combination, but can be extended to check for any other forbidden
combination.

Options are checked each time we call parse_options_start.

Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-10 08:41:03 -07:00
Ralf Wildenhues 8fccb009fa configure: test whether -lresolv is needed
Check if -lresolv is needed for hstrerror; set NEEDS_RESOLV
accordingly, and substitute in config.mak.in.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-10 00:08:07 -07:00
Junio C Hamano 61dbb3c441 Makefile: insert SANE_TOOL_PATH to PATH before /bin or /usr/bin
In an earlier patch, we introduced SANE_TOOL_PATH that is prepended to
user's PATH.  This had an unintended consequence of overriding user's
private binary directory that typically comes earlier in the PATH to holds
even saner commands than whatever comes with the system.

For example, a user may have ~/bin that is early in the path and contains
a shell script "vi" that launches system's /bin/vi with specific options.
Prepending SANE_TOOL_PATH to the PATH that happens to have "vi" in it
defeats such customization.

This fixes the issue by inserting SANE_TOOL_PATH just before /bin or
/usr/bin appears on the PATH.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-10 00:02:20 -07:00
Michael J Gruber 9a8531eeba git-repack.txt: Clarify implications of -a for dumb protocols
The current text makes some users feel uneasy, worrying whether
'-a' could lead to corrupt repositories. Clarify that '-a'
may lead to performance issues only for dumb protocols.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Helped-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-09 23:47:49 -07:00
Junio C Hamano f4f78e668d Merge branch 'maint'
* maint:
  diff.c: plug a memory leak in an error path
  fetch-pack: close output channel after sideband demultiplexer terminates
  builtin-remote: Make "remote show" display all urls
2009-06-09 00:29:36 -07:00
SZEDER Gábor 8513c54b2a bash: add support for 'git stash pop --index' option
Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-09 00:18:32 -07:00
SZEDER Gábor f39d6ee2aa Documentation: mention 'git stash pop --index' option explicitly
'git stash pop' supports the '--index' option since its initial
implementation (bd56ff54, git-stash: add new 'pop' subcommand,
2008-02-22), but its documentation does not mention it explicitly.
Moreover, both the usage shown by 'git stash -h' and the synopsis
section in the man page imply that 'git stash pop' does not have an
'--index' option.

First, this patch corrects the usage and the synopsis section.

Second, the patch moves the description of the '--index' option to the
'git stash pop' section in the documentation, and refers to it from
the 'git stash apply' section.  This way it follows the intentions of
commit d1836637 (Documentation: teach stash/pop workflow instead of
stash/apply, 2009-05-28), as all 'git stash pop'-related documentation
will be in one place without references to 'git stash apply'.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-09 00:18:24 -07:00
Johannes Sixt 4e2715fb98 Simplify some 'fprintf(stderr); return -1;' by using 'return error()'
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-09 00:15:57 -07:00
Johannes Sixt 0077138cd9 Simplify some instances of run_command() by using run_command_v_opt().
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-09 00:15:57 -07:00
Stephen Boyd e169b97459 show-branch: don't use LASTARG_DEFAULT with OPTARG
5734365 (show-branch: migrate to parse-options API 2009-05-21)
incorrectly set the --more option's flags to be
PARSE_OPT_LASTARG_DEFAULT and PARSE_OPT_OPTARG. These two flags
shouldn't be used together. An option taking a default should just set
the default value desired and parse options will take care of the rest.

Update the header comment to better convey this information.

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Acked-by: René Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-09 00:15:57 -07:00
Brandon Casey d1fff6fce0 send-email: use UTF-8 rather than utf-8 for consistency
The rest of the git source has been converted to use upper-case character
encoding names to assist older platforms.  The charset attribute of MIME
is defined to be case-insensitive, but older platforms may still have an
easier time dealing with upper-case rather than lower-case.  So do so for
send-email too.

Update t9001 to handle the changes.

Signed-off-by: Brandon Casey <drafnel@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-09 00:15:57 -07:00
Brandon Casey a3a8262bf6 git-send-email.perl: improve detection of MIME encoded-words
According to rfc2047, an encoded word has the following form:

   encoded-word = "=?" charset "?" encoding "?" encoded-text "?="

   charset = token

   encoding = token

   token = <Any CHAR except SPACE, CTLs, and especials>

   especials = "(" / ")" / "<" / ">" / "@" / "," / ";" / ":" / "
               <"> / "/" / "[" / "]" / "?" / "." / "="

   encoded-text = <Any printable ASCII character other than "?"
                     or SPACE>

And rfc822 defines CHARs and CTLs as:

    CHAR = <any ASCII character> ; (  0-177,  0.-127.)

    CTL = <any ASCII control     ; (  0- 37,  0.- 31.)
           character and DEL>    ; (    177,     127.)

The original code only detected rfc2047 encoded strings when the charset
was UTF-8.  This patch generalizes the matching expression and breaks the
check for an rfc2047 encoded string into its own function.  There's no real
functional change, since any properly rfc2047 encoded string would have
fallen through the remaining 'if' statements and been returned unchanged.

Signed-off-by: Brandon Casey <drafnel@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-09 00:15:57 -07:00
Johannes Sixt 802f9c9cb2 diff.c: plug a memory leak in an error path
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-08 21:19:26 -07:00
Johannes Sixt 3ef67cf250 fetch-pack: close output channel after sideband demultiplexer terminates
fetch-pack runs the sideband demultiplexer using start_async(). This
facility requires that the asynchronously executed function closes the
output file descriptor (see Documentation/technical/api-run-command.txt).
But the sideband demultiplexer did not do that. This fixes it.

In certain error situations this could lock up a fetch operation on
Windows because the asynchronous function is run in a thread; by not
closing the output fd the reading end never got EOF and waited for more
data indefinitely. On Unix this is not a problem because the asynchronous
function is run in a separate process, which exits after the function ends
and so implicitly closes the output.

Since the pack that is sent over the wire encodes the number of objects in
the stream, during normal operation the reading end knows when the stream
ends and terminates by itself, and does not lock up.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-08 21:18:41 -07:00
Brandon Casey 203ee91fd2 git-compat-util.h: avoid using c99 flex array feature with Sun compiler 5.8
The Sun c99 compiler as recent as version 5.8 Patch 121016-06 2007/08/01
produces an error when compiling diff-delta.c.  This source file #includes
the delta.h header file which pre-declares a struct which is later defined
to contain a flex array member.  The Sun c99 compiler fails to compile
diff-delta.c and gives the following error:

  "diff-delta.c", line 314: identifier redeclared: create_delta
          current : function(pointer to const struct delta_index {unsigned long memsize, pointer to const void src_buf, unsigned long src_size, unsigned int hash_mask, array[-1] of pointer to struct index_entry {..} hash}, pointer to const void, unsigned long, pointer to unsigned long, unsigned long) returning pointer to void
          previous: function(pointer to const struct delta_index {unsigned long memsize, pointer to const void src_buf, unsigned long src_size, unsigned int hash_mask, array[-1] of pointer to struct index_entry {..} hash}, pointer to const void, unsigned long, pointer to unsigned long, unsigned long) returning pointer to void : "delta.h", line 44
  c99: acomp failed for diff-delta.c

So, avoid using this c99 feature when compiling with the Sun c compilers
version 5.8 and older (the most recent version tested).

Signed-off-by: Brandon Casey <drafnel@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-08 21:16:18 -07:00
Michael J Gruber 956d27a872 builtin-remote: Make "remote show" display all urls
Currently, "git remote -v" lists all urls whereas "git remote show
$remote" shows only the first. Make it so that both show all.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-08 15:01:12 -07:00
Steffen Prohaska 48c46f1a14 MinGW: Teach Makefile to detect msysgit and apply specific settings
This commit changes handling of the msysgit specific settings, so
that they can be applied to official git.git.  Some msysgit
settings differ from the standard MinGW settings.  We move them
into an ifndef block that is only evaluated if a file
THIS_IS_MSYSGIT is present in the parent directory, which is the
case for an msysgit working environment.  The tag file is unlikely
to be present accidentally.

Signed-off-by: Steffen Prohaska <prohaska@zib.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-08 09:44:04 -07:00
Johannes Schindelin a21077e75f Fix warnings in nedmalloc when compiling with GCC 4.4.0
Nedmalloc's source code has a cute #define construct to avoid inserting
an if() statement, because that might interact badly with enclosing if()
statements.  However, GCC > 4 complains with a "warning: value computed
is not used".  So we cast the result to "void".

GCC also does not understand the Visual C++ specific pragmas, so we need
to disable them for MinGW.

We need to include malloc.h on Windows even if we happen to compile the
stuff as a MinGW program.  Otherwise the function declaration of alloca()
is missing.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-08 09:43:37 -07:00