gitweb.git
Merge branch 'maint'Junio C Hamano Sat, 12 Jun 2010 05:05:58 +0000 (22:05 -0700)

Merge branch 'maint'

* maint:
t/README: document --root option
Makefile: default pager on AIX to "more"

t/README: document --root optionThomas Rast Thu, 10 Jun 2010 18:24:46 +0000 (20:24 +0200)

t/README: document --root option

We've had this option since f423ef5 (tests: allow user to specify
trash directory location, 2009-08-09). Make it easier to look up :-)

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

test-lib: use DIFF definition from GIT-BUILD-OPTIONSJunio C Hamano Fri, 11 Jun 2010 16:40:25 +0000 (09:40 -0700)

test-lib: use DIFF definition from GIT-BUILD-OPTIONS

Otherwise running individual tests from t/ directory may lack the definition
of $DIFF, $GIT_TEST_CMP and friends.

Noticed and initial patch provided by Thomas Rast, alternative solution
suggested by Brandon Casey, which this patch implements.

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

Makefile: default pager on AIX to "more"Jeff King Thu, 10 Jun 2010 08:59:52 +0000 (04:59 -0400)

Makefile: default pager on AIX to "more"

AIX doesn't ship with "less" by default, and their "more" is
more featureful than average, so the latter is a more
sensible choice. People who really want less can set the
compile-time option themselves, or users can set $PAGER.

Signed-off-by: Jeff King <peff@peff.net>
Tested-by: Tor Arntsen <tor@spacetec.no>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

merge-recursive: demonstrate an incorrect conflict... Johannes Sixt Tue, 8 Jun 2010 11:34:12 +0000 (13:34 +0200)

merge-recursive: demonstrate an incorrect conflict with submodule

When one side of a merge turns a directory into a submodule, and the other
side does not touch that directory (but has other non-conflicting changes),
then a merge should succeed. But currently, it does not; it rather fails
with a file/directory conflict.

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

gitweb: Run in FastCGI mode if gitweb script has .fcgi... Jakub Narebski Sat, 5 Jun 2010 21:11:18 +0000 (23:11 +0200)

gitweb: Run in FastCGI mode if gitweb script has .fcgi extension

If the name of the script ($SCRIPT_NAME or $SCRIPT_FILENAME CGI
environment variable, or __FILE__ literal) ends with '.fcgi'
extension, run gitweb in FastCGI mode, as if it was run with
'--fastcgi' / '--fcgi' option.

This is intended for easy deploying gitweb using FastCGI
interface.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation/checkout: clarify descriptionJonathan Nieder Tue, 1 Jun 2010 07:25:23 +0000 (02:25 -0500)

Documentation/checkout: clarify description

git checkout can be used to switch branches and to retrieve files from
the index or an arbitrary tree. Split the description into
subsections corresponding to each mode to make each use easier to
understand.

Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Makefile: default pager on AIX to "more"Jeff King Thu, 10 Jun 2010 08:59:52 +0000 (04:59 -0400)

Makefile: default pager on AIX to "more"

AIX doesn't ship with "less" by default, and their "more" is
more featureful than average, so the latter is a more
sensible choice. People who really want less can set the
compile-time option themselves, or users can set $PAGER.

Signed-off-by: Jeff King <peff@peff.net>
Tested-by: Tor Arntsen <tor@spacetec.no>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint'Junio C Hamano Tue, 8 Jun 2010 05:15:31 +0000 (22:15 -0700)

Merge branch 'maint'

* maint:
Change C99 comments to old-style C comments

Change C99 comments to old-style C commentsTor Arntsen Fri, 4 Jun 2010 09:32:11 +0000 (11:32 +0200)

Change C99 comments to old-style C comments

Signed-off-by: Tor Arntsen <tor@spacetec.no>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint'Junio C Hamano Mon, 7 Jun 2010 22:46:01 +0000 (15:46 -0700)

Merge branch 'maint'

* maint:
commit.txt: clarify how --author argument is used

commit.txt: clarify how --author argument is usedJay Soffian Sun, 6 Jun 2010 23:31:34 +0000 (19:31 -0400)

commit.txt: clarify how --author argument is used

commit --author was added by 146ea06 (git commit --author=$name: look $name up
in existing commits), but its documentation was sorely lacking compared to its
excellent commit message. This commit tries to improve the documentation.

Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint'Junio C Hamano Mon, 7 Jun 2010 01:42:12 +0000 (18:42 -0700)

Merge branch 'maint'

* maint:
setup: document prefix

diff: fix "git show -C -C" output when renaming a binar... Christian Couder Wed, 26 May 2010 02:50:12 +0000 (04:50 +0200)

diff: fix "git show -C -C" output when renaming a binary file

A bug was introduced in 3e97c7c6af2901cec63bf35fcd43ae3472e24af8
(No diff -b/-w output for all-whitespace changes, Nov 19 2009)
that made the lines:

diff --git a/bar b/sub/bar
similarity index 100%
rename from bar
rename to sub/bar

disappear from "git show -C -C" output when file bar is a binary
file.

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

build: propagate $DIFF to scriptsJunio C Hamano Sat, 5 Jun 2010 16:36:13 +0000 (09:36 -0700)

build: propagate $DIFF to scripts

git-merge-one-file expects to run "-u" capable "diff", but using
$DIFF is not the right way to do so.

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

ls-files: allow relative pathspecClemens Buchacher Thu, 3 Jun 2010 13:39:18 +0000 (15:39 +0200)

ls-files: allow relative pathspec

git ls-files used to error out if given paths which point outside the current
working directory, such as '../'. We now allow such paths and the output is
analogous to git grep -l.

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

quote.c: separate quoting and relative path generationClemens Buchacher Thu, 3 Jun 2010 13:36:31 +0000 (15:36 +0200)

quote.c: separate quoting and relative path generation

This is in preparation of relative path support for ls-files, which
quotes a path only if the line terminator is not the NUL character.

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

setup: document prefixClemens Buchacher Sat, 5 Jun 2010 08:04:20 +0000 (10:04 +0200)

setup: document prefix

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation+t5708: document and test status -s -bMichael J Gruber Tue, 25 May 2010 14:52:03 +0000 (16:52 +0200)

Documentation+t5708: document and test status -s -b

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Show branch information in short output of git statusDaniel Knittl-Frank Tue, 25 May 2010 13:45:51 +0000 (15:45 +0200)

Show branch information in short output of git status

This patch adds a first line in the output of `git status -s` when given
the option `-b` or `--branch`, showing which branch the user is
currently on, and in case of tracking branches the number of commits on
each branch.

Signed-off-by: Daniel Knittl-Frank <knittl89+git@googlemail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

bash completion: add --orphan to 'git checkout'Erick Mattos Sat, 22 May 2010 00:43:52 +0000 (21:43 -0300)

bash completion: add --orphan to 'git checkout'

Update git-completion.bash with new --orphan option to 'git checkout'.

Signed-off-by: Erick Mattos <erick.mattos@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t3200: test -l with core.logAllRefUpdates optionsErick Mattos Sat, 22 May 2010 00:28:38 +0000 (21:28 -0300)

t3200: test -l with core.logAllRefUpdates options

By default reflogs are always created for new local branches by
"checkout -b". But by setting core.logAllRefUpdates to false this will
not be true anymore.

In that case you only create the reflogs when you use -l switch with
"checkout -b".

Added missing tests to check expected behaviors.

Signed-off-by: Erick Mattos <erick.mattos@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

checkout --orphan: respect -l option alwaysErick Mattos Sat, 22 May 2010 00:28:37 +0000 (21:28 -0300)

checkout --orphan: respect -l option always

Added changes to satisfy a corner case: creating reflogs by using -l
when core.logAllRefUpdates is set to false.

Signed-off-by: Erick Mattos <erick.mattos@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git svn: fix empty directory creationMichael J. Kiwala Tue, 1 Jun 2010 21:24:57 +0000 (16:24 -0500)

git svn: fix empty directory creation

Avoid attempts to stat() the contents of '', which could happen
when the root directory is empty. Additionally, remove the
unnecessary '_' stat optimization since it was confusing and
possibly throwing off the non-existent case.

[ew: fixed indentation, rewrote commit message]

Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Michael J. Kiwala <mkiwala@genome.wustl.edu>

t9129: fix UTF-8 locale detectionJunio C Hamano Wed, 2 Jun 2010 19:15:48 +0000 (12:15 -0700)

t9129: fix UTF-8 locale detection

The UTF-8 prerequisite test checked explicitly for en_US.utf8 in the
output from "locale -a", but the tests that are actually protected by the
prerequisite were asking LC_ALL=en_US.UTF-8 from the system.

This inconsistency leads the tests to fail on platforms that do not know
both en_US.UTF-8 and en_US.utf8 (thanks you, Yann Droneaud, for bringing
this up with an initial patch).

Instead, pick a locale with ".UTF-8" (with or without hyphen, spelled in
either upper or lowercase) in its name from "locale -a" output, and use it
for running the test.

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

git-instaweb: Add support for running gitweb via 'plackup'Jakub Narebski Fri, 28 May 2010 19:11:25 +0000 (21:11 +0200)

git-instaweb: Add support for running gitweb via 'plackup'

PSGI is an interface between Perl web applications and web servers, and
Plack is a Perl module and toolkit that contains PSGI middleware, helpers
and adapters to web servers; see http://plackperl.org

PSGI and Plack are inspired by Python's WSGI and Ruby's Rack (and
probably JavaScript's Jack/JSGI).

Plack core distribution includes HTTP::Server::PSGI, a reference PSGI
standalone web server implementation. 'plackup' is a command line
launcher to run PSGI applications from command line, connecting web
app to a web server via Plack::Runner module. By default it uses
HTTP::Server::PSGI as a web server.

git-instaweb generates gitweb.psgi wrapper (in $GIT_DIR/gitweb). This
wrapper uses Plack::App::WrapCGI to compile gitweb.cgi (which is a CGI
script) into a PSGI application using CGI::Compile and CGI::Emulate::PSGI.
git-instaweb then runs this wrapper, using by default HTTP::Server::PSGI
standalone Perl server, via Plack::Runner.

The configuration for 'plackup' is currently embedded in generated
gitweb.psgi wrapper, instead of using httpd.conf ($conf).

To run git-instaweb with '--httpd=plackup', you need to have instaled
Plack core, CGI::Emulate::PSGI, CGI::Compile. Those modules have to be
available for Perl scripts (which can be done for example by setting
PERL5LIB environment variable). This is currently not documented.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Acked-by: Petr Baudis <pasky@suse.cz>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-instaweb: Wait for server to start before running... Jakub Narebski Fri, 28 May 2010 19:11:24 +0000 (21:11 +0200)

git-instaweb: Wait for server to start before running web browser

Add generic httpd_is_ready subroutine, which busy-waits for web server to
be started, by checking if $port is opened on localhost. This is used to
avoid situation where web browser is started before web server is ready to
accept connection, and fails.

It uses IO::Socket::INET module, which is core Perl module since v5.6.0.

Alternate solution, possible for those web servers that can run arbitrary
code hooks after they bind the listen socket (after they start accepting
connections), would be to use some kind of blocking mechanism: FIFO or
lockfile, see
http://thread.gmane.org/gmane.comp.version-control.git/147337/focus=147566

This can be always added later, as a web server specific branch in
httpd_is_ready function.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Acked-by: Petr Baudis <pasky@suse.cz>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-instaweb: Remove pidfile after stopping web serverJakub Narebski Fri, 28 May 2010 19:11:23 +0000 (21:11 +0200)

git-instaweb: Remove pidfile after stopping web server

This way running e.g. "git instaweb" after "git instaweb --stop" would
not try to kill already stopped web server.

This is probably important only for those web servers that are
"daemonized" by git-instaweb itself, i.e. for those where it is
git-instaweb that creates pidfile. Currently it is includes only
'mongoose' web server, but it would also include 'plackup' web server
(added in later commit).

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Acked-by: Petr Baudis <pasky@suse.cz>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

refs: split log_ref_write logic into log_ref_setupErick Mattos Sat, 22 May 2010 00:28:36 +0000 (21:28 -0300)

refs: split log_ref_write logic into log_ref_setup

Separation of the logic for testing and preparing the reflogs from
function log_ref_write to a new non static new function: log_ref_setup.

This allows to be performed from outside the first all reasonable checks
and procedures for writing reflogs.

Signed-off-by: Erick Mattos <erick.mattos@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation: alter checkout --orphan descriptionErick Mattos Sat, 22 May 2010 00:28:35 +0000 (21:28 -0300)

Documentation: alter checkout --orphan description

The present text is a try to enhance description accuracy. It is a
merge of the rewritten text made by native english speaker Chris Johnsen
and further changes of Junio. It came from the last thread messages of
--orphan patch.

Signed-off-by: Erick Mattos <erick.mattos@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Makefile: Tru64 portability fixGary V. Vaughan Fri, 14 May 2010 09:31:49 +0000 (09:31 +0000)

Makefile: Tru64 portability fix

Add defaults for Tru64 Unix. Without this patch I cannot compile
git on Tru64 5.1.

Signed-off-by: Gary V. Vaughan <gary@thewrittenword.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Makefile: HP-UX 10.20 portability fixesGary V. Vaughan Fri, 14 May 2010 09:31:48 +0000 (09:31 +0000)

Makefile: HP-UX 10.20 portability fixes

HP-UX 10.20 has no pread definition, the inline keyword doesn't work,
and has no inet_ntop/inet_pton definitions.

Signed-off-by: Gary V. Vaughan <gary@thewrittenword.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Makefile: HPUX11 portability fixesGary V. Vaughan Fri, 14 May 2010 09:31:47 +0000 (09:31 +0000)

Makefile: HPUX11 portability fixes

There is no nanosecond field on HPUX, the inline keyword is
spelled "__inline", and there are no inet_ntop/inet_pton definitions
on HP-UX 11.00

Signed-off-by: Gary V. Vaughan <gary@thewrittenword.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint'Junio C Hamano Wed, 2 Jun 2010 17:17:26 +0000 (10:17 -0700)

Merge branch 'maint'

* maint:
git-compat-util.h: use apparently more common __sgi macro to detect SGI IRIX
Documentation: A...B shortcut for checkout and rebase
Documentation/pretty-{formats,options}: better reference for "format:<string>"

git-compat-util.h: use apparently more common __sgi... Gary V. Vaughan Wed, 2 Jun 2010 01:55:36 +0000 (20:55 -0500)

git-compat-util.h: use apparently more common __sgi macro to detect SGI IRIX

IRIX 6.5.26m does not define the 'sgi' macro, but it does define an '__sgi'
macro. Since later IRIX versions (6.5.29m) define both macros, and since
an underscore prefixed macro is preferred anyway, use '__sgi' to detect
compilation on SGI IRIX.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Gary V. Vaughan <gary@thewrittenword.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation: A...B shortcut for checkout and rebaseMichael J Gruber Tue, 1 Jun 2010 15:16:42 +0000 (17:16 +0200)

Documentation: A...B shortcut for checkout and rebase

Describe the A...B shortcuts for checkout and rebase [-i] which were
introduced in these commits:

619a64e ("checkout A...B" switches to the merge base between A and B, 2009-10-18)
61dfa1b ("rebase --onto A...B" replays history on the merge base between A and B, 2009-11-20)
230a456 (rebase -i: teach --onto A...B syntax, 2010-01-07)

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation/pretty-{formats,options}: better referenc... Nazri Ramliy Tue, 1 Jun 2010 17:54:46 +0000 (01:54 +0800)

Documentation/pretty-{formats,options}: better reference for "format:<string>"

In "git help log" (and friends) it's not easy to find the possible
placeholder for <string> for the "--pretty=format:<string>" option
to git log.

This patch makes the placeholder easier to find by adding a reference
to the "PRETTY FORMATS" section and repeating the "format:<string>"
phrase.

Signed-off-by: Nazri Ramliy <ayiehere@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git am: Remove stray error message from sedRamkumar Ramachandra Wed, 2 Jun 2010 08:33:37 +0000 (10:33 +0200)

git am: Remove stray error message from sed

When --continue is invoked without any changes, the following stray
error message appears- sed: can't read $dotest/final-commit: No such
file or directory. Remove this by making sure that the file actually
exists.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git am: Display some help text when patch is emptyRamkumar Ramachandra Wed, 2 Jun 2010 08:33:36 +0000 (10:33 +0200)

git am: Display some help text when patch is empty

When a patch is found to be empty, prompt the user to use either
--skip or --abort.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git am: Set cmdline globallyRamkumar Ramachandra Wed, 2 Jun 2010 08:33:35 +0000 (10:33 +0200)

git am: Set cmdline globally

Set the $cmdline variable globally, and not in stop_here_user_resolve
so it can be used in other code fragments as well.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t/aggregate-results: accomodate systems with small... Brandon Casey Wed, 2 Jun 2010 00:13:44 +0000 (19:13 -0500)

t/aggregate-results: accomodate systems with small max argument list length

IRIX 6.5 has a default maximum argument list length of 20480. The file
glob that is passed to aggregate-results currently exceeds this length, and
so the script cannot run successfully. Work around this issue by passing
the file names in via the standard input rather than the argument list.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t/t7006: ignore return status of shell's unset builtinBrandon Casey Wed, 2 Jun 2010 15:32:26 +0000 (10:32 -0500)

t/t7006: ignore return status of shell's unset builtin

The unset builtin of Solaris's xpg4/sh returns non-zero if it is passed a
variable name which was not previously set. Since the unset is not likely
to fail, ignore its return status, but add a semicolon as a clue that the
'&&' was deliberately left off.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Acked-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t/t5150: remove space from sed scriptBrandon Casey Wed, 2 Jun 2010 00:13:42 +0000 (19:13 -0500)

t/t5150: remove space from sed script

Solaris's xpg4/sed and IRIX's sed fail to parse these negated matching
expressions when the '!' is separated from the command that follows.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Acked-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-request-pull.sh: remove -e switch to shell interpre... Brandon Casey Wed, 2 Jun 2010 00:13:41 +0000 (19:13 -0500)

git-request-pull.sh: remove -e switch to shell interpreter which breaks ksh

The -e option causes the shell to exit immediately when a command exits
with a non-zero exit status. This does not seem to cause a problem for
Bash, but it does cause a problem for the Korn shell, like Solaris's
xpg4/sh, whose unset utility returns non-zero if it is passed a variable
name which was not previously set. When using xpg4/sh, git-request-pull
exits while sourcing git-sh-setup since git-sh-setup tries to unset the
CDPATH environment variable.

When git-request-pull was originally written, it did not do any error
checking and it used this shell feature to exit when an error occurred.
This script now performs proper error checking and provides useful error
messages, so this -e option appears to be merely a historical artifact and
can be removed.

Kudos to Jonathan Nieder for introducing t5150 which exercises the
request-pull code path.

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

t/t5800: skip if python version is older than 2.5Brandon Casey Wed, 2 Jun 2010 00:13:40 +0000 (19:13 -0500)

t/t5800: skip if python version is older than 2.5

This test script depends on the git-remote-testgit python script. This
python script makes use of the hashlib module which was released in python
version 2.5. So, add a new pre-requisite named PYTHON_2_5_OR_NEWER to
test-lib.sh and check for it in t5800.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint'Junio C Hamano Tue, 1 Jun 2010 01:14:23 +0000 (18:14 -0700)

Merge branch 'maint'

* maint:
Documentation/SubmittingPatches: Fix typo in GMail section
Documentation/config: describe status.submodulesummary

Merge branch 'maint-1.7.0' into maintJunio C Hamano Tue, 1 Jun 2010 01:14:17 +0000 (18:14 -0700)

Merge branch 'maint-1.7.0' into maint

* maint-1.7.0:
Documentation/config: describe status.submodulesummary

gitignore.5: Clarify matching rulesJonathan Nieder Fri, 5 Mar 2010 15:56:39 +0000 (09:56 -0600)

gitignore.5: Clarify matching rules

Patterns containing a / are implicitly anchored to the directory
containing the relevant .gitignore file.

Patterns not containing a / are textual matches against the path
name relative to the directory containing .gitignore.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation/SubmittingPatches: Fix typo in GMail... Tim Henigan Wed, 26 May 2010 12:36:10 +0000 (08:36 -0400)

Documentation/SubmittingPatches: Fix typo in GMail section

Commit e498257d introduced a typo while improving the GMail section
of SubmittingPatches.

Signed-off-by: Tim Henigan <tim.henigan@gmail.com>
Acked-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-web--browse: Add support for google chrome and... Pavan Kumar Sunkara Sat, 29 May 2010 18:36:51 +0000 (00:06 +0530)

git-web--browse: Add support for google chrome and chromium

Add support for google's chrome & chromium. The value of the
browser is 'chromium' or 'chrome' to select it.

You can always provide config variable for browser path if they
are not installed in right paths.

Signed-off-by: Pavan Kumar Sunkara <pavan.sss1991@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Make --color-words work well with --graphBo Yang Sat, 29 May 2010 15:32:06 +0000 (23:32 +0800)

Make --color-words work well with --graph

'--color-words' algorithm can be described as:

1. collect a the minus/plus lines of a diff hunk, divided into
minus-lines and plus-lines;

2. break both minus-lines and plus-lines into words and
place them into two mmfile_t with one word for each line;

3. use xdiff to run diff on the two mmfile_t to get the words level diff;

And for the common parts of the both file, we output the plus side text.
diff_words->current_plus is used to trace the current position of the plus file
which printed. diff_words->last_minus is used to trace the last minus word
printed.

For '--graph' to work with '--color-words', we need to output the graph prefix
on each line of color words output. Generally, there are two conditions on
which we should output the prefix.

1. diff_words->last_minus == 0 &&
diff_words->current_plus == diff_words->plus.text.ptr

that is: the plus text must start as a new line, and if there is no minus
word printed, a graph prefix must be printed.

2. diff_words->current_plus > diff_words->plus.text.ptr &&
*(diff_words->current_plus - 1) == '\n'

that is: a graph prefix must be printed following a '\n'

Signed-off-by: Bo Yang <struggleyb.nku@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

graph.c: register a callback for graph outputBo Yang Wed, 26 May 2010 07:23:56 +0000 (15:23 +0800)

graph.c: register a callback for graph output

It will look better if the 'git log --graph' print
the graph pading lines before the diff output just
like what it does for commit message.
And this patch leverage the new diff prefix callback
function to achieve this.

Signed-off-by: Bo Yang <struggleyb.nku@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Emit a whole line in one goBo Yang Sat, 29 May 2010 15:32:05 +0000 (23:32 +0800)

Emit a whole line in one go

Since the graph prefix will be printed when calling
emit_line, so the functions should be used to emit a
complete line out once a time. No one should call
emit_line to just output some strings instead of a
complete line.
Use a strbuf to compose the whole line, and then
call emit_line to output it once.

Signed-off-by: Bo Yang <struggleyb.nku@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff.c: Output the text graph padding before each diff... Bo Yang Wed, 26 May 2010 07:23:54 +0000 (15:23 +0800)

diff.c: Output the text graph padding before each diff line

Change output from diff with -p/--dirstat/--binary/--numstat/--stat/
--shortstat/--check/--summary options to align with graph paddings.

Thanks Jeff King <peff@peff.net> for reporting the '--summary' bug and
his initial patch.

Signed-off-by: Bo Yang <struggleyb.nku@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Output the graph columns at the end of the commit messageBo Yang Wed, 26 May 2010 07:08:03 +0000 (15:08 +0800)

Output the graph columns at the end of the commit message

There is an empty line between the commit message and the diff
output. Add the graph columns as prefix of this line.

Signed-off-by: Bo Yang <struggleyb.nku@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Add a prefix output callback to diff outputBo Yang Wed, 26 May 2010 07:08:02 +0000 (15:08 +0800)

Add a prefix output callback to diff output

The callback can be used to add some prefix string to each line of
diff output.

Signed-off-by: Bo Yang <struggleyb.nku@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-instaweb: Configure it to work with new gitweb... Pavan Kumar Sunkara Fri, 28 May 2010 06:25:52 +0000 (11:55 +0530)

git-instaweb: Configure it to work with new gitweb structure

git-instaweb in its current form (re)creates gitweb.cgi and
(some of) required static files in $GIT_DIR/gitweb/ directory.
Splitting gitweb would make it difficult for git-instaweb to
continue with this method.

Use the instaweb.gitwebdir config variable to point git-instaweb script
to a global directory which contains gitweb files as server root
and the httpd.conf along with server logs and pid go into
'$(GIT_DIR)/gitweb' directory.

Signed-off-by: Pavan Kumar Sunkara <pavan.sss1991@gmail.com>
Mentored-by: Christian Couder <chriscool@tuxfamily.org>
Mentored-by: Petr Baudis <pasky@ucw.cz>
Acked-by: Jakub Narebski <jnareb@gmail.com>
Acked-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-instaweb: Put httpd logs in a "$httpd_only" subdire... Pavan Kumar Sunkara Fri, 28 May 2010 06:25:51 +0000 (11:55 +0530)

git-instaweb: Put httpd logs in a "$httpd_only" subdirectory

Resolve full httpd and create "$httpd_only" subdirectory before
writing httpd.conf so that error.log and access.log go into it.

While at it, change apache2 configuration to use logs in a
similiar fashion.

Signed-off-by: Pavan Kumar Sunkara <pavan.sss1991@gmail.com>
Mentored-by: Christian Couder <chriscool@tuxfamily.org>
Mentored-by: Petr Baudis <pasky@ucw.cz>
Acked-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitweb: Set default destination directory for installin... Pavan Kumar Sunkara Fri, 28 May 2010 06:25:50 +0000 (11:55 +0530)

gitweb: Set default destination directory for installing gitweb in Makefile

Currently installing gitweb requires to give a target directory
(via 'gitwebdir' build variable). Giving it a default value
protects against user errors.

Signed-off-by: Pavan Kumar Sunkara <pavan.sss1991@gmail.com>
Mentored-by: Christian Couder <chriscool@tuxfamily.org>
Mentored-by: Petr Baudis <pasky@ucw.cz>
Acked-by: Jakub Narebski <jnareb@gmail.com>
Acked-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitweb: Move static files into seperate subdirectoryPavan Kumar Sunkara Fri, 28 May 2010 06:25:49 +0000 (11:55 +0530)

gitweb: Move static files into seperate subdirectory

Create a new subdirectory called 'static' in gitweb/, and move
all static files required by gitweb.cgi when running, which means
styles, images and Javascript code. This should make gitweb more
readable and easier to maintain.

Update t/gitweb-lib.sh to reflect this change.The install-gitweb
now also include moving of static files into 'static' subdirectory
in target directory: update Makefile, gitweb's INSTALL, README and
Makefile accordingly.

Signed-off-by: Pavan Kumar Sunkara <pavan.sss1991@gmail.com>
Mentored-by: Christian Couder <chriscool@tuxfamily.org>
Mentored-by: Petr Baudis <pasky@ucw.cz>
Acked-by: Jakub Narebski <jnareb@gmail.com>
Acked-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rebase: improve error message when upstream argument... Jonathan Nieder Mon, 31 May 2010 22:51:32 +0000 (17:51 -0500)

rebase: improve error message when upstream argument is missing

Strip out options before checking for a missing upstream argument.
Before:

$ git rebase -m
shift: 426: can't shift that many

After:

$ git rebase -m
Usage: git rebase ...

While at it, fix the usage message to explain that the upstream
argument is mandatory.

Reported-by: Jon Dowland <jmtd@debian.org>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation/checkout: clarify descriptionJonathan Nieder Sun, 30 May 2010 08:41:53 +0000 (03:41 -0500)

Documentation/checkout: clarify description

To the first-time reader, it may not be obvious that ‘git checkout’
has two modes, nor that if no branch is specified it will read
from the index.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-am: suggest what to do with superfluous patchesJan Krüger Sun, 30 May 2010 08:19:26 +0000 (10:19 +0200)

git-am: suggest what to do with superfluous patches

Particularly in the context of rebase, conflicts frequently occur
because the change in the patch to be applied was made obsolete by new
upstream commits. In this case, solving the conflict effectively means
skipping the patch. However, it's not always readily apparent that the
patch needs to be skipped, and when people solve the conflict and try
git rebase --continue, they get confronted with a message of

No changes - did you forget to use 'git add'?

That's not very helpful if you did actually stage your changes and they
happen to turn the patch into a no-op. This extends the message to point
out what's going on.

Signed-off-by: Jan Krüger <jk@jk.gs>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Makefile: remove redundant munging of @@INSTLIBDIR@@Ævar Arnfjörð Bjarmason Sun, 30 May 2010 17:12:41 +0000 (17:12 +0000)

Makefile: remove redundant munging of @@INSTLIBDIR@@

Junio originally added this in f6276fe159 for use in `unshift @INC,
'@@INSTLIBDIR@@'' in git-fmt-merge-msg.perl. That program was since
then rewritten in C in 00449f992b. And since 6fcca938b0 all Perl
programs use `use lib' to set their @INC path.

There's been no @@INSTLIBDIR@@ in any Perl script to replace since
then. So there's no reason to keep it around.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff.c: Ensure "index $from..$to" line contains unambig... Johan Herland Sun, 30 May 2010 13:37:17 +0000 (15:37 +0200)

diff.c: Ensure "index $from..$to" line contains unambiguous SHA1s

In the metainfo section of git diffs there's an "index" line providing
abbreviated (unless --full-index is used) blob SHA1s from the
pre-/post-images used to generate the diff. These provide hints that
can be used to reconstruct a 3-way merge when applying the patch
(see the --3way option to 'git am' for more details).

In order for this to work, however, the blob SHA1s must not be
abbreviated into ambiguity.

This patch eliminates the possible ambiguity by using find_unique_abbrev()
to produce the abbreviated SHA1s (instead of blind abbreviation by way of
"%.*s").

A testcase verifying the fix is also included.

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Makefile: SunOS 5.6 portability fixGary V. Vaughan Fri, 14 May 2010 09:31:45 +0000 (09:31 +0000)

Makefile: SunOS 5.6 portability fix

Although configure takes care of most of this, set some default values
for Solaris 2.6 (aka SunOS-5.6) to ensure git compiles even when
configure is not used to build it.

Signed-off-by: Gary V. Vaughan <gary@thewrittenword.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

inline declaration does not work on AIXGary V. Vaughan Fri, 14 May 2010 09:31:44 +0000 (09:31 +0000)

inline declaration does not work on AIX

Define away inline declaration on AIX.

Signed-off-by: Gary V. Vaughan <gary@thewrittenword.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Allow disabling "inline"Gary V. Vaughan Fri, 14 May 2010 09:31:43 +0000 (09:31 +0000)

Allow disabling "inline"

Compiler support for inline is sometimes buggy, and occasionally
missing entirely. This patch adds a test for inline support, and
redefines the keyword with the preprocessor if necessary at compile
time.

Signed-off-by: Gary V. Vaughan <gary@thewrittenword.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Some platforms lack socklen_t typeGary V. Vaughan Fri, 14 May 2010 09:31:42 +0000 (09:31 +0000)

Some platforms lack socklen_t type

Some platforms do not have a socklen_t type declaration.

Signed-off-by: Gary V. Vaughan <gary@thewrittenword.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Make NO_{INET_NTOP,INET_PTON} configured independentlyGary V. Vaughan Fri, 14 May 2010 09:31:41 +0000 (09:31 +0000)

Make NO_{INET_NTOP,INET_PTON} configured independently

Being careful not to overwrite the results of testing for hstrerror in
libresolv, also test whether inet_ntop/inet_pton are available from
that library.

Signed-off-by: Gary V. Vaughan <gary@thewrittenword.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Makefile: some platforms do not have hstrerror anywhereGary V. Vaughan Fri, 14 May 2010 09:31:40 +0000 (09:31 +0000)

Makefile: some platforms do not have hstrerror anywhere

This patch improves the logic of the test for hstrerror, not to
blindly assume that if there is no hstrerror in libc that it must
exist in libresolv.

Signed-off-by: Gary V. Vaughan <gary@thewrittenword.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-compat-util.h: some platforms with mmap() lack... Gary V. Vaughan Fri, 14 May 2010 09:31:39 +0000 (09:31 +0000)

git-compat-util.h: some platforms with mmap() lack MAP_FAILED definition

Some platforms with mmap() lack MAP_FAILED definition.

Signed-off-by: Gary V. Vaughan <gary@thewrittenword.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

test_cmp: do not use "diff -u" on platforms that lack oneGary V. Vaughan Fri, 14 May 2010 09:31:38 +0000 (09:31 +0000)

test_cmp: do not use "diff -u" on platforms that lack one

By default the testsuite calls 'diff -u' whenever a file comparison is
called for. Unfortunately that throws a "diff: unknown option '-u'"
error for most non-GNU diffs.

This patch sets GIT_TEST_CMP to 'cmp' on all the architectures where
that happens. The previous version of this patch forgot to export
GIT_TEST_CMP from t/Makefile, which is why 'make test' continued to
fail most tests on most architectures - test-lib.sh was falling back
on its default of `diff -u' for GIT_TEST_CMP. This version of this
patch shows a vast improvement in testsuite results where either GNU
diff is in the path at configure time, or where Makefile knows that
GIT_TEST_CMP=cmp is required.

Signed-off-by: Gary V. Vaughan <gary@thewrittenword.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fixup: do not unconditionally disable "diff -u"Junio C Hamano Tue, 1 Jun 2010 00:35:20 +0000 (17:35 -0700)

fixup: do not unconditionally disable "diff -u"

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

tests: use "test_cmp", not "diff", when verifying the... Gary V. Vaughan Fri, 14 May 2010 09:31:37 +0000 (09:31 +0000)

tests: use "test_cmp", not "diff", when verifying the result

In tests, call test_cmp rather than raw diff where possible (i.e. if
the output does not go to a pipe), to allow the use of, say, 'cmp'
when the default 'diff -u' is not compatible with a vendor diff.

When that is not possible, use $DIFF, as set in GIT-BUILD-OPTIONS.

Signed-off-by: Gary V. Vaughan <gary@thewrittenword.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Do not use "diff" found on PATH while building and... Gary V. Vaughan Fri, 14 May 2010 09:31:36 +0000 (09:31 +0000)

Do not use "diff" found on PATH while building and installing

Some of the flags used with the first diff found in PATH cause the
vendor diff to choke.

Signed-off-by: Gary V. Vaughan <gary@thewrittenword.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

enums: omit trailing comma for portabilityGary V. Vaughan Fri, 14 May 2010 09:31:35 +0000 (09:31 +0000)

enums: omit trailing comma for portability

Without this patch at least IBM VisualAge C 5.0 (I have 5.0.2) on AIX
5.1 fails to compile git.

enum style is inconsistent already, with some enums declared on one
line, some over 3 lines with the enum values all on the middle line,
sometimes with 1 enum value per line... and independently of that the
trailing comma is sometimes present and other times absent, often
mixing with/without trailing comma styles in a single file, and
sometimes in consecutive enum declarations.

Clearly, omitting the comma is the more portable style, and this patch
changes all enum declarations to use the portable omitted dangling
comma style consistently.

Signed-off-by: Gary V. Vaughan <gary@thewrittenword.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Makefile: -lpthread may still be necessary when libc... Gary V. Vaughan Fri, 14 May 2010 09:31:34 +0000 (09:31 +0000)

Makefile: -lpthread may still be necessary when libc has only pthread stubs

Without this patch, systems that provide stubs for pthread functions
in libc, but which still require libpthread for full the pthread
implementation are not detected correctly.

Also, some systems require -pthread in CFLAGS for each compilation
unit for a successful link of an mt binary, which is also addressed by
this patch.

Signed-off-by: Gary V. Vaughan <gary@thewrittenword.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Rewrite dynamic structure initializations to runtime... Gary V. Vaughan Fri, 14 May 2010 09:31:33 +0000 (09:31 +0000)

Rewrite dynamic structure initializations to runtime assignment

Unfortunately, there are still plenty of production systems with
vendor compilers that choke unless all compound declarations can be
determined statically at compile time, for example hpux10.20 (I can
provide a comprehensive list of our supported platforms that exhibit
this problem if necessary).

This patch simply breaks apart any compound declarations with dynamic
initialisation expressions, and moves the initialisation until after
the last declaration in the same block, in all the places necessary to
have the offending compilers accept the code.

Signed-off-by: Gary V. Vaughan <gary@thewrittenword.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Makefile: pass CPPFLAGS through to fllow customizationGary V. Vaughan Fri, 14 May 2010 09:31:32 +0000 (09:31 +0000)

Makefile: pass CPPFLAGS through to fllow customization

Without this patch there is no straight forward way to pass additional
CPPFLAGS at configure-time. At TWW, everything non-vendor package is
installed to its own subdirectory, so we need the following to show
the preprocessor where the headers for the libraries we will link
later can be found:

$SHELL ./configure \
CPPFLAGS="-I${SB_VAR_CURL_INC}\
-I${SB_VAR_LIBEXPAT_INC}\
-I${SB_VAR_LIBZ_INC}\
${CPPFLAGS+ $CPPFLAGS}" <<...>>

Signed-off-by: Gary V. Vaughan <gary@thewrittenword.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation/config: describe status.submodulesummaryMichael J Gruber Thu, 20 May 2010 15:55:42 +0000 (17:55 +0200)

Documentation/config: describe status.submodulesummary

ac8d5af (builtin-status: submodule summary support, 2008-04-12)
intoduced this variable and described it in git-status[1].

Include this description in git-config[1], as well.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint'Junio C Hamano Fri, 28 May 2010 23:59:42 +0000 (16:59 -0700)

Merge branch 'maint'

* maint:
Makefile: reenable install with NO_CURL
completion: --set-upstream option for git-branch
get_cwd_relative(): do not misinterpret suffix as subdirectory

Merge branch 'maint-1.7.0' into maintJunio C Hamano Fri, 28 May 2010 23:59:36 +0000 (16:59 -0700)

Merge branch 'maint-1.7.0' into maint

* maint-1.7.0:
Makefile: reenable install with NO_CURL

Makefile: reenable install with NO_CURLMichael J Gruber Wed, 26 May 2010 14:24:34 +0000 (16:24 +0200)

Makefile: reenable install with NO_CURL

Setting NO_CURL leaves some variables like REMOTE_CURL_ALIASES
empty, which creates no fun when for-looping over
$(REMOTE_CURL_ALIASES) unconditionally. Make it conditional.

Reported-by: Paul Walker <PWalker752@aol.com>
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fsck: fix bogus commit header checkJonathan Nieder Wed, 26 May 2010 21:50:34 +0000 (16:50 -0500)

fsck: fix bogus commit header check

daae1922 (fsck: check ident lines in commit objects, 2010-04-24)
taught fsck to expect commit objects to have the form

tree <object name>
<parents>
author <valid ident string>
committer <valid ident string>

log message

The check is overly strict: for example, it errors out with the
message “expected blank line” for perfectly valid commits with an
"encoding ISO-8859-1" line.

Later it might make sense to teach fsck about the rest of the header
and warn about unrecognized header lines, but for simplicity, let’s
accept arbitrary trailing lines for now.

Reported-by: Tuncer Ayaz <tuncer.ayaz@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

completion: --set-upstream option for git-branchMichael J Gruber Wed, 26 May 2010 08:46:41 +0000 (10:46 +0200)

completion: --set-upstream option for git-branch

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

get_cwd_relative(): do not misinterpret suffix as subdi... Clemens Buchacher Sat, 22 May 2010 11:13:05 +0000 (13:13 +0200)

get_cwd_relative(): do not misinterpret suffix as subdirectory

If the current working directory is the same as the work tree path
plus a suffix, e.g. 'work' and 'work-xyz', then the suffix '-xyz'
would be interpreted as a subdirectory of 'work'.

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff: Support visibility modifiers in the PHP hunk... Björn Steinbrink Sun, 23 May 2010 18:05:40 +0000 (20:05 +0200)

diff: Support visibility modifiers in the PHP hunk header regexp

Starting with PHP5, class methods can have a visibility modifier, which
caused the methods not to be matched by the existing regexp, so extend
the regexp to match those modifiers. And while we're at it, allow the
"static" modifier as well.

Since the "static" modifier can appear either before or after the
visibility modifier, let's just allow any number of modifiers to appear
in any order, as that simplifies the regexp and shouldn't cause any
false positives.

Signed-off-by: Björn Steinbrink <B.Steinbrink@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint'Junio C Hamano Tue, 25 May 2010 20:13:43 +0000 (13:13 -0700)

Merge branch 'maint'

* maint:
Documentation/SubmittingPatches: clarify GMail section and SMTP
show-branch: use DEFAULT_ABBREV instead of 7
t7502-commit: fix spelling
test get_git_work_tree() return value for NULL

Documentation/SubmittingPatches: clarify GMail section... Michael J Gruber Tue, 25 May 2010 08:30:13 +0000 (10:30 +0200)

Documentation/SubmittingPatches: clarify GMail section and SMTP

We keep getting mangled submissions from GMail's web interface. Try to
be more proactive in SubmittingPatches by

- pointing to MUA specific instructions early on,
- structuring the GMail section more clearly,
- putting send-email/SMTP before imap-send/IMAP.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

pull: do nothing on --dry-runJeff King Tue, 25 May 2010 06:07:25 +0000 (02:07 -0400)

pull: do nothing on --dry-run

Pull was never meant to take --dry-run at all. However, it
passes unknown arguments to git-fetch, which does do a
dry-run. Unfortunately, pull then attempts to merge whatever
cruft was in FETCH_HEAD (which the dry-run fetch will not
have written to).

Even though we never advertise --dry-run as something that
should work, it is still worth being defensive because:

1. Other commands (including fetch) take --dry-run, so a
user might try it.

2. Rather than simply producing an error, it actually
changes the repository in totally unexpected ways.

This patch makes "pull --dry-run" equivalent to "fetch
--dry-run".

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

show-branch: use DEFAULT_ABBREV instead of 7Tay Ray Chuan Mon, 24 May 2010 08:50:44 +0000 (16:50 +0800)

show-branch: use DEFAULT_ABBREV instead of 7

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

t7502-commit: fix spellingTay Ray Chuan Mon, 24 May 2010 08:51:17 +0000 (16:51 +0800)

t7502-commit: fix spelling

s/subdirecotry/subdirectory/

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

test get_git_work_tree() return value for NULLClemens Buchacher Sat, 22 May 2010 12:21:27 +0000 (14:21 +0200)

test get_git_work_tree() return value for NULL

If we are in a git directory, get_git_work_tree() can return NULL.
While trying to determine whether or not the given paths are outside
the work tree, the following command would read from it anyways and
trigger a segmentation fault.

git diff / /

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

remove over-eager caching in sha1_file_nameJeff King Sat, 22 May 2010 06:59:42 +0000 (02:59 -0400)

remove over-eager caching in sha1_file_name

This function takes a sha1 and produces a loose object
filename. It caches the location of the object directory so
that it can fill the sha1 information directly without
allocating a new buffer (and in its original incarnation,
without calling getenv(), though these days we cache that
with the code in environment.c).

This cached base directory can become stale, however, if in
a single process git changes the location of the object
directory (e.g., by running setup_work_tree, which will
chdir to the new worktree).

In most cases this isn't a problem, because we tend to set
up the git repository location and do any chdir()s before
actually looking up any objects, so the first lookup will
cache the correct location. In the case of reset --hard,
however, we do something like:

1. look up the commit object

2. notice we are doing --hard, run setup_work_tree

3. look up the tree object to reset

Step (3) fails because our cache object directory value is
bogus.

This patch simply removes the caching. We use a static
buffer instead of allocating one each time (the original
version treated the malloc'd buffer as a static, so there is
no change in calling semantics).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-submodule foreach: Add $toplevel variableÆvar Arnfjörð Bjarmason Fri, 21 May 2010 16:10:10 +0000 (16:10 +0000)

git-submodule foreach: Add $toplevel variable

Add a $toplevel variable accessible to `git submodule foreach`, it
contains the absolute path of the top level directory (where
.gitmodules is).

This makes it possible to e.g. read data in .gitmodules from within
foreach commands. I'm using this to configure the branch names I want
to track for each submodule:

git submodule foreach 'git checkout $(git config --file $toplevel/.gitmodules submodule.$name.branch) && git pull'

For a little history: This patch is borne out of my continuing fight
of trying to have Git track the branches of submodules, not just their
commits.

Obviously that's not how they work (they only track commits), but I'm
just interested in being able to do:

git submodule foreach 'git pull'

Of course that won't work because the submodule is in a disconnected
head, so I first have to connect it, but connect it *to what*.

For a while I was happy with this because as fate had it, it just so
happened to do what I meant:

git submodule foreach 'git checkout $(git describe --all --always) && git pull'

But then that broke down, if there's a tag and a branch the tag will
win out, and I can't git pull a branch:

$ git branch -a
* master
remotes/origin/HEAD -> origin/master
remotes/origin/master
$ git tag -l
release-0.0.6
$ git describe --always --all
release-0.0.6

So I figured that I might as well start tracking the branches I want
in .gitmodules itself:

[submodule "yaml-mode"]
path = yaml-mode
url = git://github.com/yoshiki/yaml-mode.git
branch = master

So now I can just do (as stated above):

git submodule foreach 'git checkout $(git config --file $toplevel/.gitmodules submodule.$name.branch) && git pull'

Maybe there's a less painful way to do *that* (I'd love to hear about
it). But regardless of that I think it's a good idea to be able to
know what the top-level is from git submodule foreach.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

decode file:// and ssh:// URLsJeff King Sun, 23 May 2010 09:19:44 +0000 (05:19 -0400)

decode file:// and ssh:// URLs

We generally treat these as equivalent to "/path/to/repo"
and "host:path_to_repo" respectively. However, they are URLs
and as such may be percent-encoded. The current code simply
uses them as-is without any decoding.

With this patch, we will now percent-decode any file:// or
ssh:// url (or ssh+git, git+ssh, etc) at the transport
layer. We continue to treat plain paths and "host:path"
syntax literally.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

make url-related functions reusableJeff King Sun, 23 May 2010 09:17:55 +0000 (05:17 -0400)

make url-related functions reusable

The is_url function and url percent-decoding functions were
static, but are generally useful. Let's make them available
to other parts of the code.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

grep: support NUL chars in search strings for -FRené Scharfe Sat, 22 May 2010 21:43:43 +0000 (23:43 +0200)

grep: support NUL chars in search strings for -F

Search patterns in a file specified with -f can contain NUL characters.
The current code ignores all characters on a line after a NUL.

Pass the actual length of the line all the way from the pattern file to
fixmatch() and use it for case-sensitive fixed string matching.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

grep: use REG_STARTEND for all matching if availableRené Scharfe Sat, 22 May 2010 21:35:07 +0000 (23:35 +0200)

grep: use REG_STARTEND for all matching if available

Refactor REG_STARTEND handling inlook_ahead() into a new helper,
regmatch(), and use it for line matching, too. This allows regex
matching beyond NUL characters if regexec() supports the flag. NUL
characters themselves are not matched in any way, though.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>