Code

git.git
14 years agoMerge branch 'jc/maint-fix-mailinfo-strip'
Junio C Hamano [Sun, 7 Mar 2010 20:47:14 +0000 (12:47 -0800)]
Merge branch 'jc/maint-fix-mailinfo-strip'

* jc/maint-fix-mailinfo-strip:
  mailinfo: do not strip leading spaces even for a header line

14 years agocolor: allow multiple attributes
Junio C Hamano [Sun, 28 Feb 2010 02:56:38 +0000 (18:56 -0800)]
color: allow multiple attributes

In configuration files (and "git config --color" command line), we
supported one and only one attribute after foreground and background
color.  Accept combinations of attributes, e.g.

    [diff.color]
            old = red reverse bold

Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoSync with 1.7.0.2
Junio C Hamano [Sun, 7 Mar 2010 19:09:47 +0000 (11:09 -0800)]
Sync with 1.7.0.2

14 years agoAdd GIT_COLOR_BOLD_* and GIT_COLOR_BG_*
Mark Lodato [Sun, 7 Mar 2010 16:52:45 +0000 (11:52 -0500)]
Add GIT_COLOR_BOLD_* and GIT_COLOR_BG_*

Add GIT_COLOR_BOLD_* macros to set both bold and the color in one
sequence.  This saves two characters of output ("ESC [ m", minus ";")
and makes the code more readable.

Add the remaining GIT_COLOR_BG_* macros to make the list complete.
The white and black colors are not included since they look bad on most
terminals.

Signed-off-by: Mark Lodato <lodatom@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoGit 1.7.0.2 v1.7.0.2
Junio C Hamano [Sun, 7 Mar 2010 19:07:51 +0000 (11:07 -0800)]
Git 1.7.0.2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agounset GREP_OPTIONS in test-lib.sh
Bert Wesarg [Wed, 18 Nov 2009 16:15:19 +0000 (17:15 +0100)]
unset GREP_OPTIONS in test-lib.sh

I used to set GREP_OPTIONS to exclude *.orig and *.rej files. But with this
the test t4252-am-options.sh fails because it calls grep with a .rej file:

    grep "@@ -1,3 +1,3 @@" file-2.rej

Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'maint'
Junio C Hamano [Sun, 7 Mar 2010 08:02:15 +0000 (00:02 -0800)]
Merge branch 'maint'

* maint:
  stash: suggest the correct command line for unknown options.
  t7406: Fix submodule init config tests

14 years agoDocumentation: describe new cherry-pick --ff option
Christian Couder [Sat, 6 Mar 2010 20:34:44 +0000 (21:34 +0100)]
Documentation: describe new cherry-pick --ff option

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agocherry-pick: add tests for new --ff option
Christian Couder [Sat, 6 Mar 2010 20:34:43 +0000 (21:34 +0100)]
cherry-pick: add tests for new --ff option

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agorevert: add --ff option to allow fast forward when cherry-picking
Junio C Hamano [Sat, 6 Mar 2010 20:34:42 +0000 (21:34 +0100)]
revert: add --ff option to allow fast forward when cherry-picking

As "git merge" fast forwards if possible, it seems sensible to
have such a feature for "git cherry-pick" too, especially as it
could be used in git-rebase--interactive.sh.

Maybe this option could be made the default in the long run, with
another --no-ff option to disable this default behavior, but that
could make some scripts backward incompatible and/or that would
require testing if some GIT_AUTHOR_* environment variables are
set. So we don't do that for now.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agobuiltin/merge: make checkout_fast_forward() non static
Junio C Hamano [Sat, 6 Mar 2010 20:34:41 +0000 (21:34 +0100)]
builtin/merge: make checkout_fast_forward() non static

and also export it in "cache.h".

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoparse-options: add parse_options_concat() to concat options
Junio C Hamano [Sat, 6 Mar 2010 20:34:40 +0000 (21:34 +0100)]
parse-options: add parse_options_concat() to concat options

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agot3417: Add test cases for "rebase --whitespace=fix"
Björn Gustavsson [Sat, 6 Mar 2010 14:31:17 +0000 (15:31 +0100)]
t3417: Add test cases for "rebase --whitespace=fix"

The command "git rebase --whitespace=fix HEAD~<N>" is supposed to
only clean up trailing whitespace, and the expectation is that it
cannot fail.

Unfortunately, if one commit adds a blank line at the end of a file
and a subsequent commit adds more non-blank lines after the blank
line, "git apply" (used indirectly by "git rebase") will fail to apply
the patch of the second commit.

Signed-off-by: Björn Gustavsson <bgustavsson@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agot4124: Add additional tests of --whitespace=fix
Björn Gustavsson [Sat, 6 Mar 2010 14:31:04 +0000 (15:31 +0100)]
t4124: Add additional tests of --whitespace=fix

Signed-off-by: Björn Gustavsson <bgustavsson@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoapply: Allow blank context lines to match beyond EOF
Björn Gustavsson [Sat, 6 Mar 2010 14:30:42 +0000 (15:30 +0100)]
apply: Allow blank context lines to match beyond EOF

"git apply --whitespace=fix" will not always succeed when used
on a series of patches in the following circumstances:

* One patch adds a blank line at the end of a file. (Since
  --whitespace=fix is used, the blank line will *not* be added.)

* The next patch adds non-blank lines after the blank line
  introduced in the first patch. That patch will not apply
  because the blank line that is expected to be found at end
  of the file is no longer there.

A patch series that starts by deleting lines at the end
will fail in a similar way.

Fix this problem by allowing a blank context line at the beginning
of a hunk to match if parts of it falls beyond end of the file.
We still require that at least one non-blank context line match
before the end of the file.

If the --ignore-space-change option is given (as well as the
--whitespace=fix option), blank context lines falling beyond the end
of the file will be copied unchanged to the target file (i.e. they
will have the same line terminators and extra spaces will not be
removed).

Signed-off-by: Björn Gustavsson <bgustavsson@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoapply: Remove the quick rejection test
Björn Gustavsson [Sat, 6 Mar 2010 14:30:29 +0000 (15:30 +0100)]
apply: Remove the quick rejection test

In the next commit, we will make it possible for blank context
lines to match beyond the end of the file. That means that a hunk
with a preimage that has more lines than present in the file may
be possible to successfully apply. Therefore, we must remove
the quick rejection test in find_pos().

find_pos() will already work correctly without the quick
rejection test, but that might not be obvious. Therefore,
comment the test for handling out-of-range line numbers in
find_pos() and cast the "line" variable to the same (unsigned)
type as img->nr.

What are performance implications of removing the quick
rejection test?

It can only help "git apply" to reject a patch faster. For example,
if I have a file with one million lines and a patch that removes
slightly more than 50 percent of the lines and try to apply that
patch twice, the second attempt will fail slightly faster
with the test than without (based on actual measurements).

However, there is the pathological case of a patch with many
more context lines than the default three, and applying that patch
using "git apply -C1". Without the rejection test, the running
time will be roughly proportional to the number of context lines
times the size of the file. That could be handled by writing
a more complicated rejection test (it would have to count the
number of blanks at the end of the preimage), but I don't find
that worth doing until there is a real-world use case that
would benfit from it.

It would be possible to keep the quick rejection test if
--whitespace=fix is not given, but I don't like that from
a testing point of view.

Signed-off-by: Björn Gustavsson <bgustavsson@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoapply: Don't unnecessarily update line lengths in the preimage
Björn Gustavsson [Sat, 6 Mar 2010 14:30:21 +0000 (15:30 +0100)]
apply: Don't unnecessarily update line lengths in the preimage

In match_fragment(), the line lengths in the preimage are updated
just before calling update_pre_post_images(). That is not
necessary, since update_pre_post_images() itself will
update the line lengths based on the buffer passed to it.

Signed-off-by: Björn Gustavsson <bgustavsson@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoreset: disallow using --keep when there are unmerged entries
Christian Couder [Tue, 19 Jan 2010 04:26:01 +0000 (05:26 +0100)]
reset: disallow using --keep when there are unmerged entries

The use case for --keep option is to remove previous commits unrelated
to the current changes in the working tree. So in this use case we are
not supposed to have unmerged entries. This is why it seems safer to
just disallow using --keep when there are unmerged entries.

And this patch changes the error message when --keep was disallowed and
there were some unmerged entries from:

    error: Entry 'file1' would be overwritten by merge. Cannot merge.
    fatal: Could not reset index file to revision 'HEAD^'.

to:

    fatal: Cannot do a keep reset in the middle of a merge.

which is nicer.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoreset: disallow "reset --keep" outside a work tree
Christian Couder [Tue, 19 Jan 2010 04:26:00 +0000 (05:26 +0100)]
reset: disallow "reset --keep" outside a work tree

It is safer and consistent with "--merge" and "--hard" resets to disallow
"git reset --keep" outside a work tree.

So let's just do that and add some tests while at it.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoDocumentation: reset: describe new "--keep" option
Christian Couder [Fri, 5 Mar 2010 20:25:36 +0000 (21:25 +0100)]
Documentation: reset: describe new "--keep" option

and give an example to show how it can be used.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agostash: suggest the correct command line for unknown options.
Matthieu Moy [Fri, 5 Mar 2010 18:43:23 +0000 (19:43 +0100)]
stash: suggest the correct command line for unknown options.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agot7406: Fix submodule init config tests
Stephen Boyd [Fri, 5 Mar 2010 08:20:38 +0000 (00:20 -0800)]
t7406: Fix submodule init config tests

These tests have been broken since they were introduced in commits
ca2cedb (git-submodule: add support for --rebase., 2009-04-24) and
42b4917 (git-submodule: add support for --merge., 2009-06-03).
'git submodule init' expects the submodules to exist in the index.
In this case, the submodules don't exist and therefore looking for
the submodules will always fail. To make matters worse, git submodule
fails visibly to the user by saying:

error: pathspec 'rebasing' did not match any file(s) known to git.
Did you forget to 'git add'?

but doesn't return an error code. This allows the test to fail silently.
Fix it by adding the submodules first.

Cc: Johan Herland <johan@herland.net>
Cc: Peter Hutterer <peter.hutterer@who-t.net>
Cc: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoAdd 'git format-patch --to=' option and 'format.to' configuration variable.
Steven Drake [Tue, 16 Feb 2010 23:39:34 +0000 (12:39 +1300)]
Add 'git format-patch --to=' option and 'format.to' configuration variable.

Has the same functionality as the '--cc' option and 'format.cc'
configuration variable but for the "To:" email header.  Half of the code to
support this was already there.

With email the To: header usually more important than the Cc: header.

[jc: tests are by Stephen Boyd]

Signed-off-by: Steven Drake <sdrake@xnet.co.nz>
Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agogit-svn: make git svn --version work again
Michael J Gruber [Thu, 4 Mar 2010 10:23:53 +0000 (11:23 +0100)]
git-svn: make git svn --version work again

by requesting SVN::Core which is needed for the svn version.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Acked-by: Eric Wong <normalperson@yhbt.net>
14 years agoRevert "git-svn: always initialize with core.autocrlf=false"
Erik Faye-Lund [Wed, 3 Mar 2010 20:10:23 +0000 (21:10 +0100)]
Revert "git-svn: always initialize with core.autocrlf=false"

git-svn rebase used to have issues with CRLF conversion. Since these issues
have been fixed, we can safely revert the work-around that disables CRLF
conversion.

This reverts commit d3c9634eacdcaa71cbd69a160e6f4e80ddb7ab63.

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Acked-by: Eric Wong <normalperson@yhbt.net>
14 years agogit-svn: support fetch with autocrlf on
Erik Faye-Lund [Wed, 3 Mar 2010 20:10:22 +0000 (21:10 +0100)]
git-svn: support fetch with autocrlf on

Before commit d3c9634e, performing a "git svn rebase" that fetched a
change containing CRLFs corrupted the git-svn meta-data. This was
worked around in d3c9634e by setting core.autocrlf to "false" in the
per-repo config when initing the clone. However, if the config
variable was later changed, the corruption would still occur.

This patch tries to fix it while allowing core.autocrlf to be
enabled, by disabling filters when when hashing.

git-svn is currently the only call-site for hash_and_insert_object
(apart from the test-suite), so changing it should be safe.

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Acked-by: Eric Wong <normalperson@yhbt.net>
14 years agohash-object: support --stdin-paths with --no-filters
Erik Faye-Lund [Wed, 3 Mar 2010 20:10:21 +0000 (21:10 +0100)]
hash-object: support --stdin-paths with --no-filters

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Acked-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'maint'
Junio C Hamano [Fri, 5 Mar 2010 06:39:54 +0000 (22:39 -0800)]
Merge branch 'maint'

* maint:
  Update draft release notes to 1.7.0.2
  Remove extra '-' from git-am(1)

14 years agoUpdate draft release notes to 1.7.0.2
Junio C Hamano [Fri, 5 Mar 2010 06:39:38 +0000 (22:39 -0800)]
Update draft release notes to 1.7.0.2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'jn/gitweb-config-error-die' into maint
Junio C Hamano [Fri, 5 Mar 2010 06:27:12 +0000 (22:27 -0800)]
Merge branch 'jn/gitweb-config-error-die' into maint

* jn/gitweb-config-error-die:
  gitweb: Die if there are parsing errors in config file

14 years agoMerge branch 'jn/maint-fix-pager' into maint
Junio C Hamano [Fri, 5 Mar 2010 06:27:04 +0000 (22:27 -0800)]
Merge branch 'jn/maint-fix-pager' into maint

* jn/maint-fix-pager:
  tests: Fix race condition in t7006-pager
  t7006-pager: if stdout is not a terminal, make a new one
  tests: Add tests for automatic use of pager
  am: Fix launching of pager
  git svn: Fix launching of pager
  git.1: Clarify the behavior of the --paginate option
  Make 'git var GIT_PAGER' always print the configured pager
  Fix 'git var' usage synopsis

14 years agoMerge branch 'tr/maint-cherry-pick-list' into maint
Junio C Hamano [Fri, 5 Mar 2010 06:26:44 +0000 (22:26 -0800)]
Merge branch 'tr/maint-cherry-pick-list' into maint

* tr/maint-cherry-pick-list:
  cherry_pick_list: quit early if one side is empty

14 years agoMerge branch 'ld/maint-diff-quiet-w' into maint
Junio C Hamano [Fri, 5 Mar 2010 06:26:39 +0000 (22:26 -0800)]
Merge branch 'ld/maint-diff-quiet-w' into maint

* ld/maint-diff-quiet-w:
  git-diff: add a test for git diff --quiet -w
  git diff --quiet -w: check and report the status

14 years agoMerge branch 'rs/optim-text-wrap' into maint
Junio C Hamano [Fri, 5 Mar 2010 06:26:33 +0000 (22:26 -0800)]
Merge branch 'rs/optim-text-wrap' into maint

* rs/optim-text-wrap:
  utf8.c: speculatively assume utf-8 in strbuf_add_wrapped_text()
  utf8.c: remove strbuf_write()
  utf8.c: remove print_spaces()
  utf8.c: remove print_wrapped_text()

14 years agoMerge branch 'dp/read-not-mmap-small-loose-object' into maint
Junio C Hamano [Fri, 5 Mar 2010 06:26:17 +0000 (22:26 -0800)]
Merge branch 'dp/read-not-mmap-small-loose-object' into maint

* dp/read-not-mmap-small-loose-object:
  hash-object: don't use mmap() for small files

14 years agoMerge branch 'np/compress-loose-object-memsave' into maint
Junio C Hamano [Fri, 5 Mar 2010 06:26:05 +0000 (22:26 -0800)]
Merge branch 'np/compress-loose-object-memsave' into maint

* np/compress-loose-object-memsave:
  sha1_file: be paranoid when creating loose objects
  sha1_file: don't malloc the whole compressed result when writing out objects

14 years agoMerge branch 'jc/maint-status-preload' into maint
Junio C Hamano [Fri, 5 Mar 2010 06:25:45 +0000 (22:25 -0800)]
Merge branch 'jc/maint-status-preload' into maint

* jc/maint-status-preload:
  status: preload index to optimize lstat(2) calls

14 years agoMerge branch 'gf/maint-sh-setup-nongit-ok' into maint
Junio C Hamano [Fri, 5 Mar 2010 06:25:37 +0000 (22:25 -0800)]
Merge branch 'gf/maint-sh-setup-nongit-ok' into maint

* gf/maint-sh-setup-nongit-ok:
  require_work_tree broken with NONGIT_OK

14 years agoMerge branch 'cc/maint-bisect-paths' into maint
Junio C Hamano [Fri, 5 Mar 2010 06:25:23 +0000 (22:25 -0800)]
Merge branch 'cc/maint-bisect-paths' into maint

* cc/maint-bisect-paths:
  bisect: error out when passing bad path parameters

14 years agoMerge branch 'maint-1.6.6' into maint
Junio C Hamano [Fri, 5 Mar 2010 06:24:25 +0000 (22:24 -0800)]
Merge branch 'maint-1.6.6' into maint

* maint-1.6.6:
  Remove extra '-' from git-am(1)

14 years agoMerge branch 'maint-1.6.5' into maint-1.6.6
Junio C Hamano [Fri, 5 Mar 2010 06:24:19 +0000 (22:24 -0800)]
Merge branch 'maint-1.6.5' into maint-1.6.6

* maint-1.6.5:
  Remove extra '-' from git-am(1)

14 years agogit diff --submodule: Show detailed dirty status of submodules
Jens Lehmann [Thu, 4 Mar 2010 21:20:33 +0000 (22:20 +0100)]
git diff --submodule: Show detailed dirty status of submodules

When encountering a dirty submodule while doing "git diff --submodule"
print an extra line for new untracked content and another for modified
but already tracked content. And if the HEAD of the submodule is equal
to the ref diffed against in the superproject, drop the output which
would just show the same SHA1s and no commit message headlines.

To achieve that, the dirty_submodule bitfield is expanded to two bits.
The output of "git status" inside the submodule is parsed to set the
according bits.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agogit-core: Support retrieving passwords with GIT_ASKPASS
Frank Li [Thu, 4 Mar 2010 19:59:50 +0000 (20:59 +0100)]
git-core: Support retrieving passwords with GIT_ASKPASS

git tries to read a password from the terminal in imap-send and
when talking to a http server that requires authentication.

When a GUI is driving git, however, the end user is not paying
attention to the terminal (there may not even be a terminal).
GUI would appear to hang forever.

Fix this problem by allowing a password-retrieving command
to be specified in GIT_ASKPASS

Signed-off-by: Frank Li <lznuaa@gmail.com>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoDocumentation: fix a few typos in git-notes.txt
Michael J Gruber [Thu, 4 Mar 2010 14:31:17 +0000 (15:31 +0100)]
Documentation: fix a few typos in git-notes.txt

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Acked-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoRemove extra '-' from git-am(1)
Michal Sojka [Thu, 4 Mar 2010 12:08:28 +0000 (13:08 +0100)]
Remove extra '-' from git-am(1)

Signed-off-by: Michal Sojka <sojkam1@fel.cvut.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agot9119-git-svn-info.sh: test with svn 1.6.* as well
Michael J Gruber [Wed, 3 Mar 2010 20:34:32 +0000 (21:34 +0100)]
t9119-git-svn-info.sh: test with svn 1.6.* as well

All tests in t9119 were disabled for subversion versions other than
1.[45].*. Make the test script run with subversion 1.[456].*.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Acked-by: Eric Wong <normalperson@yhbt.net>
14 years agogit-svn: req_svn when needed
Michael J Gruber [Wed, 3 Mar 2010 20:34:31 +0000 (21:34 +0100)]
git-svn: req_svn when needed

The delayed loading of SVN missed a place where SVN::Core is used. Make
sure to load the package before trying to use it.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Acked-by: Eric Wong <normalperson@yhbt.net>
14 years agorun-command.c: fix build warnings on Ubuntu
Michael Wookey [Fri, 29 Jan 2010 22:38:19 +0000 (09:38 +1100)]
run-command.c: fix build warnings on Ubuntu

Building git on Ubuntu 9.10 warns that the return value of write(2)
isn't checked. These warnings were introduced in commits:

  2b541bf8 ("start_command: detect execvp failures early")
  a5487ddf ("start_command: report child process setup errors to the
parent's stderr")

GCC details:

  $ gcc --version
  gcc (Ubuntu 4.4.1-4ubuntu9) 4.4.1

Silence the warnings by reading (but not making use of) the return value
of write(2).

Signed-off-by: Michael Wookey <michaelwookey@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'maint'
Junio C Hamano [Wed, 3 Mar 2010 22:56:13 +0000 (14:56 -0800)]
Merge branch 'maint'

* maint:
  Start preparing for 1.7.0.2

Conflicts:
RelNotes

14 years agoMerge branch 'jh/maint-submodule-status-in-void' (early part)
Junio C Hamano [Wed, 3 Mar 2010 22:50:22 +0000 (14:50 -0800)]
Merge branch 'jh/maint-submodule-status-in-void' (early part)

* 'jh/maint-submodule-status-in-void' (early part):
  submodule summary: do not shift a non-existent positional variable

14 years agosubmodule summary: do not fail before the first commit
Junio C Hamano [Wed, 3 Mar 2010 22:19:10 +0000 (14:19 -0800)]
submodule summary: do not fail before the first commit

When "git status" collects changes for the index (usually relative to
HEAD), it compares the index with an empty tree when the repository does
not have an initial commit yet.  "git submodule summary" is about asking
what submodule changes would be recorded if a commit is made right now,
and should do the same comparison to report all the added submodules,
instead of punting and being silent.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agosubmodule summary: do not shift a non-existent positional variable
Jeff King [Wed, 3 Mar 2010 22:19:09 +0000 (14:19 -0800)]
submodule summary: do not shift a non-existent positional variable

When "git submodule summary" is run without any argument, we default to
compare the state of index with the HEAD, but tried to shift out $1 that
does not exist (and worse yet, we didn't use it).

Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoStart preparing for 1.7.0.2
Junio C Hamano [Wed, 3 Mar 2010 07:11:36 +0000 (23:11 -0800)]
Start preparing for 1.7.0.2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'tc/maint-transport-ls-remote-with-void' into maint
Junio C Hamano [Wed, 3 Mar 2010 06:55:22 +0000 (22:55 -0800)]
Merge branch 'tc/maint-transport-ls-remote-with-void' into maint

* tc/maint-transport-ls-remote-with-void:
  transport: add got_remote_refs flag

14 years agoMerge branch 'hm/maint-imap-send-crlf' into maint
Junio C Hamano [Wed, 3 Mar 2010 06:55:03 +0000 (22:55 -0800)]
Merge branch 'hm/maint-imap-send-crlf' into maint

* hm/maint-imap-send-crlf:
  git-imap-send: Convert LF to CRLF before storing patch to draft box

14 years agoMerge branch 'sp/maint-push-sideband' into maint
Junio C Hamano [Wed, 3 Mar 2010 06:54:50 +0000 (22:54 -0800)]
Merge branch 'sp/maint-push-sideband' into maint

* sp/maint-push-sideband:
  receive-pack: Send internal errors over side-band #2
  t5401: Use a bare repository for the remote peer
  receive-pack: Send hook output over side band #2
  receive-pack: Wrap status reports inside side-band-64k
  receive-pack: Refactor how capabilities are shown to the client
  send-pack: demultiplex a sideband stream with status data
  run-command: support custom fd-set in async
  run-command: Allow stderr to be a caller supplied pipe

Conflicts:
builtin-receive-pack.c
run-command.c
t/t5401-update-hooks.sh

14 years agoMerge branch 'jc/maint-fix-test-perm' into maint
Junio C Hamano [Wed, 3 Mar 2010 06:38:02 +0000 (22:38 -0800)]
Merge branch 'jc/maint-fix-test-perm' into maint

* jc/maint-fix-test-perm:
  lib-patch-mode.sh: Fix permission
  t6000lib: Fix permission

14 years agoMerge branch 'np/fast-import-idx-v2' into maint
Junio C Hamano [Wed, 3 Mar 2010 06:28:49 +0000 (22:28 -0800)]
Merge branch 'np/fast-import-idx-v2' into maint

* np/fast-import-idx-v2:
  fast-import: use the diff_delta() max_delta_size argument
  fast-import: honor pack.indexversion and pack.packsizelimit config vars
  fast-import: make default pack size unlimited
  fast-import: use write_idx_file() instead of custom code
  fast-import: use sha1write() for pack data
  fast-import: start using struct pack_idx_entry

14 years agomerge-file: add option to select union merge favor
Bert Wesarg [Mon, 1 Mar 2010 21:46:28 +0000 (22:46 +0100)]
merge-file: add option to select union merge favor

Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agomerge-file: add option to specify the marker size
Bert Wesarg [Mon, 1 Mar 2010 21:46:27 +0000 (22:46 +0100)]
merge-file: add option to specify the marker size

This adds the abbility to specify the conflict marker size for merges outside
a git repository.

Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agowrap-for-bin: do not export an empty GIT_TEMPLATE_DIR
Junio C Hamano [Wed, 3 Mar 2010 00:27:03 +0000 (16:27 -0800)]
wrap-for-bin: do not export an empty GIT_TEMPLATE_DIR

With bash on some platforms (e.g. FreeBSD 8.0), exporting an unset
variable does not "unexport" it.  The called process gets an empty
string from getenv(3) instead of NULL.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agogit-svn: Support retrieving passwords with GIT_ASKPASS
Frank Li [Tue, 2 Mar 2010 11:47:52 +0000 (19:47 +0800)]
git-svn: Support retrieving passwords with GIT_ASKPASS

git-svn reads passwords from an interactive terminal.
This behavior cause GUIs to hang waiting for git-svn to
complete

Fix this problem by allowing a password-retrieving command
to be specified in GIT_ASKPASS. SSH_ASKPASS is supported
as a fallback when GIT_ASKPASS is not provided.

Signed-off-by: Frank Li <lznuaa@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'maint'
Junio C Hamano [Tue, 2 Mar 2010 20:44:16 +0000 (12:44 -0800)]
Merge branch 'maint'

* maint:
  gitweb: Fix project-specific feature override behavior
  gitweb multiple project roots documentation

14 years agoMerge branch 'jn/maint-fix-pager'
Junio C Hamano [Tue, 2 Mar 2010 20:44:11 +0000 (12:44 -0800)]
Merge branch 'jn/maint-fix-pager'

* jn/maint-fix-pager:
  tests: Fix race condition in t7006-pager
  t7006-pager: if stdout is not a terminal, make a new one
  tests: Add tests for automatic use of pager
  am: Fix launching of pager
  git svn: Fix launching of pager
  git.1: Clarify the behavior of the --paginate option
  Make 'git var GIT_PAGER' always print the configured pager
  Fix 'git var' usage synopsis

14 years agoMerge branch 'ml/encode-header-refactor'
Junio C Hamano [Tue, 2 Mar 2010 20:44:11 +0000 (12:44 -0800)]
Merge branch 'ml/encode-header-refactor'

* ml/encode-header-refactor:
  move encode_in_pack_object_header() to a better place
  refactor duplicated encode_header in pack-objects and fast-import

14 years agoMerge branch 'jn/gitweb-config-error-die'
Junio C Hamano [Tue, 2 Mar 2010 20:44:11 +0000 (12:44 -0800)]
Merge branch 'jn/gitweb-config-error-die'

* jn/gitweb-config-error-die:
  gitweb: Die if there are parsing errors in config file

14 years agoMerge branch 'jc/for-each-ref'
Junio C Hamano [Tue, 2 Mar 2010 20:44:10 +0000 (12:44 -0800)]
Merge branch 'jc/for-each-ref'

* jc/for-each-ref:
  for-each-ref --format='%(flag)'
  for-each-ref --format='%(symref) %(symref:short)'
  builtin-for-each-ref.c: check if we need to peel onion while parsing the format
  builtin-for-each-ref.c: comment fixes

14 years agoMerge branch 'ld/maint-diff-quiet-w'
Junio C Hamano [Tue, 2 Mar 2010 20:44:10 +0000 (12:44 -0800)]
Merge branch 'ld/maint-diff-quiet-w'

* ld/maint-diff-quiet-w:
  git-diff: add a test for git diff --quiet -w
  git diff --quiet -w: check and report the status

14 years agoMerge branch 'tr/maint-cherry-pick-list'
Junio C Hamano [Tue, 2 Mar 2010 20:44:10 +0000 (12:44 -0800)]
Merge branch 'tr/maint-cherry-pick-list'

* tr/maint-cherry-pick-list:
  cherry_pick_list: quit early if one side is empty

14 years agoMerge branch 'rs/optim-text-wrap'
Junio C Hamano [Tue, 2 Mar 2010 20:44:10 +0000 (12:44 -0800)]
Merge branch 'rs/optim-text-wrap'

* rs/optim-text-wrap:
  utf8.c: speculatively assume utf-8 in strbuf_add_wrapped_text()
  utf8.c: remove strbuf_write()
  utf8.c: remove print_spaces()
  utf8.c: remove print_wrapped_text()

14 years agoMerge branch 'ml/send-pack-transport-refactor'
Junio C Hamano [Tue, 2 Mar 2010 20:44:09 +0000 (12:44 -0800)]
Merge branch 'ml/send-pack-transport-refactor'

* ml/send-pack-transport-refactor:
  refactor duplicated code in builtin-send-pack.c and transport.c

14 years agoMerge branch 'ml/fill-mm-refactor'
Junio C Hamano [Tue, 2 Mar 2010 20:44:09 +0000 (12:44 -0800)]
Merge branch 'ml/fill-mm-refactor'

* ml/fill-mm-refactor:
  refactor duplicated fill_mm() in checkout and merge-recursive

14 years agoMerge branch 'ml/connect-refactor'
Junio C Hamano [Tue, 2 Mar 2010 20:44:09 +0000 (12:44 -0800)]
Merge branch 'ml/connect-refactor'

* ml/connect-refactor:
  connect.c: move duplicated code to a new function 'get_host_and_port'

14 years agoMerge branch 'np/compress-loose-object-memsave'
Junio C Hamano [Tue, 2 Mar 2010 20:44:09 +0000 (12:44 -0800)]
Merge branch 'np/compress-loose-object-memsave'

* np/compress-loose-object-memsave:
  sha1_file: be paranoid when creating loose objects
  sha1_file: don't malloc the whole compressed result when writing out objects

14 years agoMerge branch 'dp/read-not-mmap-small-loose-object'
Junio C Hamano [Tue, 2 Mar 2010 20:44:08 +0000 (12:44 -0800)]
Merge branch 'dp/read-not-mmap-small-loose-object'

* dp/read-not-mmap-small-loose-object:
  hash-object: don't use mmap() for small files

14 years agoMerge branch 'jn/makedepend'
Junio C Hamano [Tue, 2 Mar 2010 20:44:08 +0000 (12:44 -0800)]
Merge branch 'jn/makedepend'

* jn/makedepend:
  Makefile: clarify definition of TEST_OBJS
  Makefile: always remove .depend directories on 'make clean'
  Makefile: tuck away generated makefile fragments in .depend
  Teach Makefile to check header dependencies
  Makefile: list standalone program object files in PROGRAM_OBJS
  Makefile: lazily compute header dependencies
  Makefile: list generated object files in OBJECTS
  Makefile: disable default implicit rules
  Makefile: rearrange dependency rules
  Makefile: transport.o depends on branch.h now
  Makefile: drop dependency on $(wildcard */*.h)
  Makefile: clean up http-walker.o dependency rules
  Makefile: remove wt-status.h from LIB_H
  Makefile: make sure test helpers are rebuilt when headers change
  Makefile: add missing header file dependencies

Conflicts:
Makefile

14 years agoMerge branch 'jc/maint-status-preload'
Junio C Hamano [Tue, 2 Mar 2010 20:44:07 +0000 (12:44 -0800)]
Merge branch 'jc/maint-status-preload'

* jc/maint-status-preload:
  status: preload index to optimize lstat(2) calls

14 years agoMerge branch 'gf/maint-sh-setup-nongit-ok'
Junio C Hamano [Tue, 2 Mar 2010 20:44:07 +0000 (12:44 -0800)]
Merge branch 'gf/maint-sh-setup-nongit-ok'

* gf/maint-sh-setup-nongit-ok:
  require_work_tree broken with NONGIT_OK

14 years agoMerge branch 'jh/maint-submodule-status-in-void'
Junio C Hamano [Tue, 2 Mar 2010 20:44:07 +0000 (12:44 -0800)]
Merge branch 'jh/maint-submodule-status-in-void'

* jh/maint-submodule-status-in-void:
  submodule summary: Don't barf when invoked in an empty repo

14 years agoMerge branch 'hm/imap-send-cram-md5'
Junio C Hamano [Tue, 2 Mar 2010 20:44:06 +0000 (12:44 -0800)]
Merge branch 'hm/imap-send-cram-md5'

* hm/imap-send-cram-md5:
  imap-send: support CRAM-MD5 authentication

14 years agoMerge branch 'ml/color-when'
Junio C Hamano [Tue, 2 Mar 2010 20:44:06 +0000 (12:44 -0800)]
Merge branch 'ml/color-when'

* ml/color-when:
  Add an optional argument for --color options

14 years agoMerge branch 'ac/cvsimport-revision-mapping'
Junio C Hamano [Tue, 2 Mar 2010 20:44:06 +0000 (12:44 -0800)]
Merge branch 'ac/cvsimport-revision-mapping'

* ac/cvsimport-revision-mapping:
  cvsimport: new -R option: generate .git/cvs-revisions mapping

14 years agoMerge branch 'jc/grep-author-all-match-implicit'
Junio C Hamano [Tue, 2 Mar 2010 20:44:06 +0000 (12:44 -0800)]
Merge branch 'jc/grep-author-all-match-implicit'

* jc/grep-author-all-match-implicit:
  "log --author=me --grep=it" should find intersection, not union

14 years agofallback SSH_ASKPASS when GIT_ASKPASS not set
Frank Li [Tue, 2 Mar 2010 11:52:11 +0000 (19:52 +0800)]
fallback SSH_ASKPASS when GIT_ASKPASS not set

If GIT_ASKPASS is not set and SSH_ASKPASS set, GIT_ASKPASS will
use SSH_ASKPASS.

Signed-off-by: Frank Li <lznuaa@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agogitweb: Fix project-specific feature override behavior
Jakub Narebski [Mon, 1 Mar 2010 21:51:34 +0000 (22:51 +0100)]
gitweb: Fix project-specific feature override behavior

This commit fixes a bug in processing project-specific override in
a situation when there is no project, e.g. for the projects list page.

When 'snapshot' feature had project specific config override enabled
by putting
  $feature{'snapshot'}{'override'} = 1;

(or equivalent) in $GITWEB_CONFIG, and when viewing toplevel gitweb
page, which means the projects list page (to be more exact this
happens for any project-less action), gitweb would put the following
Perl warnings in error log:

  gitweb.cgi: Use of uninitialized value $git_dir in concatenation (.) or string at gitweb.cgi line 2065.
  fatal: error processing config file(s)
  gitweb.cgi: Use of uninitialized value $git_dir in concatenation (.) or string at gitweb.cgi line 2221.
  gitweb.cgi: Use of uninitialized value $git_dir in concatenation (.) or string at gitweb.cgi line 2218.

The problem is in the following fragment of code:

  # path to the current git repository
  our $git_dir;
  $git_dir = "$projectroot/$project" if $project;

  # list of supported snapshot formats
  our @snapshot_fmts = gitweb_get_feature('snapshot');
  @snapshot_fmts = filter_snapshot_fmts(@snapshot_fmts);

For the toplevel gitweb page, which is the list of projects, $project is not
defined, therefore neither is $git_dir.  gitweb_get_feature() subroutine
calls git_get_project_config() if project specific override is turned
on... but we don't have project here.

Those errors mentioned above occur in the following fragment of code in
git_get_project_config():

   # get config
   if (!defined $config_file ||
       $config_file ne "$git_dir/config") {
   %config = git_parse_project_config('gitweb');
   $config_file = "$git_dir/config";
   }

git_parse_project_config() calls git_cmd() which has '--git-dir='.$git_dir

There are (at least) three possible solutions:
1. Harden gitweb_get_feature() so that it doesn't call
   git_get_project_config() if $project (and therefore $git_dir) is not
   defined; there is no project for project specific config.
2. Harden git_get_project_config() like you did in your fix, returning early
   if $git_dir is not defined.
3. Harden git_cmd() so that it doesn't add "--git-dir=$git_dir" if $git_dir
   is not defined, and change git_get_project_config() so that it doesn't
   even try to access $git_dir if it is not defined.

This commit implements both 1.) and 2.), i.e. gitweb_get_feature() doesn't
call project-specific override if $git_dir is not defined (if there is no
project), and git_get_project_config() returns early if $git_dir is not
defined.

Add a test for this bug to t/t9500-gitweb-standalone-no-errors.sh test.

Reported-by: Eli Barzilay <eli@barzilay.org>
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agogitweb multiple project roots documentation
Sylvain Rabot [Tue, 2 Mar 2010 00:04:57 +0000 (01:04 +0100)]
gitweb multiple project roots documentation

This commit adds in the gitweb/README file a description of how to use gitweb
with several project roots using apache virtualhost rewrite rules.

Signed-off-by: Sylvain Rabot <sylvain@abstraction.fr>
Acked-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agorefactor merge flags into xmparam_t
Bert Wesarg [Mon, 1 Mar 2010 21:46:26 +0000 (22:46 +0100)]
refactor merge flags into xmparam_t

Include the merge level, favor, and style flags into the xmparam_t struct.
This removes the bit twiddling with these three values into the one flags
parameter.

Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agomake union merge an xdl merge favor
Bert Wesarg [Mon, 1 Mar 2010 21:46:25 +0000 (22:46 +0100)]
make union merge an xdl merge favor

The current union merge driver is implemented as an post process.  But the
xdl_merge code is quite capable to produce the result by itself.  Therefore
move it there.

Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoremote-curl: init walker only when needed
Tay Ray Chuan [Tue, 2 Mar 2010 10:49:31 +0000 (18:49 +0800)]
remote-curl: init walker only when needed

Invoke get_http_walker() only when fetching with the dumb protocol.
Additionally, add an invocation to walker_free() after we're done using
the walker.

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoremote-curl: use http_fetch_ref() instead of walker wrapper
Tay Ray Chuan [Tue, 2 Mar 2010 10:49:30 +0000 (18:49 +0800)]
remote-curl: use http_fetch_ref() instead of walker wrapper

The http-walker implementation of walker->fetch_ref() doesn't do
anything special compared to http_fetch_ref() anyway.

Remove init_walker() invocation before fetching the ref, since we aren't
using the walker wrapper and don't need a walker instance anymore.

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agohttp: init and cleanup separately from http-walker
Tay Ray Chuan [Tue, 2 Mar 2010 10:49:29 +0000 (18:49 +0800)]
http: init and cleanup separately from http-walker

Previously, all our http operations were done with http-walker. With the
new remote-curl helper, we find ourselves using http methods outside of
http-walker - for example, fetching info/refs.

Accomodate this by separating http_init() and http_cleanup() invocations
from http-walker.

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agohttp-walker: cleanup more thoroughly
Tay Ray Chuan [Tue, 2 Mar 2010 10:49:28 +0000 (18:49 +0800)]
http-walker: cleanup more thoroughly

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agohttp-push: remove "|| 1" to enable verbose check
Tay Ray Chuan [Tue, 2 Mar 2010 10:49:27 +0000 (18:49 +0800)]
http-push: remove "|| 1" to enable verbose check

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agot554[01]-http-push: refactor, add non-ff tests
Tay Ray Chuan [Tue, 2 Mar 2010 10:49:26 +0000 (18:49 +0800)]
t554[01]-http-push: refactor, add non-ff tests

Move non-fast forward tests to lib-httpd.sh so that we don't have to
duplicate the tests in both t5540 and t5541.

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agot5541-http-push: check that ref is unchanged for non-ff test
Tay Ray Chuan [Tue, 2 Mar 2010 10:49:25 +0000 (18:49 +0800)]
t5541-http-push: check that ref is unchanged for non-ff test

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'cc/maint-bisect-paths'
Junio C Hamano [Mon, 1 Mar 2010 09:09:21 +0000 (01:09 -0800)]
Merge branch 'cc/maint-bisect-paths'

* cc/maint-bisect-paths:
  bisect: error out when passing bad path parameters

14 years agobisect: error out when passing bad path parameters
Christian Couder [Sun, 28 Feb 2010 22:19:09 +0000 (23:19 +0100)]
bisect: error out when passing bad path parameters

As reported by Mark Lodato, "git bisect", when it was started with
path parameters that match no commit was kind of working without
taking account of path parameters and was reporting something like:

Bisecting: -1 revisions left to test after this (roughly 0 steps)

It is more correct and safer to just error out in this case, before
displaying the revisions left, so this patch does just that.

Note that this bug is very old, it exists at least since v1.5.5.
And it is possible to detect that case earlier in the bisect
algorithm, but it is not clear that it would be an improvement to
error out earlier, on the contrary it may change the behavior of
"git rev-list --bisect-all" for example, which is currently correct.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'maint'
Junio C Hamano [Sun, 28 Feb 2010 19:41:57 +0000 (11:41 -0800)]
Merge branch 'maint'

* maint:
  Git 1.7.0.1
  Remove reference to GREP_COLORS from documentation
  sha1_name: fix segfault caused by invalid index access

14 years agoGit 1.7.0.1 v1.7.0.1
Junio C Hamano [Sun, 28 Feb 2010 19:41:24 +0000 (11:41 -0800)]
Git 1.7.0.1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoRemove reference to GREP_COLORS from documentation
Mark Lodato [Sat, 27 Feb 2010 04:57:48 +0000 (23:57 -0500)]
Remove reference to GREP_COLORS from documentation

There is no longer support for external grep, as per bbc09c2 (grep: rip
out support for external grep, 2010-01-12), so remove the reference to it
from the documentation.

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