Commit graph

2957 commits

Author SHA1 Message Date
Johan Herland d9eb0205a2 quickfetch(): Prevent overflow of the rev-list command line
quickfetch() calls rev-list to check whether the objects we are about to
fetch are already present in the repo (if so, we can skip the object fetch).
However, when there are many (~1000) refs to be fetched, the rev-list
command line grows larger than the maximum command line size on some systems
(32K in Windows). This causes rev-list to fail, making quickfetch() return
non-zero, which unnecessarily triggers the transport machinery. This somehow
causes fetch to fail with an exit code.

By using the --stdin option to rev-list (and feeding the object list to its
standard input), we prevent the overflow of the rev-list command line,
which causes quickfetch(), and subsequently the overall fetch, to succeed.

However, using rev-list --stdin is not entirely straightforward: rev-list
terminates immediately when encountering an unknown object, which can
trigger SIGPIPE if we are still writing object's to its standard input.
We therefore temporarily ignore SIGPIPE so that the fetch process is not
terminated.

The patch also contains a testcase to verify the fix (note that before
the patch, the testcase would only fail on msysGit).

Signed-off-by: Johan Herland <johan@herland.net>
Improved-by: Johannes Sixt <j6t@kdbg.org>
Improved-by: Alex Riesen <raa.lkml@gmail.com>
Tested-by: Peter Krefting <peter@softwolves.pp.se>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-07-10 23:53:17 -07:00
Junio C Hamano 73ccb916e4 Merge branch 'ae/maint-mailinfo-rm-only-one-patch-marker'
* ae/maint-mailinfo-rm-only-one-patch-marker:
  mailinfo: Remove only one set of square brackets
2009-07-10 20:18:09 -07:00
Junio C Hamano 1d4bf0b362 Merge branch 'gb/gitweb-avatar'
* gb/gitweb-avatar:
  gitweb: add empty alt text to avatar img
  gitweb: picon avatar provider
  gitweb: gravatar url cache
  gitweb: (gr)avatar support
  gitweb: use git_print_authorship_rows in 'tag' view too
  gitweb: uniform author info for commit and commitdiff
  gitweb: refactor author name insertion
2009-07-09 01:00:59 -07:00
Junio C Hamano 128a9d86da Merge branch 'rs/grep-p'
* rs/grep-p:
  grep: simplify -p output
  grep -p: support user defined regular expressions
  grep: add option -p/--show-function
  grep: handle pre context lines on demand
  grep: print context hunk marks between files
  grep: move context hunk mark handling into show_line()
  userdiff: add xdiff_clear_find_func()
2009-07-09 00:59:58 -07:00
Andreas Ericsson 650d30d8a1 mailinfo: Remove only one set of square brackets
git-format-patch prepends patches with a [PATCH x/n] prefix, but
mailinfo used to remove any number of square-bracket pairs and
the content between them. This prevents one from using a commit
subject like this:

  [ and ] must be allowed as input

Removing the square bracket pair from this rather clumsily
constructed subject line loses important information, so we must
take care not to.

This patch causes the subject stripping to stop after it has
encountered one pair of square brackets.

One possible downside of this patch is that the patch-handling
programs will now fail at removing author-added square-brackets
to be removed, such as

  [RFC][PATCH x/n]

However, since format-patch only adds one set of square brackets,
this behaviour is quite easily undesrstood and defended while the
previous behaviour is not.

Signed-off-by: Andreas Ericsson <ae@op5.se>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-07-08 11:22:51 -07:00
Junio C Hamano 5cacf3d644 Merge branch 'uk/rev-parse-parse-opt'
* uk/rev-parse-parse-opt:
  parse-opt: make PARSE_OPT_STOP_AT_NON_OPTION available to git rev-parse
  more tests for git rev-parse --parse-opt
2009-07-06 09:38:01 -07:00
Martin Renold 606475f317 Remove filename from conflict markers
Put filenames into the conflict markers only when they are different.
Otherwise they are redundant information clutter.

Print the filename explicitely when warning about a binary conflict.

Signed-off-by: Martin Renold <martinxyz@gmx.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-07-01 19:46:30 -07:00
Junio C Hamano 702beb3af0 Merge branch 'cc/bisect'
* cc/bisect:
  Documentation: remove warning saying that "git bisect skip" may slow bisection
  bisect: use a PRNG with a bias when skipping away from untestable commits
2009-07-01 19:41:04 -07:00
Junio C Hamano e6c7c2cc97 Merge branch 'sb/quiet-porcelains'
* sb/quiet-porcelains:
  stash: teach quiet option
  am, rebase: teach quiet option
  submodule, repack: migrate to git-sh-setup's say()
  git-sh-setup: introduce say() for quiet options
  am: suppress apply errors when using 3-way
  t4150: test applying with a newline in subject
2009-07-01 19:40:50 -07:00
Junio C Hamano 4197195bee Merge branch 'ne/maint-1.6.0-diff-tree-t-r-show-directory'
* ne/maint-1.6.0-diff-tree-t-r-show-directory:
  diff-tree -r -t: include added/removed directories in the output
2009-07-01 19:40:47 -07:00
René Scharfe 60ecac98ed grep -p: support user defined regular expressions
Respect the userdiff attributes and config settings when looking for
lines with function definitions in git grep -p.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-07-01 19:16:50 -07:00
René Scharfe 2944e4e614 grep: add option -p/--show-function
The new option -p instructs git grep to print the previous function
definition as a context line, similar to diff -p.  Such context lines
are marked with an equal sign instead of a dash.  This option
complements the existing context options -A, -B, -C.

Function definitions are detected using the same heuristic that diff
uses.  User defined regular expressions are not supported, yet.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-07-01 19:16:49 -07:00
René Scharfe 046802d015 grep: print context hunk marks between files
Print a hunk mark before matches from a new file are shown, in addition
to the current behaviour of printing them if lines have been skipped.

The result is easier to read, as (presumably unrelated) matches from
different files are separated by a hunk mark.  GNU grep does the same.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-07-01 19:16:46 -07:00
Giuseppe Bilotta e9fdd74e53 gitweb: (gr)avatar support
Introduce avatar support: the feature adds the appropriate img tag next
to author and committer in commit(diff), history, shortlog, log and tag
views. Multiple avatar providers are possible, but only gravatar is
implemented at the moment.

Gravatar support depends on Digest::MD5, which is a core package since
Perl 5.8. If gravatars are activated but Digest::MD5 cannot be found,
the feature will be automatically disabled.

No avatar provider is selected by default, except in the t9500 test.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-30 11:06:35 -07:00
Junio C Hamano 4f2b15ce88 Merge git://git.bogomips.org/git-svn
* git://git.bogomips.org/git-svn:
  git svn: Doc update for multiple branch and tag paths
  git svn: cleanup t9138-multiple-branches
  git-svn: Canonicalize svn urls to prevent libsvn assertion
  t9138: remove stray dot in test which broke bash
  git-svn: convert globs to regexps for branch destinations
  git svn: Support multiple branch and tag paths in the svn repository.
  Add 'git svn reset' to unwind 'git svn fetch'
  git-svn: speed up find_rev_before
  Add 'git svn help [cmd]' which works outside a repo.
  git-svn: let 'dcommit $rev' work on $rev instead of HEAD
2009-06-27 20:09:04 -07:00
Marc Branchaud b5c9b38bc3 git svn: cleanup t9138-multiple-branches
Using the "svn_cmd" wrapper instead of "svn" alone allows tests
to run consistently for users with customized
~/.subversion/configs.  Additionally, using subshells via
"(cd ...)" allow cleaner and less error-prone tests to
be written.

[ew: expanded commit message]

Signed-off-by: Marc Branchaud <marcnarc@xiplink.com>
Acked-by: Eric Wong <normalperson@yhbt.net>
2009-06-27 15:01:57 -07:00
Junio C Hamano 36e74ab7ef Merge branch 'pb/send-email-cccmd-fix'
* pb/send-email-cccmd-fix:
  t/t9001-send-email.sh: ensure generated script is executed with $SHELL_PATH
2009-06-27 14:13:43 -07:00
Elijah Newren 25e0ca5dd6 Add new fast-export testcases
The testcases test the new --tag-of-filtered-object option, the output
when limiting what to export by path, and test behavior when no
exact-ref revision is included (e.g. master~8 present on command line
but not master).

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-27 14:10:10 -07:00
Elijah Newren 02c48cd69b fast-export: Omit tags that tag trees
Commit c0582c53bc introduced logic to just
omit tags that point to tree objects.  However, these objects were still
being output and were pointing at "mark :0", which caused fast-import to
crash.  This patch makes sure such tags (including deeper nestings such
as tags of tags of trees), are omitted.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-27 14:10:09 -07:00
Junio C Hamano 2dc7f40d44 Merge branch 'maint'
* maint:
  gitweb/README: fix AliasMatch in example
  Test grep --and/--or/--not
  Test git archive --remote
  fread does not return negative on error
2009-06-27 13:44:25 -07:00
Thomas Rast 0f7050469b Test grep --and/--or/--not
Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-27 13:15:41 -07:00
Thomas Rast 4813926921 Test git archive --remote
Add a small test case for git archive --remote (and thus
git-upload-archive), which so far went untested.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-27 13:15:39 -07:00
Eric Wong 2317d289fe t9138: remove stray dot in test which broke bash
The stray dot broke bash and probably some other shells,
but worked fine with dash in my limited testing.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
2009-06-26 11:05:36 -07:00
Marc Branchaud 6224406914 git svn: Support multiple branch and tag paths in the svn repository.
This enables git-svn.perl to read multiple 'branches' and 'tags' entries in
svn-remote config sections.  The init and clone subcommands also support
multiple --branches and --tags arguments.

The branch (and tag) subcommand gets a new argument: --destination (or -d).
This argument is required if there are multiple branches (or tags) entries
configured for the remote Subversion repository.  The argument's value
specifies which branch (or tag) path to use to create the branch (or tag).
The specified value must match the left side (without wildcards) of one of
the branches (or tags) refspecs in the svn-remote's config.

[ew: avoided explicit loop when combining globs with "push"]

Signed-off-by: Marc Branchaud <marcnarc@xiplink.com>
Acked-by: Eric Wong <normalperson@yhbt.net>
2009-06-25 01:58:09 -07:00
Ben Jackson 195643f2fc Add 'git svn reset' to unwind 'git svn fetch'
Add a command to unwind the effects of fetch by moving the rev_map
and refs/remotes/git-svn back to an old SVN revision.  This allows
revisions to be re-fetched.  Ideally SVN revs would be immutable,
but permissions changes in the SVN repository or indiscriminate use
of '--ignore-paths' can create situations where fetch cannot make
progress.

Signed-off-by: Ben Jackson <ben@ben.com>
Acked-by: Eric Wong <normalperson@yhbt.net>
2009-06-25 00:38:17 -07:00
Thomas Rast 5eec27e35f git-svn: let 'dcommit $rev' work on $rev instead of HEAD
'git svn dcommit' takes an optional revision argument, but the meaning
of it was rather scary.  It completely ignored the current state of
the HEAD, only looking at the revisions between SVN and $rev.  If HEAD
was attached to $branch, the branch lost all commits $rev..$branch in
the process.

Considering that 'git svn dcommit HEAD^' has the intuitive meaning
"dcommit all changes on my branch except the last one", we change the
meaning of the revision argument.  git-svn temporarily checks out $rev
for its work, meaning that

* if a branch is specified, that branch (_not_ the HEAD) is rebased as
  part of the dcommit,

* if some other revision is specified, as in the example, all work
  happens on a detached HEAD and no branch is affected.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Acked-by: Eric Wong <normalperson@yhbt.net>
2009-06-25 00:38:16 -07:00
Brandon Casey 977e289e0d t/t9001-send-email.sh: ensure generated script is executed with $SHELL_PATH
If the shell is not specified using the '#!' notation, then the OS will
use '/bin/sh' to execute the script which may not produce the desired
results.  In particular, /bin/sh on Solaris interprets '^' specially which
has an effect on the sed command that this patch touches.

Signed-off-by: Brandon Casey <drafnel@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-23 16:41:27 -07:00
Junio C Hamano 916e1373fb Merge branch 'maint'
* maint:
  t3700-add: add a POSIXPERM prerequisite to a new test
2009-06-22 00:44:34 -07:00
Johannes Sixt 1ab012cf81 t3700-add: add a POSIXPERM prerequisite to a new test
The new test does a 'chmod 0', which does not have the intended
effect on Windows.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-22 00:44:14 -07:00
Junio C Hamano d1f6c18bd6 Merge branch 'sb/maint-1.6.0-add-config-fix' into maint
* sb/maint-1.6.0-add-config-fix:
  add: allow configurations to be overriden by command line
2009-06-22 00:44:09 -07:00
Junio C Hamano e16a4779b3 Sync with 1.6.3.3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-21 23:50:17 -07:00
Junio C Hamano d836118be9 Merge branch 'cb/maint-no-double-merge' into maint
* cb/maint-no-double-merge:
  refuse to merge during a merge
2009-06-21 21:15:27 -07:00
Junio C Hamano c6720cfa49 t3505: fix abuse of test_expect_code
The test wanted to make sure that cherry-pick exits with status 1,
but with the way it was placed after "git checkout master &&" meant
that it could have misjudged success if checkout barfed with the
same failure status.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-21 02:01:28 -07:00
Junio C Hamano a49eb197d8 Merge branch 'ph/submodule-rebase'
* ph/submodule-rebase:
  git-submodule: add support for --merge.

Conflicts:
	Documentation/git-submodule.txt
	git-submodule.sh
2009-06-20 21:51:13 -07:00
Junio C Hamano c28a17f270 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
2009-06-20 21:47:30 -07:00
Junio C Hamano deded16d15 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
2009-06-20 21:47:27 -07:00
Junio C Hamano 12d4ffaa94 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
2009-06-20 21:47:13 -07:00
Junio C Hamano 451316d9bd Merge branch 'pb/send-email-cccmd-fix'
* pb/send-email-cccmd-fix:
  Test cccmd in t9001-send-email.sh and fix some bugs
2009-06-20 21:47:06 -07:00
Junio C Hamano 09236d8048 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
2009-06-20 21:46:38 -07:00
Stephen Boyd ed342fdea0 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>
2009-06-18 12:20:36 -07:00
Stephen Boyd fcdd0e92d9 stash: teach quiet option
Teach stash pop, apply, save, and drop to be quiet when told. By using
the quiet option (-q), these actions will be silent unless errors are
encountered.

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-18 11:54:57 -07:00
Stephen Boyd 0e987a12fc am, rebase: teach quiet option
git-am and git-rebase are talkative scripts. Teach them to be quiet when
told, allowing them to speak only when they fail or experience errors.

The quiet option is maintained when git-am or git-rebase fails to apply
a patch. This means subsequent --resolved, --continue, --skip, --abort
invocations will be quiet if the original invocation was quiet.

Drop a handful of >&2 redirection; the rest of the program sends all the
info messages to stdout, not to stderr.

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

This test ensures that fix stays valid.

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-18 09:50:14 -07:00
Uwe Kleine-König 6e0800ef25 parse-opt: make PARSE_OPT_STOP_AT_NON_OPTION available to git rev-parse
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-13 17:08:37 -07:00
Uwe Kleine-König 824af25ace more tests for git rev-parse --parse-opt
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-13 17:08:21 -07:00
Nick Edelen df533f34a3 diff-tree -r -t: include added/removed directories in the output
We used to include only the modified and typechanged directories
in the ouptut, but for consistency's sake, we should also include
added and removed ones as well.

This makes the output more consistent, but it may break existing scripts
that expect to see the current output which has long been the established
behaviour.

Signed-off-by: Nick Edelen <sirnot@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-13 17:06:09 -07:00
Junio C Hamano 08ba24898a Merge branch 'mh/fix-send-email-threaded'
* mh/fix-send-email-threaded:
  send-email: fix a typo in a comment
  send-email: fix threaded mails without chain-reply-to
  add a test for git-send-email for threaded mails without chain-reply-to
  doc/send-email: clarify the behavior of --in-reply-to with --no-thread
  send-email: fix non-threaded mails
  add a test for git-send-email for non-threaded mails
2009-06-13 12:55:50 -07:00
Junio C Hamano e2486193c5 Merge branch 'rc/http-push'
* rc/http-push: (22 commits)
  http*: add helper methods for fetching objects (loose)
  http*: add helper methods for fetching packs
  http: use new http API in fetch_index()
  http*: add http_get_info_packs
  http-push.c::fetch_symref(): use the new http API
  http-push.c::remote_exists(): use the new http API
  http.c::http_fetch_ref(): use the new http API
  transport.c::get_refs_via_curl(): use the new http API
  http.c: new functions for the http API
  http: create function end_url_with_slash
  http*: move common variables and macros to http.[ch]
  transport.c::get_refs_via_curl(): do not leak refs_url
  Don't expect verify_pack() callers to set pack_size
  http-push: do not SEGV after fetching a bad pack idx file
  http*: copy string returned by sha1_to_hex
  http-walker: verify remote packs
  http-push, http-walker: style fixes
  t5550-http-fetch: test fetching of packed objects
  http-push: fix missing "#ifdef USE_CURL_MULTI" around "is_running_queue"
  http-push: send out fetch requests on queue
  ...
2009-06-13 12:53:19 -07:00
Junio C Hamano cec3f989da Merge branch 'cc/bisect' (early part)
* 'cc/bisect' (early part):
  t6030: test skipping away from an already skipped commit
  bisect: when skipping, choose a commit away from a skipped commit
  bisect: add parameters to "filter_skipped"
  bisect: display first bad commit without forking a new process
  bisect: drop unparse_commit() and use clear_commit_marks()
2009-06-13 12:53:06 -07:00
Junio C Hamano 0a17b2cd7e Merge branch 'cb/maint-no-double-merge'
* cb/maint-no-double-merge:
  refuse to merge during a merge
2009-06-13 12:50:22 -07:00
Junio C Hamano 7d40f89137 Merge branch 'ph/submodule-rebase' (early part)
* 'ph/submodule-rebase' (early part):
  Rename submodule.<name>.rebase to submodule.<name>.update
  git-submodule: add support for --rebase.

Conflicts:
	Documentation/git-submodule.txt
	git-submodule.sh
2009-06-13 12:49:50 -07:00
Junio C Hamano 49c7e4643b Merge branch 'nw/maint-cvsexportcommit'
* nw/maint-cvsexportcommit:
  git-cvsexportcommit can't commit files which have been removed from CVS
2009-06-13 12:47:47 -07:00
Christian Couder ebc9529f03 bisect: use a PRNG with a bias when skipping away from untestable commits
Using a PRNG (pseudo random number generator) with a bias should be better
than alternating between 3 fixed ratios.

In repositories with many untestable commits it should prevent alternating
between areas where many commits are untestable. The bias should favor
commits that can give more information, so that the bisection process
should not loose much efficiency.

HPA suggested to use a PRNG and found that the best bias is to raise a
ratio between 0 and 1 given by the PRNG to the power 1.5.

An integer square root function is implemented to avoid including
<math.h> and linking with -lm.

A PRNG function is implemented to get the same number sequence on
different machines as suggested by "man 3 rand".

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-13 10:47:34 -07:00
Michael J Gruber 857f8c30d7 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>
2009-06-13 10:31:33 -07:00
Junio C Hamano 95a877a34c Merge branch 'mh/maint-fix-send-email-threaded' into mh/fix-send-email-threaded
* mh/maint-fix-send-email-threaded:
  doc/send-email: clarify the behavior of --in-reply-to with --no-thread
  send-email: fix non-threaded mails
  add a test for git-send-email for non-threaded mails

Conflicts:
	git-send-email.perl
	t/t9001-send-email.sh
2009-06-12 09:23:43 -07:00
Markus Heidelberg f74fe34b96 send-email: fix threaded mails without chain-reply-to
An earlier commit 15da108 ("send-email: 'References:' should only
reference what is sent", 2009-04-13) broke logic to set up threading
information for the next message by rewriting "!" to "not" without
understanding the precedence rules of the language.

Namely,

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

was changed to

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

which is

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

and different from what was intended, which is

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

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

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

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

Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-12 09:20:21 -07:00
Markus Heidelberg 32ae83194b add a test for git-send-email for non-threaded mails
Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-12 09:20:18 -07:00
Santi Béjar e9460a66e0 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>
2009-06-11 19:50:34 -07:00
Nick Edelen f0cea83f63 Shift object enumeration out of upload-pack
Offload object enumeration in upload-pack to pack-objects, but fall
back on internal revision walker for shallow interaction.   Aside from
architecturally making more sense, this also leaves the door open for
pack-objects to employ a revision cache mechanism.  Test t5530 updated
in order to explicitly check both enumeration methods.

Signed-off-by: Nick Edelen <sirnot@gmail.com>
Acked-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-09 23:49:31 -07:00
Michael J Gruber e1ca424112 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>
2009-06-09 23:46:47 -07:00
Brandon Casey d1fff6fce0 send-email: use UTF-8 rather than utf-8 for consistency
The rest of the git source has been converted to use upper-case character
encoding names to assist older platforms.  The charset attribute of MIME
is defined to be case-insensitive, but older platforms may still have an
easier time dealing with upper-case rather than lower-case.  So do so for
send-email too.

Update t9001 to handle the changes.

Signed-off-by: Brandon Casey <drafnel@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-09 00:15:57 -07:00
Christian Couder a66037c975 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>
2009-06-06 11:26:56 -07:00
Tay Ray Chuan 96a4f18735 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>
2009-06-06 10:56:27 -07:00
Tay Ray Chuan 4f66250df6 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>
2009-06-06 10:56:27 -07:00
Tay Ray Chuan 86d99f6d5c 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>
2009-06-06 10:56:27 -07:00
Tay Ray Chuan 242a90778b 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>
2009-06-06 10:56:27 -07:00
Junio C Hamano b11cf09043 Merge branch 'da/pretty-tempname'
* da/pretty-tempname:
  diff: generate pretty filenames in prep_temp_blob()
  compat: add a basename() compatibility function
  compat: add a mkstemps() compatibility function

Conflicts:
	Makefile
2009-06-03 00:50:05 -07:00
Junio C Hamano 433e972aeb Merge branch 'maint'
* maint:
  blame: correctly handle a path that used to be a directory
  add -i: do not dump patch during application
  Update draft release notes for 1.6.3.2
  grep: fix colouring of matches with zero length
  Documentation: teach stash/pop workflow instead of stash/apply
  Change xdl_merge to generate output even for null merges
  t6023: merge-file fails to output anything for a degenerate merge
2009-06-03 00:49:40 -07:00
Junio C Hamano a9b2d42486 blame: correctly handle a path that used to be a directory
When trying to see if the same path exists in the parent, we ran
"diff-tree" with pathspec set to the path we are interested in with the
parent, and expect either to have exactly one resulting filepair (either
"changed from the parent", "created when there was none") or nothing (when
there is no change from the parent).

If the path used to be a directory, however, we will also see unbounded
number of entries that talk about the files that used to exist underneath
the directory in question.  Correctly pick only the entry that describes
the path we are interested in in such a case (namely, the creation of the
path as a regular file).

Noticed by Ben Willard.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-03 00:49:34 -07:00
Johan Herland 42b4917862 git-submodule: add support for --merge.
'git submodule update --merge' merges the commit referenced by the
superproject into your local branch, instead of checking it out on
a detached HEAD.

As evidenced by the addition of "git submodule update --rebase", it
is useful to provide alternatives to the default 'checkout' behaviour
of "git submodule update". One such alternative is, when updating a
submodule to a new commit, to merge that commit into the current
local branch in that submodule. This is useful in workflows where
you want to update your submodule from its upstream, but you cannot
use --rebase, because you have downstream people working on top of
your submodule branch, and you don't want to disrupt their work.

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-03 00:09:16 -07:00
Johan Herland 329484256e Rename submodule.<name>.rebase to submodule.<name>.update
The addition of "submodule.<name>.rebase" demonstrates the usefulness of
alternatives to the default behaviour of "git submodule update". However,
by naming the config variable "submodule.<name>.rebase", and making it a
boolean choice, we are artificially constraining future git versions that
may want to add _more_ alternatives than just "rebase".

Therefore, while "submodule.<name>.rebase" is not yet in a stable git
release, future-proof it, by changing it from

  submodule.<name>.rebase = true/false

to

  submodule.<name>.update = rebase/checkout

where "checkout" specifies the default behaviour of "git submodule update"
(checking out the new commit to a detached HEAD), and "rebase" specifies
the --rebase behaviour (where the current local branch in the submodule is
rebase onto the new commit). Thus .update == checkout is equivalent to
.rebase == false, and .update == rebase is equivalent to .rebase == true.
Finally, leaving .update unset is equivalent to leaving .rebase unset.

In future git versions, other alternatives to "git submodule update"
behaviour can be included by adding them to the list of allowable values
for the submodule.<name>.update variable.

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-03 00:04:52 -07:00
Junio C Hamano 456cb4cf3e Merge branch 'cb/maint-1.6.0-xdl-merge-fix' into maint
* cb/maint-1.6.0-xdl-merge-fix:
  Change xdl_merge to generate output even for null merges
  t6023: merge-file fails to output anything for a degenerate merge

Conflicts:
	xdiff/xmerge.c
2009-06-02 07:48:44 -07:00
Junio C Hamano 3489428367 Merge branch 'rs/maint-grep-word-regexp-fix' into maint
* rs/maint-grep-word-regexp-fix:
  grep: fix colouring of matches with zero length
  grep: fix word-regexp at the beginning of lines
2009-06-02 07:48:09 -07:00
Junio C Hamano b91ffd37d5 Merge branch 'sb/maint-1.6.2-opt-filename-fix' into maint
* sb/maint-1.6.2-opt-filename-fix:
  apply, fmt-merge-msg: use relative filenames
  commit: -F overrides -t
2009-06-02 07:47:03 -07:00
Junio C Hamano f2823263bd Merge branch 'jc/maint-add-p-coalesce-fix' into maint
* jc/maint-add-p-coalesce-fix:
  t3701: ensure correctly set up repository after skipped tests
  Revert "git-add--interactive: remove hunk coalescing"
  Splitting a hunk that adds a line at the top fails in "add -p"
2009-06-02 07:46:52 -07:00
Clemens Buchacher a5adcbe377 test-lib: fix http exit codes
Previously, die() would report the exit code of stop_httpd. Instead,
save and reset the exit code before dying.

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-01 22:45:01 -07:00
Clemens Buchacher 6e7b5aaf40 test-lib: allow exit trap to be used for cleanup by tests
Exit trap should not be removed in case tests require cleanup code. This
is especially important if tests are executed with the --immediate option.

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-01 22:44:54 -07:00
Clemens Buchacher 1f729dca93 test-lib: fail if invalid options are passed
Previously, unknown options would be ignored, including any subsequent
valid options.

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-01 22:44:51 -07:00
Clemens Buchacher c8c562a238 refuse to merge during a merge
The following is an easy mistake to make for users coming from version
control systems with an "update and commit"-style workflow.

        1. git pull
        2. resolve conflicts
        3. git pull

Step 3 overrides MERGE_HEAD, starting a new merge with dirty index.
IOW, probably not what the user intended. Instead, refuse to merge
again if a merge is in progress.

Reported-by: Dave Olszewski <cxreg@pobox.com>
Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-06-01 19:42:17 -07:00
David Aguilar 003b33a8ad diff: generate pretty filenames in prep_temp_blob()
Naturally, prep_temp_blob() did not care about filenames.
As a result, GIT_EXTERNAL_DIFF and textconv generated
filenames such as ".diff_XXXXXX".

This modifies prep_temp_blob() to generate user-friendly
filenames when creating temporary files.

Diffing "name.ext" now generates "XXXXXX_name.ext".

Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-05-31 17:57:59 -07:00
Junio C Hamano f9275c68af Merge branch 'sb/opt-filename'
* sb/opt-filename:
  parse-opts: add OPT_FILENAME and transition builtins
  parse-opts: prepare for OPT_FILENAME

Conflicts:
	builtin-log.c
2009-05-31 16:57:42 -07:00
Junio C Hamano 128b0c08ca Merge branch 'jc/mktree'
* jc/mktree:
  mktree: validate entry type in input
  mktree --batch: build more than one tree object
  mktree --missing: updated usage message and man page
  mktree --missing: allow missing objects
  t1010: add mktree test
  mktree: do not barf on a submodule commit
  builtin-mktree.c: use a helper function to handle one line of input
  mktree: use parse-options
  build-in git-mktree
2009-05-31 16:17:11 -07:00
Junio C Hamano 22cdab5b3f Merge branch 'ew/svn-test-and-old-i18n'
* ew/svn-test-and-old-i18n:
  t8005: fix typo, it's ISO-8859-5, not KOI8-R
  t8005: convert CP1251 character set to ISO8859-5
  t8005: use more portable character encoding names
  t5100: use ancient encoding syntax for backwards compatibility
  t9301: use ISO8859-1 rather than ISO-8859-1
  t3901: Use ISO8859-1 instead of ISO-8859-1 for backward compatibility
  t3901: avoid negation on right hand side of '|'
  builtin-mailinfo.c: use "ISO8859-1" instead of "latin1" as fallback encoding
  builtin-mailinfo.c: compare character encodings case insensitively
  Use 'UTF-8' rather than 'utf-8' everywhere for backward compatibility
  t3900: use ancient iconv names for backward compatibility
2009-05-31 16:17:07 -07:00
Junio C Hamano 1136e2c642 Merge branch 'cc/bisect' (early part)
* 'cc/bisect' (early part):
  bisect: check ancestors without forking a "git rev-list" process
  commit: add function to unparse a commit and its parents
  bisect: rework some rev related functions to make them more reusable
2009-05-31 16:16:48 -07:00
Jeff King 6e4f981ffb git-add: no need for -f when resolving a conflict in already tracked path
When a path F that matches ignore pattern has a conflict, "git add F"
insisted the -f option be given, which did not make sense.  It would have
required -f when the path was originally added, but when resolving a
conflict, it already is tracked.

So this should work (and does):

  $ echo file >.gitignore
  $ echo content >file
  $ git add -f file ;# need -f because we are adding new path
  $ echo more content >>file
  $ git add file ;# don't need -f; it is not actually an "other" file

This is handled under the hood by the COLLECT_IGNORED option to
read_directory. When that code finds an ignored file, it checks the
index to make sure it is not actually a tracked file. However, the test
it uses does not take into account unmerged entries, and considers them
to still be ignored. "git ls-files" uses a more elaborate test and gets
the right answer and the same test should be used here.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-05-31 15:59:16 -07:00
Eric Wong 188643140b t9139 uses ancient, backwards-compatible iconv names
This resolves a semantic conflicts early to work with 5ae93df (t3900: use
ancient iconv names for backward compatibility, 2009-05-18).

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-05-30 22:30:55 -07:00
Junio C Hamano 0ddbbb6661 Merge git://git.bogomips.org/git-svn
* git://git.bogomips.org/git-svn:
  git-svn: refuse to dcommit non-UTF-8 messages
2009-05-30 22:25:41 -07:00
Junio C Hamano 9affecbc89 Merge branch 'sb/maint-1.6.2-opt-filename-fix'
* sb/maint-1.6.2-opt-filename-fix:
  apply, fmt-merge-msg: use relative filenames
  commit: -F overrides -t
2009-05-29 15:01:16 -07:00
Junio C Hamano 659f096896 Merge branch 'jc/maint-add-p-coalesce-fix'
* jc/maint-add-p-coalesce-fix:
  t3701: ensure correctly set up repository after skipped tests
  Revert "git-add--interactive: remove hunk coalescing"
  Splitting a hunk that adds a line at the top fails in "add -p"
2009-05-29 15:00:15 -07:00
Junio C Hamano 8e105e3928 Merge branch 'rs/maint-grep-word-regexp-fix'
* rs/maint-grep-word-regexp-fix:
  grep: fix word-regexp at the beginning of lines
2009-05-29 14:59:50 -07:00
Stephen Boyd 3be7e06713 t9120: don't expect failure with SVN_HTTPD_PORT unset
The test still passes when SVN_HTTPD_PORT is not set. Futhermore, t9115
and t9118 don't check if SVN_HTTPD_PORT is set even though they both use
start_httpd() from lib-git-svn.sh. Admittedly, the test is not very
meaningful without SVN_HTTPD_PORT, as commit f5530b (support for funky
branch and project names over HTTP(S) 2007-11-11) states that the URI
escaping is only done over HTTP(S).

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-05-29 00:53:43 -07:00
Nick Woolley 54d5cc0e12 git-cvsexportcommit can't commit files which have been removed from CVS
If a file X is removed from CVS, it goes into the Attic directory, and CVS
reports it as 'no file X' but with status 'Up-to-date'.  cvsexportcommit
misinterprets this as an existing file and tries to commit a file with the
same name.  Correctly identify these files, so that new files with the
same name can be committed.

Add a test to t9200-git-cvsexportcommit.sh, which tests that we can
re-commit a removed filename which remains in CVS's attic. This adds a
file 'attic_gremlin' in CVS, then "removes" it, then tries to commit a
file with the same name from git.

Signed-off-by: Nick Woolley <git.wu-lee@noodlefactory.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-05-28 23:51:03 -07:00
Junio C Hamano a9d29038a7 Merge branch 'maint'
* maint:
  fix segfault showing an empty remote
2009-05-28 22:50:23 -07:00
Eric Wong b510df8af2 git-svn: refuse to dcommit non-UTF-8 messages
...without i18n.commitencoding set in the config.

SVN tries to store all commit messages in UTF-8, however it is
up to the job of the clients to enforce this rule.  SVN servers
themselves do not always enforce this; allowing clients to
commit malformed UTF-8 messages and break repositories.

So git-svn will enforce this and tell the user to set
i18n.commitencoding when a git commit is is not in UTF-8.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
2009-05-28 00:57:07 -07:00
Clemens Buchacher 6a01554e63 fix segfault showing an empty remote
In case of an empty list, the search for its tail caused a
NULL-pointer dereference.

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Reported-by: Erik Faye-Lund <kusmabite@googlemail.com>
Acked-by: Jay Soffian <jaysoffian@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-05-27 23:16:16 -07:00
Brandon Casey ed43bc8c4c t8005: fix typo, it's ISO-8859-5, not KOI8-R
Signed-off-by: Brandon Casey <drafnel@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-05-27 20:24:55 -07:00
Stephen Boyd 3902985a58 t5500: Modernize test style
Code outside of the test harness was emitting "Initializing..." from
git-init. Fixup this test to be more modern:

    - test_expect_object_count() and count_objects() are unused

    - use grep directly instead of test "..." = $(grep ...)

    - end the test_expect_success line with a single-quote and put the
      test on a new line

    - put as much code inside the test harness as possible

    - no_strict_count_check is unused and duplicates the test
      "new object count"

    - use && whenever possible to catch errors early

    - use test_tick instead of GIT_AUTHOR_DATE=$sec

    - remove debugging aid log.txt

    - use subshells instead of cd-ing around

Also merge the pull test into one large test.

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-05-27 00:06:12 -07:00