gitweb.git
Merge branch 'sb/maint-1.6.0-add-config-fix'Junio C Hamano Sun, 21 Jun 2009 04:46:38 +0000 (21:46 -0700)

Merge branch 'sb/maint-1.6.0-add-config-fix'

* sb/maint-1.6.0-add-config-fix:
add: allow configurations to be overriden by command line
use xstrdup, not strdup in ll-merge.c

Conflicts:
builtin-add.c

Merge branch 'lt/maint-unsigned-left-shift'Junio C Hamano Sun, 21 Jun 2009 04:46:10 +0000 (21:46 -0700)

Merge branch 'lt/maint-unsigned-left-shift'

* lt/maint-unsigned-left-shift:
Fix big left-shifts of unsigned char

Merge git://git.kernel.org/pub/scm/gitk/gitkJunio C Hamano Sat, 20 Jun 2009 18:54:37 +0000 (11:54 -0700)

Merge git://git.kernel.org/pub/scm/gitk/gitk

* git://git.kernel.org/pub/scm/gitk/gitk:
gitk: Allow diff view without context lines
gitk: Add another string to translation
gitk: Add option 'Simple history' to the options menu
gitk: Handle msysGit version during version comparisons
gitk: Make more options easily accessible from Edit View dialog
gitk: Check git version before using --textconv flag
gitk: Use --textconv to generate diff text
gitk: Update German translation.

add: allow configurations to be overriden by command... Stephen Boyd Thu, 18 Jun 2009 09:17:54 +0000 (02:17 -0700)

add: allow configurations to be overriden by command line

Don't call git_config after parsing the command line options, otherwise
the config settings will override any settings made by the command line.

This can be seen by setting add.ignore_errors and then specifying
--no-ignore-errors when using git-add.

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint'Junio C Hamano Thu, 18 Jun 2009 17:39:17 +0000 (10:39 -0700)

Merge branch 'maint'

* maint:
http.c: fix compiling with libcurl 7.9.2
import-tars: support symlinks
pull, rebase: simplify to use die()

Merge branch 'sb/parse-options-integer'Junio C Hamano Thu, 18 Jun 2009 17:36:22 +0000 (10:36 -0700)

Merge branch 'sb/parse-options-integer'

* sb/parse-options-integer:
parse-options: simplify usage argh handling
parse-options: make OPT_INTEGER's argh explicit

Merge branch 'ak/maint-for-each-ref-no-lookup'Junio C Hamano Thu, 18 Jun 2009 17:33:09 +0000 (10:33 -0700)

Merge branch 'ak/maint-for-each-ref-no-lookup'

* ak/maint-for-each-ref-no-lookup:
for-each-ref: Do not lookup objects when they will not be used

Add -k option to cvsexportcommit to revert expanded... Alex Bennée Tue, 16 Jun 2009 14:21:04 +0000 (15:21 +0100)

Add -k option to cvsexportcommit to revert expanded CVS keywords in CVS working tree before applying commit patch

Depending on how your CVS->GIT conversion went you will have some
unexpanded CVS keywords in your GIT repo. If any of your git commits
touch these lines then the patch application will fail. This patch
addresses that by adding an option that will revert and expanded CVS
keywords to files in the working CVS directory that are affected by
the commit being applied.

Signed-off-by: Alex Bennée <alex@bennee.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

http.c: fix compiling with libcurl 7.9.2Mark Lodato Mon, 15 Jun 2009 02:39:00 +0000 (22:39 -0400)

http.c: fix compiling with libcurl 7.9.2

Change the minimimum required libcurl version for the http.sslKey option
to 7.9.3. Previously, preprocessor macros checked for >= 7.9.2, which
is incorrect because CURLOPT_SSLKEY was introduced in 7.9.3. This now
allows git to compile with libcurl 7.9.2.

Signed-off-by: Mark Lodato <lodatom@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

import-tars: support symlinksJohannes Schindelin Wed, 17 Jun 2009 12:49:39 +0000 (14:49 +0200)

import-tars: support symlinks

Without this patch, symbolic links are turned into empty files.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Fix big left-shifts of unsigned charLinus Torvalds Thu, 18 Jun 2009 00:22:27 +0000 (17:22 -0700)

Fix big left-shifts of unsigned char

Shifting 'unsigned char' or 'unsigned short' left can result in sign
extension errors, since the C integer promotion rules means that the
unsigned char/short will get implicitly promoted to a signed 'int' due to
the shift (or due to other operations).

This normally doesn't matter, but if you shift things up sufficiently, it
will now set the sign bit in 'int', and a subsequent cast to a bigger type
(eg 'long' or 'unsigned long') will now sign-extend the value despite the
original expression being unsigned.

One example of this would be something like

unsigned long size;
unsigned char c;

size += c << 24;

where despite all the variables being unsigned, 'c << 24' ends up being a
signed entity, and will get sign-extended when then doing the addition in
an 'unsigned long' type.

Since git uses 'unsigned char' pointers extensively, we actually have this
bug in a couple of places.

I may have missed some, but this is the result of looking at

git grep '[^0-9 ][ ]*<<[ ][a-z]' -- '*.c' '*.h'
git grep '<<[ ]*24'

which catches at least the common byte cases (shifting variables by a
variable amount, and shifting by 24 bits).

I also grepped for just 'unsigned char' variables in general, and
converted the ones that most obviously ended up getting implicitly cast
immediately anyway (eg hash_name(), encode_85()).

In addition to just avoiding 'unsigned char', this patch also tries to use
a common idiom for the delta header size thing. We had three different
variations on it: "& 0x7fUL" in one place (getting the sign extension
right), and "& ~0x80" and "& 0x7f" in two other places (not getting it
right). Apart from making them all just avoid using "unsigned char" at
all, I also unified them to then use a simple "& 0x7f".

I considered making a sparse extension which warns about doing implicit
casts from unsigned types to signed types, but it gets rather complex very
quickly, so this is just a hack.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

pull, rebase: simplify to use die()Stephen Boyd Sun, 14 Jun 2009 23:08:56 +0000 (16:08 -0700)

pull, rebase: simplify to use die()

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

use xstrdup, not strdup in ll-merge.cJim Meyering Sun, 14 Jun 2009 19:47:54 +0000 (21:47 +0200)

use xstrdup, not strdup in ll-merge.c

Otherwise, a fluky allocation failure would cause merge
configuration settings to be silently ignored.

Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint'Junio C Hamano Sun, 14 Jun 2009 00:10:18 +0000 (17:10 -0700)

Merge branch 'maint'

* maint:
git-rerere.txt: grammatical fixups and cleanups

Merge branch 'maint-1.6.2' into maintJunio C Hamano Sun, 14 Jun 2009 00:10:08 +0000 (17:10 -0700)

Merge branch 'maint-1.6.2' into maint

* maint-1.6.2:
git-rerere.txt: grammatical fixups and cleanups

Merge branch 'maint-1.6.1' into maint-1.6.2Junio C Hamano Sun, 14 Jun 2009 00:09:50 +0000 (17:09 -0700)

Merge branch 'maint-1.6.1' into maint-1.6.2

* maint-1.6.1:
git-rerere.txt: grammatical fixups and cleanups

Merge branch 'maint-1.6.0' into maint-1.6.1Junio C Hamano Sun, 14 Jun 2009 00:09:45 +0000 (17:09 -0700)

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

Merge branch 'mh/fix-send-email-threaded'Junio C Hamano Sat, 13 Jun 2009 19:55:50 +0000 (12:55 -0700)

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

Merge branch 'rc/http-push'Junio C Hamano Sat, 13 Jun 2009 19:53:19 +0000 (12:53 -0700)

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
...

Merge branch 'cc/bisect' (early part)Junio C Hamano Sat, 13 Jun 2009 19:53:06 +0000 (12:53 -0700)

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()

Merge branch 'rc/maint-http-local-slot-fix'Junio C Hamano Sat, 13 Jun 2009 19:51:09 +0000 (12:51 -0700)

Merge branch 'rc/maint-http-local-slot-fix'

* rc/maint-http-local-slot-fix:
http*: cleanup slot->local after fclose

Merge branch 'sp/msysgit'Junio C Hamano Sat, 13 Jun 2009 19:50:42 +0000 (12:50 -0700)

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

Merge branch 'cb/maint-no-double-merge'Junio C Hamano Sat, 13 Jun 2009 19:50:22 +0000 (12:50 -0700)

Merge branch 'cb/maint-no-double-merge'

* cb/maint-no-double-merge:
refuse to merge during a merge

Merge branch 'ph/submodule-rebase' (early part)Junio C Hamano Sat, 13 Jun 2009 19:49:50 +0000 (12:49 -0700)

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

Merge branch 'bc/solaris'Junio C Hamano Sat, 13 Jun 2009 19:48:34 +0000 (12:48 -0700)

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

Merge branch 'cb/match_refs_internal_tail'Junio C Hamano Sat, 13 Jun 2009 19:47:52 +0000 (12:47 -0700)

Merge branch 'cb/match_refs_internal_tail'

* cb/match_refs_internal_tail:
match_refs: search ref list tail internally

Merge branch 'nw/maint-cvsexportcommit'Junio C Hamano Sat, 13 Jun 2009 19:47:47 +0000 (12:47 -0700)

Merge branch 'nw/maint-cvsexportcommit'

* nw/maint-cvsexportcommit:
git-cvsexportcommit can't commit files which have been removed from CVS

Merge branch 'da/araxis-mergetool'Junio C Hamano Sat, 13 Jun 2009 19:47:08 +0000 (12:47 -0700)

Merge branch 'da/araxis-mergetool'

* da/araxis-mergetool:
mergetool--lib: add support for araxis merge

git-rerere.txt: grammatical fixups and cleanupsStephen Boyd Sat, 13 Jun 2009 18:20:00 +0000 (11:20 -0700)

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>

Merge branch 'mh/maint-fix-send-email-threaded' into... Junio C Hamano Fri, 12 Jun 2009 16:23:43 +0000 (09:23 -0700)

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

send-email: fix a typo in a commentMarkus Heidelberg Fri, 12 Jun 2009 10:51:42 +0000 (12:51 +0200)

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>

send-email: fix threaded mails without chain-reply-toMarkus Heidelberg Fri, 12 Jun 2009 10:51:41 +0000 (12:51 +0200)

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>

add a test for git-send-email for threaded mails withou... Markus Heidelberg Fri, 12 Jun 2009 10:51:40 +0000 (12:51 +0200)

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>

doc/send-email: clarify the behavior of --in-reply... Markus Heidelberg Fri, 12 Jun 2009 10:51:39 +0000 (12:51 +0200)

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>

send-email: fix non-threaded mailsMarkus Heidelberg Fri, 12 Jun 2009 10:51:38 +0000 (12:51 +0200)

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>

add a test for git-send-email for non-threaded mailsMarkus Heidelberg Fri, 12 Jun 2009 10:51:37 +0000 (12:51 +0200)

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>

Merge branch 'maint'Junio C Hamano Fri, 12 Jun 2009 06:35:46 +0000 (23:35 -0700)

Merge branch 'maint'

* maint:
Documentation: git-send-mail can take rev-list arg to drive format-patch
rebase--interactive: remote stray closing parenthesis

Documentation: git-send-mail can take rev-list arg... Paolo Bonzini Thu, 11 Jun 2009 07:30:27 +0000 (09:30 +0200)

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>

compat/ has subdirectories: do not omit them in 'make... Johannes Sixt Thu, 11 Jun 2009 20:56:12 +0000 (22:56 +0200)

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>

Fix typo in nedmalloc warning fixJohannes Sixt Thu, 11 Jun 2009 20:52:56 +0000 (22:52 +0200)

Fix typo in nedmalloc warning fix

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'uk/maint-1.5.3-rebase-i-reflog' into... Junio C Hamano Thu, 11 Jun 2009 21:14:00 +0000 (14:14 -0700)

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

rebase--interactive: remote stray closing parenthesisUwe Kleine-König Thu, 11 Jun 2009 20:27:55 +0000 (22:27 +0200)

rebase--interactive: remote stray closing parenthesis

it was introduced in 68a163c9b483ae352fcfee8c4505d113213daa73

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>

parse-options: add parse_options_check to validate... Pierre Habouzit Tue, 9 Jun 2009 08:23:44 +0000 (10:23 +0200)

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>

configure: test whether -lresolv is neededRalf Wildenhues Sun, 7 Jun 2009 05:40:29 +0000 (07:40 +0200)

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>

Makefile: insert SANE_TOOL_PATH to PATH before /bin... Junio C Hamano Mon, 8 Jun 2009 16:41:49 +0000 (09:41 -0700)

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>

git-repack.txt: Clarify implications of -a for dumb... Michael J Gruber Tue, 9 Jun 2009 16:15:47 +0000 (18:15 +0200)

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>

Merge branch 'maint'Junio C Hamano Tue, 9 Jun 2009 07:29:36 +0000 (00:29 -0700)

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

bash: add support for 'git stash pop --index' optionSZEDER Gábor Mon, 8 Jun 2009 22:57:39 +0000 (00:57 +0200)

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>

Documentation: mention 'git stash pop --index' option... SZEDER Gábor Mon, 8 Jun 2009 22:57:06 +0000 (00:57 +0200)

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>

Simplify some 'fprintf(stderr); return -1;' by using... Johannes Sixt Mon, 8 Jun 2009 20:34:31 +0000 (22:34 +0200)

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>

Simplify some instances of run_command() by using run_c... Johannes Sixt Mon, 8 Jun 2009 20:34:29 +0000 (22:34 +0200)

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>

show-branch: don't use LASTARG_DEFAULT with OPTARGStephen Boyd Sun, 7 Jun 2009 23:39:15 +0000 (16:39 -0700)

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>

send-email: use UTF-8 rather than utf-8 for consistencyBrandon Casey Sun, 7 Jun 2009 01:12:31 +0000 (20:12 -0500)

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>

git-send-email.perl: improve detection of MIME encoded... Brandon Casey Mon, 8 Jun 2009 00:25:58 +0000 (19:25 -0500)

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>

diff.c: plug a memory leak in an error pathJohannes Sixt Mon, 8 Jun 2009 20:34:30 +0000 (22:34 +0200)

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>

fetch-pack: close output channel after sideband demulti... Johannes Sixt Mon, 8 Jun 2009 08:51:22 +0000 (10:51 +0200)

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>

git-compat-util.h: avoid using c99 flex array feature... Brandon Casey Mon, 8 Jun 2009 23:53:48 +0000 (18:53 -0500)

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>

builtin-remote: Make "remote show" display all urlsMichael J Gruber Sat, 6 Jun 2009 15:16:30 +0000 (17:16 +0200)

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>

MinGW: Teach Makefile to detect msysgit and apply speci... Steffen Prohaska Sun, 31 May 2009 16:15:25 +0000 (18:15 +0200)

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>

Fix warnings in nedmalloc when compiling with GCC 4.4.0Johannes Schindelin Mon, 8 Jun 2009 14:46:49 +0000 (16:46 +0200)

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>

symlinks.c: small style cleanupKjetil Barvik Sun, 7 Jun 2009 11:33:05 +0000 (13:33 +0200)

symlinks.c: small style cleanup

Add {}-braces around an else-part, where the if-part already has
{}-braces.

And, also remove some unnecessary "return;"-statements at the end of
"void foo()"-functions.

Signed-off-by: Kjetil Barvik <barvik@broadpark.no>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Makefile: test-parse-options depends on parse-options.hJunio C Hamano Sun, 7 Jun 2009 08:34:51 +0000 (01:34 -0700)

Makefile: test-parse-options depends on parse-options.h

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint'Junio C Hamano Sun, 7 Jun 2009 06:49:28 +0000 (23:49 -0700)

Merge branch 'maint'

* maint:
Documentation: refer to gitworkflows(7) from tutorial and git(1)
daemon: Strictly parse the "extra arg" part of the command

Documentation: refer to gitworkflows(7) from tutorial... Thomas Rast Sat, 6 Jun 2009 13:11:07 +0000 (15:11 +0200)

Documentation: refer to gitworkflows(7) from tutorial and git(1)

Add references to the gitworkflows(7) manpage added in f948dd8
(Documentation: add manpage about workflows, 2008-10-19) to both
gittutorial(1) and git(1), so that new users might actually discover
and read it.

Noticed by Randal L. Schwartz.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

daemon: Strictly parse the "extra arg" part of the... Shawn O. Pearce Fri, 5 Jun 2009 01:33:32 +0000 (18:33 -0700)

daemon: Strictly parse the "extra arg" part of the command

Since 1.4.4.5 (49ba83fb67 "Add virtualization support to git-daemon")
git daemon enters an infinite loop and never terminates if a client
hides any extra arguments in the initial request line which is not
exactly "\0host=blah\0".

Since that change, a client must never insert additional extra
arguments, or attempt to use any argument other than "host=", as
any daemon will get stuck parsing the request line and will never
complete the request.

Since the client can't tell if the daemon is patched or not, it
is not possible to know if additional extra args might actually be
able to be safely requested.

If we ever need to extend the git daemon protocol to support a new
feature, we may have to do something like this to the exchange:

# If both support git:// v2
#
C: 000cgit://v2
S: 0010ok host user
C: 0018host git.kernel.org
C: 0027git-upload-pack /pub/linux-2.6.git
S: ...git-upload-pack header...

# If client supports git:// v2, server does not:
#
C: 000cgit://v2
S: <EOF>

C: 003bgit-upload-pack /pub/linux-2.6.git\0host=git.kernel.org\0
S: ...git-upload-pack header...

This requires the client to create two TCP connections to talk to
an older git daemon, however all daemons since the introduction of
daemon.c will safely reject the unknown "git://v2" command request,
so the client can quite easily determine the server supports an
older protocol.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

parse-options: simplify usage argh handlingStephen Boyd Thu, 4 Jun 2009 23:43:57 +0000 (16:43 -0700)

parse-options: simplify usage argh handling

Simplify the argh printing by simply calling usage_argh() if the option
can take an argument. Update macros defined in parse-options.h to set
the PARSE_OPT_NOARG flag.

The only other user of custom non-argument taking options is git-apply
(in this case OPTION_BOOLEAN for deprecated options). Update it to set
the PARSE_OPT_NOARG flag.

Thanks to Ren辿 Scharfe for the suggestion and starter patch.

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Reviewd-by: René Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

parse-options: make OPT_INTEGER's argh explicitStephen Boyd Thu, 4 Jun 2009 23:43:56 +0000 (16:43 -0700)

parse-options: make OPT_INTEGER's argh explicit

OPTION_INTEGER hardcodes its argh member to be "n", but the decision is
hidden deep in usage_with_options_internal(). Make "n" the default argh
for the OPT_INTEGER macro while leaving it undecided for the OPTION_INTEGER
enum.

This makes it less surprising to users that argh is "n" when using the
OPT_INTEGER macro.

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Reviewed-by: René Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Makefile: add section for SunOS 5.7Brandon Casey Fri, 5 Jun 2009 23:36:16 +0000 (18:36 -0500)

Makefile: add section for SunOS 5.7

Signed-off-by: Brandon Casey <drafnel@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Makefile: introduce SANE_TOOL_PATH for prepending requi... Junio C Hamano Fri, 5 Jun 2009 23:36:15 +0000 (18:36 -0500)

Makefile: introduce SANE_TOOL_PATH for prepending required elements to PATH

Some platforms (like SunOS and family) have kept their common binaries at
some historical moment in time, and introduced new binaries with modern
features in a special location like /usr/xpg4/bin or /usr/ucb. Some of the
features provided by these modern binaries are expected and required by git.
If the featureful binaries are not in the users path, then git could end up
using the less featureful binary and fail.

So provide a mechanism to prepend elements to the users PATH at runtime so
the modern binaries will be found.

Signed-off-by: Brandon Casey <drafnel@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Makefile: define __sun__ on SunOSBrandon Casey Fri, 5 Jun 2009 23:36:14 +0000 (18:36 -0500)

Makefile: define __sun__ on SunOS

The SUNWspro compiler does not define __sun__ (like GCC does). A check of
this macro was recently added to detect compilation on SunOS and to modify
the handling of the NO_ICONV and _XOPEN_SOURCE feature macros.

Signed-off-by: Brandon Casey <drafnel@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-compat-util.h: tweak the way _XOPEN_SOURCE is set... Brandon Casey Fri, 5 Jun 2009 23:36:13 +0000 (18:36 -0500)

git-compat-util.h: tweak the way _XOPEN_SOURCE is set on Solaris

On Solaris, when _XOPEN_EXTENDED is set, its header file forces the
programs to be XPG4v2, defeating any _XOPEN_SOURCE setting to say we are
XPG5 or XPG6. Also on Solaris, XPG6 programs must be compiled with a c99
compiler, while non XPG6 programs must be compiled with a pre-c99 compiler.

So when compiling on Solaris, always refrain from setting _XOPEN_EXTENDED,
and then set _XOPEN_SOURCE to 600 or 500 based on whether a c99 compiler
is being used or not.

Signed-off-by: Brandon Casey <drafnel@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

On Solaris choose the OLD_ICONV iconv() declaration... Brandon Casey Fri, 5 Jun 2009 23:36:12 +0000 (18:36 -0500)

On Solaris choose the OLD_ICONV iconv() declaration based on the UNIX spec

OLD_ICONV is only necessary on Solaris until UNIX03. This is indicated
by the private macro _XPG6 which is set in /usr/include/sys/feature_tests.h.

Signed-off-by: Brandon Casey <drafnel@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Makefile: add NEEDS_RESOLV to optionally add -lresolv... Brandon Casey Fri, 5 Jun 2009 23:36:10 +0000 (18:36 -0500)

Makefile: add NEEDS_RESOLV to optionally add -lresolv to compile arguments

This library is required on Solaris when compiling with NO_IPV6 since
hstrerror resides in libresolv. Additionally, Solaris 7 will need it,
since inet_ntop and inet_pton reside there too.

Signed-off-by: Brandon Casey <drafnel@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t6030: test skipping away from an already skipped commitChristian Couder Sat, 6 Jun 2009 04:41:35 +0000 (06:41 +0200)

t6030: test skipping away from an already skipped commit

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

bisect: when skipping, choose a commit away from a... Christian Couder Sat, 6 Jun 2009 04:41:34 +0000 (06:41 +0200)

bisect: when skipping, choose a commit away from a skipped commit

To do that a new function "apply_skip_ratio" is added and another
function "managed_skipped" is created to wrap both "filter_skipped"
and the previous one.

In "managed_skipped" we detect when we should choose a commit away
from a skipped one and then we automatically choose a skip ratio
to pass to "apply_skip_ratio".

The ratio is choosen so that it alternates between 1/5, 2/5 and
3/5.

In "apply_skip_ratio", we ignore a given ratio of all the commits
that could be tested.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

bisect: add parameters to "filter_skipped"Christian Couder Sat, 6 Jun 2009 04:41:33 +0000 (06:41 +0200)

bisect: add parameters to "filter_skipped"

because we will need to get more information from this function in
some later patches.

The new "int *count" parameter gives the number of commits left after
the skipped commit have been filtered out.

The new "int *skipped_first" parameter tells us if the first commit
in the list has been skipped. Note that using this parameter also
changes the behavior of the function if the first commit is indeed
skipped. Because we assume that in this case we will want all the
filtered commits, not just the first one, even if "show_all" is not
set.

So using a not NULL "skipped_first" parameter really means that we
plan to choose to test another commit than the first non skipped
one if the first commit in the list is skipped. That in turn means
that, in case the first commit is skipped, we have to return a
fully filtered list.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

http*: add helper methods for fetching objects (loose)Tay Ray Chuan Sat, 6 Jun 2009 08:44:02 +0000 (16:44 +0800)

http*: add helper methods for fetching objects (loose)

The code handling the fetching of loose objects in http-push.c and
http-walker.c have been refactored into new methods and a new struct
(object_http_request) in http.c. They are not meant to be invoked
elsewhere.

The new methods in http.c are
- new_http_object_request
- process_http_object_request
- finish_http_object_request
- abort_http_object_request
- release_http_object_request

and the new struct is http_object_request.

RANGER_HEADER_SIZE and no_pragma_header is no longer made available
outside of http.c, since after the above changes, there are no other
instances of usage outside of http.c.

Remove members of the transfer_request struct in http-push.c and
http-walker.c, including filename, real_sha1 and zret, as they are used
no longer used.

Move the methods append_remote_object_url() and get_remote_object_url()
from http-push.c to http.c. Additionally, get_remote_object_url() is no
longer defined only when USE_CURL_MULTI is defined, since
non-USE_CURL_MULTI code in http.c uses it (namely, in
new_http_object_request()).

Refactor code from http-push.c::start_fetch_loose() and
http-walker.c::start_object_fetch_request() that deals with the details
of coming up with the filename to store the retrieved object, resuming
a previously aborted request, and making a new curl request, into a new
function, new_http_object_request().

Refactor code from http-walker.c::process_object_request() into the
function, process_http_object_request().

Refactor code from http-push.c::finish_request() and
http-walker.c::finish_object_request() into a new function,
finish_http_object_request(). It returns the result of the
move_temp_to_file() invocation.

Add a function, release_http_object_request(), which cleans up object
request data. http-push.c and http-walker.c invoke this function
separately; http-push.c::release_request() and
http-walker.c::release_object_request() do not invoke this function.

Add a function, abort_http_object_request(), which unlink()s the object
file and invokes release_http_object_request(). Update
http-walker.c::abort_object_request() to use this.

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

http*: add helper methods for fetching packsTay Ray Chuan Sat, 6 Jun 2009 08:44:01 +0000 (16:44 +0800)

http*: add helper methods for fetching packs

The code handling the fetching of packs in http-push.c and
http-walker.c have been refactored into new methods and a new struct
(http_pack_request) in http.c. They are not meant to be invoked
elsewhere.

The new methods in http.c are
- new_http_pack_request
- finish_http_pack_request
- release_http_pack_request

and the new struct is http_pack_request.

Add a function, new_http_pack_request(), that deals with the details of
coming up with the filename to store the retrieved packfile, resuming a
previously aborted request, and making a new curl request. Update
http-push.c::start_fetch_packed() and http-walker.c::fetch_pack() to
use this.

Add a function, finish_http_pack_request(), that deals with renaming
the pack, advancing the pack list, and installing the pack. Update
http-push.c::finish_request() and http-walker.c::fetch_pack to use
this.

Update release_request() in http-push.c and http-walker.c to invoke
release_http_pack_request() to clean up pack request helper data.

The local_stream member of the transfer_request struct in http-push.c
has been removed, as the packfile pointer will be managed in the struct
http_pack_request.

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

http: use new http API in fetch_index()Tay Ray Chuan Sat, 6 Jun 2009 08:44:00 +0000 (16:44 +0800)

http: use new http API in fetch_index()

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

http*: add http_get_info_packsTay Ray Chuan Sat, 6 Jun 2009 08:43:59 +0000 (16:43 +0800)

http*: add http_get_info_packs

http-push.c and http-walker.c no longer have to use fetch_index or
setup_index; they simply need to use http_get_info_packs, a new http
method, in their fetch_indices implementations.

Move fetch_index() and rename to fetch_pack_index() in http.c; this
method is not meant to be used outside of http.c. It invokes
end_url_with_slash with base_url; apart from that change, the code is
identical.

Move setup_index() and rename to fetch_and_setup_pack_index() in
http.c; this method is not meant to be used outside of http.c.

Do not immediately set ret to 0 in http-walker.c::fetch_indices();
instead do it in the HTTP_MISSING_TARGET case, to make it clear that
the HTTP_OK and HTTP_MISSING_TARGET cases both return 0.

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

http-push.c::fetch_symref(): use the new http APIMike Hommey Sat, 6 Jun 2009 08:43:58 +0000 (16:43 +0800)

http-push.c::fetch_symref(): use the new http API

Signed-off-by: Mike Hommey <mh@glandium.org>
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

http-push.c::remote_exists(): use the new http APIMike Hommey Sat, 6 Jun 2009 08:43:57 +0000 (16:43 +0800)

http-push.c::remote_exists(): use the new http API

Signed-off-by: Mike Hommey <mh@glandium.org>
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

http.c::http_fetch_ref(): use the new http APIMike Hommey Sat, 6 Jun 2009 08:43:55 +0000 (16:43 +0800)

http.c::http_fetch_ref(): use the new http API

The error message ("Unable to start request") has been removed, since
the http API already prints it.

Signed-off-by: Mike Hommey <mh@glandium.org>
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

transport.c::get_refs_via_curl(): use the new http APIMike Hommey Sat, 6 Jun 2009 08:43:54 +0000 (16:43 +0800)

transport.c::get_refs_via_curl(): use the new http API

Signed-off-by: Mike Hommey <mh@glandium.org>
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

http.c: new functions for the http APIMike Hommey Sat, 6 Jun 2009 08:43:53 +0000 (16:43 +0800)

http.c: new functions for the http API

The new functions added are:
- http_request() (internal function)
- http_get_strbuf()
- http_get_file()
- http_error()

http_get_strbuf and http_get_file allow respectively to retrieve contents of
an URL to a strbuf or an opened file handle.

http_error prints out an error message containing the URL and the curl error
(in curl_errorstr).

Signed-off-by: Mike Hommey <mh@glandium.org>
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

http: create function end_url_with_slashTay Ray Chuan Sat, 6 Jun 2009 08:43:43 +0000 (16:43 +0800)

http: create function end_url_with_slash

The logic to append a slash to the url if necessary in quote_ref_url
(added in 113106e "http.c: use strbuf API in quote_ref_url") has been
moved to a new function, end_url_with_slash.

The method takes a strbuf, the URL, and the path to be appended to the
URL. It first adds the URL to the strbuf. It then appends a slash
if the URL does not end with a slash.

The check on ref in quote_ref_url for a slash at the beginning has been
removed as a result of using end_url_with_slash. This check is not
needed, because slashes will be quoted anyway.

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

http*: move common variables and macros to http.[ch]Tay Ray Chuan Sat, 6 Jun 2009 08:43:41 +0000 (16:43 +0800)

http*: move common variables and macros to http.[ch]

Move RANGE_HEADER_SIZE to http.h.

Create no_pragma_header, the curl header list containing the header
"Pragma:" in http.[ch]. It is allocated in http_init, and freed in
http_cleanup. This replaces the no_pragma_header in http-push.c, and
the no_pragma_header member in walker_data in http-walker.c.

Create http_is_verbose. It is to be used by methods in http.c, and is
modified at the entry points of http.c's users, namely http-push.c
(when parsing options) and http-walker.c (in get_http_walker).

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

transport.c::get_refs_via_curl(): do not leak refs_urlMike Hommey Sat, 6 Jun 2009 08:43:40 +0000 (16:43 +0800)

transport.c::get_refs_via_curl(): do not leak refs_url

Signed-off-by: Mike Hommey <mh@glandium.org>
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Don't expect verify_pack() callers to set pack_sizeMike Hommey Sun, 18 Jan 2009 08:04:26 +0000 (09:04 +0100)

Don't expect verify_pack() callers to set pack_size

Since use_pack() will end up populating pack_size if it is not already set,
we can just adapt the code in verify_packfile() such that it doesn't require
pack_size to be set beforehand.

This allows callers not to have to set pack_size themselves, and we can thus
revert changes from 1c23d794 (Don't die in git-http-fetch when fetching packs).

Signed-off-by: Mike Hommey <mh@glandium.org>
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

http-push: do not SEGV after fetching a bad pack idx... Tay Ray Chuan Sat, 6 Jun 2009 08:43:37 +0000 (16:43 +0800)

http-push: do not SEGV after fetching a bad pack idx file

In a70c232 ("http-fetch: do not SEGV after fetching a bad pack idx
file"), changes were made to the setup_index method in http-fetch.c
(known in its present form as http-walker.c after 30ae764 ("Modularize
commit-walker")). Since http-push.c has similar similar code for
processing index files, these changes should apply to http-push.c's
implementation of setup_index as well.

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

http*: copy string returned by sha1_to_hexTay Ray Chuan Sat, 6 Jun 2009 08:43:36 +0000 (16:43 +0800)

http*: copy string returned by sha1_to_hex

In the fetch_index implementations in http-push.c and http-walker.c,
the string returned by sha1_to_hex is assumed to stay immutable.

This patch ensures that hex stays immutable by copying the string
returned by sha1_to_hex (via xstrdup) and frees it subsequently. It
also refactors free()'s and fclose()'s with labels.

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

http-walker: verify remote packsTay Ray Chuan Sat, 6 Jun 2009 08:43:34 +0000 (16:43 +0800)

http-walker: verify remote packs

In c17fb6e ("Verify remote packs, speed up pending request queue"),
changes were made to index fetching in http-push.c, particularly the
methods fetch_index and setup_index. Since http-walker.c has similar
code for index fetching, these improvements should apply to
http-walker.c's fetch_index and setup_index.

Invocations of free() of string memory are reproduced as well.

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

http-push, http-walker: style fixesTay Ray Chuan Sat, 6 Jun 2009 08:43:33 +0000 (16:43 +0800)

http-push, http-walker: style fixes

- Use tabs to indent, instead of spaces.

- Do not use curly-braces around a single statement body in
if/while statement;

- Do not start multi-line comment with description on the first
line after "/*", i.e.

/*
* We prefer this over...
*/

/* comments like
* this (notice the first line)
*/

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t5550-http-fetch: test fetching of packed objectsTay Ray Chuan Sat, 6 Jun 2009 08:43:32 +0000 (16:43 +0800)

t5550-http-fetch: test fetching of packed objects

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

http-push: fix missing "#ifdef USE_CURL_MULTI" around... Tay Ray Chuan Sat, 6 Jun 2009 08:43:31 +0000 (16:43 +0800)

http-push: fix missing "#ifdef USE_CURL_MULTI" around "is_running_queue"

As it is breaking the build when USE_CURL_MULTI is not defined.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

http-push: send out fetch requests on queueTay Ray Chuan Sat, 6 Jun 2009 08:43:27 +0000 (16:43 +0800)

http-push: send out fetch requests on queue

Previously, requests for remote files were simply added to the queue
(pointed to by request_queue_head) and no transfer actually takes
place (the fill function add_fill_function() is not added until line
2441), even though code that followed may rely on these remote files to
be present (eg. the setup_revisions invocation).

The code that sends out the requests on the request queue is refactored
into the method run_request_queue.

After the get_dav_remote_heads invocation (ie. after fetch requests are
added to the queue), the requests on the queue are sent out through an
invocation to run_request_queue.

This invocation to run_request_queue entails adding a fill function
before pushing checks take place, which may lead to accidental,
unwanted pushes previously.

The flag is_running_queue is introduced to prevent this from occurring.
fill_active_slot is made to check the flag is_running_queue before
the sending of the requests proceeds.

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t5540-http-push: test fetching of packed objectsTay Ray Chuan Sat, 6 Jun 2009 08:43:24 +0000 (16:43 +0800)

t5540-http-push: test fetching of packed objects

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t5540-http-push: test fetching of loose objectsTay Ray Chuan Sat, 6 Jun 2009 08:43:23 +0000 (16:43 +0800)

t5540-http-push: test fetching of loose objects

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'rc/maint-http-local-slot-fix' into rc... Junio C Hamano Sat, 6 Jun 2009 17:56:17 +0000 (10:56 -0700)

Merge branch 'rc/maint-http-local-slot-fix' into rc/http-push

* rc/maint-http-local-slot-fix:
http*: cleanup slot->local after fclose

http*: cleanup slot->local after fcloseTay Ray Chuan Sat, 6 Jun 2009 08:43:26 +0000 (16:43 +0800)

http*: cleanup slot->local after fclose

Set slot->local to NULL after doing a fclose() on the file it points
to. This prevents the passing of a FILE* pointer to a fclose()'d file
to ftell() in http.c::run_active_slot().

This issue was raised by Clemens Buchacher on 30th May 2009:

http://www.spinics.net/lists/git/msg104623.html

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>