]> git.ipfire.org Git - thirdparty/git.git/log
thirdparty/git.git
14 years agoMerge branch 'ph/submodule-rebase'
Junio C Hamano [Sun, 21 Jun 2009 04:51:13 +0000 (21:51 -0700)] 
Merge branch 'ph/submodule-rebase'

* ph/submodule-rebase:
  git-submodule: add support for --merge.

Conflicts:
Documentation/git-submodule.txt
git-submodule.sh

14 years agoMerge branch 'jc/cache-tree'
Junio C Hamano [Sun, 21 Jun 2009 04:47:30 +0000 (21:47 -0700)] 
Merge branch 'jc/cache-tree'

* jc/cache-tree:
  Avoid "diff-index --cached" optimization under --find-copies-harder
  Optimize "diff-index --cached" using cache-tree
  t4007: modernize the style
  cache-tree.c::cache_tree_find(): simplify internal API
  write-tree --ignore-cache-tree

14 years agoMerge branch 'mg/pushurl'
Junio C Hamano [Sun, 21 Jun 2009 04:47:27 +0000 (21:47 -0700)] 
Merge branch 'mg/pushurl'

* mg/pushurl:
  avoid NULL dereference on failed malloc
  builtin-remote: Make "remote -v" display push urls
  builtin-remote: Show push urls as well
  technical/api-remote: Describe new struct remote member pushurl
  t5516: Check pushurl config setting
  Allow push and fetch urls to be different

14 years agoMerge branch 'mn/maint-iconv-autoconf'
Junio C Hamano [Sun, 21 Jun 2009 04:47:22 +0000 (21:47 -0700)] 
Merge branch 'mn/maint-iconv-autoconf'

* mn/maint-iconv-autoconf:
  fix handling of iconv configuration options

14 years agoMerge branch 'sb/pull-rebase'
Junio C Hamano [Sun, 21 Jun 2009 04:47:13 +0000 (21:47 -0700)] 
Merge branch 'sb/pull-rebase'

* sb/pull-rebase:
  parse-remote: remove unused functions
  parse-remote: support default reflist in get_remote_merge_branch
  parse-remote: function to get the tracking branch to be merge

14 years agoMerge branch 'pb/send-email-cccmd-fix'
Junio C Hamano [Sun, 21 Jun 2009 04:47:06 +0000 (21:47 -0700)] 
Merge branch 'pb/send-email-cccmd-fix'

* pb/send-email-cccmd-fix:
  Test cccmd in t9001-send-email.sh and fix some bugs

14 years agoMerge branch 'pb/maint-1.6.2-userdiff-fix'
Junio C Hamano [Sun, 21 Jun 2009 04:46:55 +0000 (21:46 -0700)] 
Merge branch 'pb/maint-1.6.2-userdiff-fix'

* pb/maint-1.6.2-userdiff-fix:
  upload-archive: fix infinite loop on Cygwin
  avoid exponential regex match for java and objc function names

14 years agoMerge 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

14 years agoMerge 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

14 years agoMerge git://git.kernel.org/pub/scm/gitk/gitk
Junio 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.

14 years agoadd: allow configurations to be overriden by command line
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>
14 years agoMerge 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()

14 years agoMerge 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

14 years agoMerge 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

14 years agoAdd -k option to cvsexportcommit to revert expanded CVS keywords in CVS working tree...
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>
14 years agohttp.c: fix compiling with libcurl 7.9.2
Mark 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>
14 years agoTest cccmd in t9001-send-email.sh and fix some bugs
Paolo Bonzini [Thu, 18 Jun 2009 12:31:32 +0000 (14:31 +0200)] 
Test cccmd in t9001-send-email.sh and fix some bugs

For another patch series I'm working on I needed some tests
for the cc-cmd feature of git-send-email.

This patch adds 3 tests for the feature and for the possibility
to specify --suppress-cc multiple times, and fixes two bugs.
The first bug is that the --suppress-cc option for `cccmd' was
misspelled as `ccmd' in the code.  The second bug, which is
actually found only with my other series, is that the argument
to the cccmd is never quoted, so the cccmd would fail with
patch file names containing a space.

A third bug I fix (in the docs) is that the bodycc argument was
actually spelled ccbody in the documentation and bash completion.

Signed-off-by: Paolo Bonzini <bonzini@gnu.org>
Cc: Markus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoimport-tars: support symlinks
Johannes 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>
14 years agoupload-archive: fix infinite loop on Cygwin
René Scharfe [Wed, 17 Jun 2009 10:11:10 +0000 (12:11 +0200)] 
upload-archive: fix infinite loop on Cygwin

On Cygwin, poll() reports POLLIN even for file descriptors that have
reached their end.  This caused git upload-archive to be stuck in an
infinite loop, as it only looked at the POLLIN flag.

In addition to POLLIN, check if read() returned 0, which indicates
end-of-file, and keep looping only as long as at least one of the file
descriptors has input.  This lets the following command finish on its
own when run in a git repository on Cygwin, instead of it getting stuck
after printing all file names:

$ git archive -v --remote . HEAD >/dev/null

Reported-by: Bob Kagy <bobkagy@gmail.com>
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoavoid exponential regex match for java and objc function names
Paolo Bonzini [Wed, 17 Jun 2009 14:26:06 +0000 (16:26 +0200)] 
avoid exponential regex match for java and objc function names

In the old regex

^[ \t]*(([ \t]*[A-Za-z_][A-Za-z_0-9]*){2,}[ \t]*\([^;]*)$
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

you can backtrack arbitrarily from [A-Za-z_0-9]* into [A-Za-z_], thus
causing an exponential number of backtracks.  Ironically it also causes
the regex not to work as intended; for example "catch" can match the
underlined part of the regex, the first repetition matching "c" and
the second matching "atch".

The replacement regex avoids this problem, because it makes sure that
at least a space/tab is eaten on each repetition.  In other words,
a suffix of a repetition can never be a prefix of the next repetition.

Signed-off-by: Paolo Bonzini <bonzini@gnu.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoFix big left-shifts of unsigned char
Linus 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>
14 years agopull, 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>
14 years agouse xstrdup, not strdup in ll-merge.c
Jim 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>
14 years agoavoid NULL dereference on failed malloc
Jim Meyering [Sun, 14 Jun 2009 19:46:10 +0000 (21:46 +0200)] 
avoid NULL dereference on failed malloc

* builtin-remote.c (get_one_entry): Use xmalloc, not malloc.

Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge 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

14 years agoMerge branch 'maint-1.6.2' into maint
Junio 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

14 years agoMerge branch 'maint-1.6.1' into maint-1.6.2
Junio 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

14 years agoMerge branch 'maint-1.6.0' into maint-1.6.1
Junio 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

14 years agoMerge 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

14 years agoMerge 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
  ...

14 years agoMerge 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()

14 years agoMerge 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

14 years agoMerge 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

14 years agoMerge 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

14 years agoMerge 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

14 years agoMerge 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

14 years agoMerge 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

14 years agoMerge 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

14 years agoMerge 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

14 years agogit-rerere.txt: grammatical fixups and cleanups
Stephen 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>
14 years agobuiltin-remote: Make "remote -v" display push urls
Michael J Gruber [Sat, 13 Jun 2009 16:29:11 +0000 (18:29 +0200)] 
builtin-remote: Make "remote -v" display push urls

Currently, "remote -v" simply lists all urls so that one has to remember
that only the first one is used for fetches, and all are used for
pushes.

Change this so that the role of an url is displayed in parentheses, and
also display push urls.

Example with "one" having one url, "two" two urls, "three" one url and
one pushurl:

one     hostone.com:/somepath/repoone.git (fetch)
one     hostone.com:/somepath/repoone.git (push)
three   http://hostthree.com/otherpath/repothree.git (fetch)
three   hostthree.com:/pathforpushes/repothree.git (push)
two     hosttwo.com:/somepath/repotwo.git (fetch)
two     hosttwo.com:/somepath/repotwo.git (push)
two     hosttwobackup.com:/somewheresafe/repotwo.git (push)

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agobuiltin-remote: Show push urls as well
Michael J Gruber [Sat, 13 Jun 2009 16:29:10 +0000 (18:29 +0200)] 
builtin-remote: Show push urls as well

Teach builtin remote to show push urls also when asked to
"show" a specific remote.

This improves upon the standard display mode: multiple specified "url"s
mean that the first one is for fetching, all are used for pushing. We
make this clearer now by displaying the first one prefixed with "Fetch
URL", and all "url"s (or, if present, all "pushurl"s) prefixed with
"Push  URL".

Example with "one" having one url, "two" two urls, "three" one url and
one pushurl (URL part only):

* remote one
  Fetch URL: hostone.com:/somepath/repoone.git
  Push  URL: hostone.com:/somepath/repoone.git
* remote two
  Fetch URL: hosttwo.com:/somepath/repotwo.git
  Push  URL: hosttwo.com:/somepath/repotwo.git
  Push  URL: hosttwobackup.com:/somewheresafe/repotwo.git
* remote three
  Fetch URL: http://hostthree.com/otherpath/repothree.git
  Push  URL: hostthree.com:/pathforpushes/repothree.git

Also, adjust t5505 accordingly and make it test for the new output.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'mh/maint-fix-send-email-threaded' into mh/fix-send-email-threaded
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

14 years agosend-email: fix a typo in a comment
Markus 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>
14 years agosend-email: fix threaded mails without chain-reply-to
Markus 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>
14 years agoadd a test for git-send-email for threaded mails without chain-reply-to
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>
14 years agodoc/send-email: clarify the behavior of --in-reply-to with --no-thread
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>
14 years agosend-email: fix non-threaded mails
Markus 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>
14 years agoadd a test for git-send-email for non-threaded mails
Markus 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>
14 years agoMerge 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

14 years agoDocumentation: git-send-mail can take rev-list arg to drive format-patch
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>
14 years agoparse-remote: remove unused functions
Santi Béjar [Thu, 11 Jun 2009 22:39:21 +0000 (00:39 +0200)] 
parse-remote: remove unused functions

Signed-off-by: Santi Béjar <santi@agolina.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoparse-remote: support default reflist in get_remote_merge_branch
Santi Béjar [Thu, 11 Jun 2009 22:39:19 +0000 (00:39 +0200)] 
parse-remote: support default reflist in get_remote_merge_branch

Expand get_remote_merge_branch to compute the tracking branch to merge
when called without arguments (or only the remote name). This allows
"git pull --rebase" without arguments (default upstream branch) to
work with a rebased upstream. With explicit arguments it already worked.

Also add a test to check for this case.

Signed-off-by: Santi Béjar <santi@agolina.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoparse-remote: function to get the tracking branch to be merge
Santi Béjar [Thu, 11 Jun 2009 22:39:18 +0000 (00:39 +0200)] 
parse-remote: function to get the tracking branch to be merge

The only user of get_remote_refs_for_fetch was "git pull --rebase" and
it only wanted the tracking branch to be merge. So, add a simple
function (get_remote_merge_branch) with this new meaning.

No behavior changes. The new function behaves like the old code in
"git pull --rebase". In particular, it only works with the default
refspec mapping and with remote branches, not tags.

Signed-off-by: Santi Béjar <santi@agolina.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agocompat/ has subdirectories: do not omit them in 'make clean'
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>
14 years agoFix typo in nedmalloc warning fix
Johannes 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>
14 years agoMerge branch 'uk/maint-1.5.3-rebase-i-reflog' into maint
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

14 years agorebase--interactive: remote stray closing parenthesis
Uwe 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>
14 years agoparse-options: add parse_options_check to validate option specs.
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>
14 years agoconfigure: test whether -lresolv is needed
Ralf 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>
14 years agoMakefile: insert SANE_TOOL_PATH to PATH before /bin or /usr/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>
14 years agogit-repack.txt: Clarify implications of -a for dumb protocols
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>
14 years agotechnical/api-remote: Describe new struct remote member pushurl
Michael J Gruber [Tue, 9 Jun 2009 16:01:36 +0000 (18:01 +0200)] 
technical/api-remote: Describe new struct remote member pushurl

...and pushurl_nr

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agot5516: Check pushurl config setting
Michael J Gruber [Tue, 9 Jun 2009 16:01:35 +0000 (18:01 +0200)] 
t5516: Check pushurl config setting

Check whether the new remote.${remotename}.pushurl setting is obeyed
and whether it overrides remote.${remotename}.url.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoAllow push and fetch urls to be different
Michael J Gruber [Tue, 9 Jun 2009 16:01:34 +0000 (18:01 +0200)] 
Allow push and fetch urls to be different

This introduces a config setting remote.$remotename.pushurl which is
used for pushes only. If absent remote.$remotename.url is used for
pushes and fetches as before.
This is useful, for example, in order to do passwordless fetches
(remote update) over the git transport but pushes over ssh.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge 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

15 years agobash: add support for 'git stash pop --index' option
SZEDER 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>
15 years agoDocumentation: mention 'git stash pop --index' option explicitly
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>
15 years agoSimplify some 'fprintf(stderr); return -1;' by using 'return error()'
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>
15 years agoSimplify some instances of run_command() by using run_command_v_opt().
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>
15 years agoshow-branch: don't use LASTARG_DEFAULT with OPTARG
Stephen 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>
15 years agosend-email: use UTF-8 rather than utf-8 for consistency
Brandon 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>
15 years agogit-send-email.perl: improve detection of MIME encoded-words
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>
15 years agodiff.c: plug a memory leak in an error path
Johannes 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>
15 years agofetch-pack: close output channel after sideband demultiplexer terminates
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>
15 years agofix handling of iconv configuration options
Marco Nelissen [Tue, 9 Jun 2009 03:46:38 +0000 (20:46 -0700)] 
fix handling of iconv configuration options

Fix the way in which the configure script handles --without-iconv
(and --with-iconv=no), which it  used to essentially ignore.
Also fix the way the configure script determines the value of
NEEDS_LIBICONV, which would be incorrectly set to 'YesPlease' on
systems that lack iconv entirely.

Signed-off-by: Marco Nelissen <marcone@xs4all.nl>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit-compat-util.h: avoid using c99 flex array feature with Sun compiler 5.8
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>
15 years agobuiltin-remote: Make "remote show" display all urls
Michael 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>
15 years agoMinGW: Teach Makefile to detect msysgit and apply specific settings
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>
15 years agoFix warnings in nedmalloc when compiling with GCC 4.4.0
Johannes 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>
15 years agosymlinks.c: small style cleanup
Kjetil 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>
15 years agoMakefile: test-parse-options depends on parse-options.h
Junio 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>
15 years agoMerge 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

15 years agoDocumentation: refer to gitworkflows(7) from tutorial and git(1)
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>
15 years agodaemon: Strictly parse the "extra arg" part of the command
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>
15 years agoparse-options: simplify usage argh handling
Stephen 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>
15 years agoparse-options: make OPT_INTEGER's argh explicit
Stephen 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>
15 years agoMakefile: add section for SunOS 5.7
Brandon 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>
15 years agoMakefile: introduce SANE_TOOL_PATH for prepending required elements to PATH
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>
15 years agoMakefile: define __sun__ on SunOS
Brandon 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>
15 years agogit-compat-util.h: tweak the way _XOPEN_SOURCE is set on Solaris
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>
15 years agoOn Solaris choose the OLD_ICONV iconv() declaration based on the UNIX spec
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>
15 years agoMakefile: add NEEDS_RESOLV to optionally add -lresolv to compile arguments
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>
15 years agot6030: test skipping away from an already skipped commit
Christian 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>
15 years agobisect: when skipping, choose a commit away from a skipped commit
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>
15 years agobisect: 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>
15 years agohttp*: 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>
15 years agohttp*: add helper methods for fetching packs
Tay 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>
15 years agohttp: 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>
15 years agohttp*: add http_get_info_packs
Tay 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>