git
13 years agoMerge branch 'maint'
Junio C Hamano [Tue, 15 Feb 2011 19:03:22 +0000 (11:03 -0800)] 
Merge branch 'maint'

* maint:
  pull: do not display fetch usage on --help-all
  git-tag.txt: list all modes in the description
  commit,status: describe -u likewise
  add: describe --patch like checkout, reset
  commit,merge,tag: describe -m likewise
  clone,init: describe --template using the same wording
  commit,status: describe --porcelain just like push
  commit,tag: use same wording for -F
  configure: use AC_LANG_PROGRAM consistently
  string_list_append: always set util pointer to NULL
  correct type of EMPTY_TREE_SHA1_BIN

13 years agopull: do not display fetch usage on --help-all
Michael J Gruber [Mon, 14 Feb 2011 16:48:08 +0000 (17:48 +0100)] 
pull: do not display fetch usage on --help-all

Currently, "git pull --help-all" displays the fetch usage info.

Make it equivalent to "git pull -h" instead since "--help-all" is
documented in gitcli(7).

Do not try to sanitize the pull option parser (aka last hair puller).

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agogit-tag.txt: list all modes in the description
Michael J Gruber [Tue, 15 Feb 2011 13:09:10 +0000 (14:09 +0100)] 
git-tag.txt: list all modes in the description

Currently, the description sounds as if it applied always, but most of
its content is true in "create tag mode" only.

Make this clearer by listing all modes upfront.

Also, sneak in some linguistic improvements and make it clearer that
lightweight tags are "created" because "written" may be misread as
"are output".

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agocommit,status: describe -u likewise
Michael J Gruber [Tue, 15 Feb 2011 13:09:09 +0000 (14:09 +0100)] 
commit,status: describe -u likewise

They differ by one character only. Being exactly equal should help
translations.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoadd: describe --patch like checkout, reset
Michael J Gruber [Tue, 15 Feb 2011 13:09:08 +0000 (14:09 +0100)] 
add: describe --patch like checkout, reset

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agocommit,merge,tag: describe -m likewise
Michael J Gruber [Tue, 15 Feb 2011 13:09:07 +0000 (14:09 +0100)] 
commit,merge,tag: describe -m likewise

This also removes the superfluous "specify" and rewords the misleading
"if any" which sounds as if omitting "-m" would omit the merge commit
message. (It means "if a merge commit is created at all".)

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoclone,init: describe --template using the same wording
Michael J Gruber [Tue, 15 Feb 2011 13:09:06 +0000 (14:09 +0100)] 
clone,init: describe --template using the same wording

This also corrects a wrong description for clone.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agocommit,status: describe --porcelain just like push
Michael J Gruber [Tue, 15 Feb 2011 13:09:05 +0000 (14:09 +0100)] 
commit,status: describe --porcelain just like push

Push has the clearer description, so take that one for all.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agocommit,tag: use same wording for -F
Michael J Gruber [Tue, 15 Feb 2011 13:09:04 +0000 (14:09 +0100)] 
commit,tag: use same wording for -F

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoRevert "unpack_trees(): skip trees that are the same in all input"
Junio C Hamano [Tue, 15 Feb 2011 18:47:04 +0000 (10:47 -0800)] 
Revert "unpack_trees(): skip trees that are the same in all input"

This reverts commit 83c90314aa27ae3768c04375d02e4f3fb12b726d, which
seems to have broken merge to report conflicts when there should be
none.

13 years agoRename t2019 with typo "amiguous" that meant "ambiguous"
Junio C Hamano [Tue, 15 Feb 2011 18:43:45 +0000 (10:43 -0800)] 
Rename t2019 with typo "amiguous" that meant "ambiguous"

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoperl: command_bidi_pipe() method should set-up git environmens
Masatake Osanai [Mon, 14 Feb 2011 22:13:04 +0000 (07:13 +0900)] 
perl: command_bidi_pipe() method should set-up git environmens

When command_input_pipe and command_output_pipe are used as a
method of a Git::repository instance, they eventually call into
_cmd_exec method that sets up the execution environment such as
GIT_DIR, GIT_WORK_TREE environment variables and the current
working directory in the child process that interacts with the
repository.

command_bidi_pipe however didn't expect to be called as such, and
lacked all these set-up.  Because of this, a program that did this
did not work as expected:

    my $repo = Git->repository(Directory => '/some/where/else');
    my ($pid, $in, $out, $ctx) =
    $repo->command_bidi_pipe(qw(hash-object -w --stdin-paths));

This patch refactors the _cmd_exec into _setup_git_cmd_env that
sets up the execution environment, and makes _cmd_exec and
command_bidi_pipe to use it.

Note that unlike _cmd_exec that execv's a git command as an
external process, command_bidi_pipe is called from the main line
of control, and the execution environment needs to be restored
after open2() does its magic.

Signed-off-by: Masatake Osanai <unpush@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoconfigure: use AC_LANG_PROGRAM consistently
Ralf Wildenhues [Sun, 2 Jan 2011 10:24:55 +0000 (11:24 +0100)] 
configure: use AC_LANG_PROGRAM consistently

Avoid warnings from Autoconf 2.68 about missing use of AC_LANG_PROGRAM
and friends.

Quoting autoconf-2.68/NEWS:

  ** The macros AC_PREPROC_IFELSE, AC_COMPILE_IFELSE, AC_LINK_IFELSE, and
     AC_RUN_IFELSE now warn if the first argument failed to use
     AC_LANG_SOURCE or AC_LANG_PROGRAM to generate the conftest file
     contents.  A new macro AC_LANG_DEFINES_PROVIDED exists if you have
     a compelling reason why you cannot use AC_LANG_SOURCE but must
     avoid the warning.

The underlying reason for that change is that AC_LANG_{SOURCE,PROGRAM}
take care to supply the previously computed set of #defines (and
include standard headers if so desired) for preprocessed languages
like C and C++.

In some cases, AC_LANG_PROGRAM is already used but not sufficiently
m4-quoted, so we just need to add another set of [quotes] to prevent
the autoconf warning from being triggered bogusly.  Quoting all
arguments (except when calling special macros that need to be expanded
before recursion) is better style, anyway.  These and more rules are
described in detail in 'info Autoconf "Programming in M4"'.

No change in the resulting config.mak.autogen after running
./configure intended.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agostring_list_append: always set util pointer to NULL
Jeff King [Sat, 12 Feb 2011 05:18:51 +0000 (00:18 -0500)] 
string_list_append: always set util pointer to NULL

It is not immediately obvious that the util field may
contain random bytes after appending an item. Especially
since the string_list_insert* functions _do_ explicitly zero
the util pointer.

This does not appear to be a bug in any current git code, as
all callers either fill in the util field immediately or
never use it. However, it is worth it to be less surprising
to new users of the string-list API who may expect it to be
intialized to NULL.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agocorrect type of EMPTY_TREE_SHA1_BIN
Jonathan Nieder [Mon, 7 Feb 2011 08:17:27 +0000 (02:17 -0600)] 
correct type of EMPTY_TREE_SHA1_BIN

Functions such as hashcmp that expect a binary SHA-1 value take
parameters of type "unsigned char *" to avoid accepting a textual
SHA-1 passed by mistake.  Unfortunately, this means passing the string
literal EMPTY_TREE_SHA1_BIN requires an ugly cast.  Tweak the
definition of EMPTY_TREE_SHA1_BIN to produce a value of more
convenient type.

In the future the definition might change to

extern const unsigned char empty_tree_sha1_bin[20];
#define EMPTY_TREE_SHA1_BIN empty_tree_sha1_bin

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoObey p4 views when using client spec
Ian Wienand [Sat, 12 Feb 2011 00:33:48 +0000 (16:33 -0800)] 
Obey p4 views when using client spec

When using the p4 client spec, this attempts to obey the client's
output preferences.

For example, a view like

//depot/foo/branch/... //client/branch/foo/...
//depot/bar/branch/... //client/branch/bar/...

will result in a directory layout in the git tree of

branch/
branch/foo
branch/bar

p4 can do various other reordering that this change doesn't support,
but we should detect it and at least fail nicely.

Signed-off-by: Ian Wienand <ianw@vmware.com>
Acked-by: Pete Wyckoff <pw@padd.com>
Acked-by: Tor Arvid Lund <torarvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agogitignore: add test-mktemp to ignore list
Ævar Arnfjörð Bjarmason [Sat, 12 Feb 2011 23:21:17 +0000 (23:21 +0000)] 
gitignore: add test-mktemp to ignore list

Change the .gitignore to ignore test-mktemp which is built from
test-mktemp.c. Arnout Engelen added this in 6cf6bb3 (Improve error
messages when temporary file creation fails, 2010-12-18) but forgot
to add a corresponding entry to .gitignore.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agorepo-config: add deprecation warning
René Scharfe [Sat, 12 Feb 2011 13:24:10 +0000 (14:24 +0100)] 
repo-config: add deprecation warning

repo-config was deprecated in 5c66d0d4 on 2008-01-17.  Warn the
remaining users that it has been replaced by config and is going to
be removed eventually.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMerge branch 'maint'
Junio C Hamano [Sat, 12 Feb 2011 00:01:47 +0000 (16:01 -0800)] 
Merge branch 'maint'

* maint:
  Git 1.7.4.1
  clone: fixup recurse_submodules option
  svn-fe: warn about experimental status

Conflicts:
contrib/examples/git-revert.sh
contrib/svn-fe/svn-fe.txt

13 years agoGit 1.7.4.1 v1.7.4.1
Junio C Hamano [Fri, 11 Feb 2011 22:39:55 +0000 (14:39 -0800)] 
Git 1.7.4.1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMerge branch 'jc/fsck-fixes' into maint
Junio C Hamano [Fri, 11 Feb 2011 22:26:10 +0000 (14:26 -0800)] 
Merge branch 'jc/fsck-fixes' into maint

* jc/fsck-fixes:
  fsck: do not give up too early in fsck_dir()
  fsck: drop unused parameter from traverse_one_object()

13 years agoclone: fixup recurse_submodules option
Chris Packham [Thu, 10 Feb 2011 22:59:31 +0000 (11:59 +1300)] 
clone: fixup recurse_submodules option

The recurse_submodules option was added in ccdd3da6 to bring 'git clone'
into line with 'git fetch' and future commands. The correct option should
have been "recurse-submodules".

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agosvn-fe: warn about experimental status
Jonathan Nieder [Fri, 11 Feb 2011 10:36:44 +0000 (04:36 -0600)] 
svn-fe: warn about experimental status

svn-fe is young and some coming cleanups might involve backward
incompatible UI changes.  Add some words of warning to the manual so
early adopters that are not following the project closely don't get
burned.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMerge branch 'maint'
Junio C Hamano [Thu, 10 Feb 2011 22:45:55 +0000 (14:45 -0800)] 
Merge branch 'maint'

* maint:
  compat: helper for detecting unsigned overflow

13 years agocompat: helper for detecting unsigned overflow
Jonathan Nieder [Mon, 11 Oct 2010 02:59:26 +0000 (21:59 -0500)] 
compat: helper for detecting unsigned overflow

The idiom (a + b < a) works fine for detecting that an unsigned
integer has overflowed, but a more explicit

unsigned_add_overflows(a, b)

might be easier to read.

Define such a macro, expanding roughly to ((a) < UINT_MAX - (b)).
Because the expansion uses each argument only once outside of sizeof()
expressions, it is safe to use with arguments that have side effects.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMerge branch 'tr/merge-unborn-clobber'
Junio C Hamano [Thu, 10 Feb 2011 00:41:17 +0000 (16:41 -0800)] 
Merge branch 'tr/merge-unborn-clobber'

* tr/merge-unborn-clobber:
  Exhibit merge bug that clobbers index&WT

Conflicts:
t/t7607-merge-overwrite.sh

13 years agoMerge branch 'jc/unpack-trees'
Junio C Hamano [Thu, 10 Feb 2011 00:41:17 +0000 (16:41 -0800)] 
Merge branch 'jc/unpack-trees'

* jc/unpack-trees:
  unpack_trees(): skip trees that are the same in all input
  unpack-trees.c: cosmetic fix

Conflicts:
unpack-trees.c

13 years agoMerge branch 'jc/fsck-fixes'
Junio C Hamano [Thu, 10 Feb 2011 00:41:17 +0000 (16:41 -0800)] 
Merge branch 'jc/fsck-fixes'

* jc/fsck-fixes:
  fsck: do not give up too early in fsck_dir()
  fsck: drop unused parameter from traverse_one_object()

13 years agoMerge branch 'tr/diff-words-test'
Junio C Hamano [Thu, 10 Feb 2011 00:41:17 +0000 (16:41 -0800)] 
Merge branch 'tr/diff-words-test'

* tr/diff-words-test:
  t4034 (diff --word-diff): add a minimum Perl drier test vector
  t4034 (diff --word-diff): style suggestions
  userdiff: simplify word-diff safeguard
  t4034: bulk verify builtin word regex sanity

13 years agoMerge branch 'rr/fi-import-marks-if-exists'
Junio C Hamano [Thu, 10 Feb 2011 00:41:16 +0000 (16:41 -0800)] 
Merge branch 'rr/fi-import-marks-if-exists'

* rr/fi-import-marks-if-exists:
  fast-import: Introduce --import-marks-if-exists

13 years agoMerge branch 'jn/unpack-lstat-failure-report'
Junio C Hamano [Thu, 10 Feb 2011 00:41:16 +0000 (16:41 -0800)] 
Merge branch 'jn/unpack-lstat-failure-report'

* jn/unpack-lstat-failure-report:
  unpack-trees: handle lstat failure for existing file
  unpack-trees: handle lstat failure for existing directory

13 years agoMerge branch 'ef/alias-via-run-command'
Junio C Hamano [Thu, 10 Feb 2011 00:41:16 +0000 (16:41 -0800)] 
Merge branch 'ef/alias-via-run-command'

* ef/alias-via-run-command:
  alias: use run_command api to execute aliases

13 years agoMerge branch 'cb/setup'
Junio C Hamano [Thu, 10 Feb 2011 00:41:16 +0000 (16:41 -0800)] 
Merge branch 'cb/setup'

* cb/setup:
  setup: translate symlinks in filename when using absolute paths

13 years agoMerge branch 'ae/better-template-failure-report'
Junio C Hamano [Thu, 10 Feb 2011 00:41:16 +0000 (16:41 -0800)] 
Merge branch 'ae/better-template-failure-report'

* ae/better-template-failure-report:
  Improve error messages when temporary file creation fails

13 years agoMerge branch 'jn/cherry-pick-strategy-option'
Junio C Hamano [Thu, 10 Feb 2011 00:41:16 +0000 (16:41 -0800)] 
Merge branch 'jn/cherry-pick-strategy-option'

* jn/cherry-pick-strategy-option:
  cherry-pick/revert: add support for -X/--strategy-option

13 years agoMerge branch 'maint-1.7.0' into maint
Junio C Hamano [Thu, 10 Feb 2011 00:40:12 +0000 (16:40 -0800)] 
Merge branch 'maint-1.7.0' into maint

* maint-1.7.0:
  fast-import: introduce "feature notes" command
  fast-import: clarify documentation of "feature" command

Conflicts:
Documentation/git-fast-import.txt

13 years agofast-import: introduce "feature notes" command
Jonathan Nieder [Wed, 9 Feb 2011 22:43:57 +0000 (16:43 -0600)] 
fast-import: introduce "feature notes" command

Here is a 'feature' command for streams to use to require support for
the notemodify (N) command.

When the 'feature' facility was introduced (v1.7.0-rc0~95^2~4,
2009-12-04), the notes import feature was old news (v1.6.6-rc0~21^2~8,
2009-10-09) and it was not obvious it deserved to be a named feature.
But now that is clear, since all major non-git fast-import backends
lack support for it.

Details: on git version with this patch applied, any "feature notes"
command in the features/options section at the beginning of a stream
will be treated as a no-op.  On fast-import implementations without
the feature (and older git versions), the command instead errors out
with a message like

This version of fast-import does not support feature notes.

So by declaring use of notes at the beginning of a stream, frontends
can avoid wasting time and other resources when the backend does not
support notes.  (This would be especially important for backends that
do not support rewinding history after a botched import.)

Improved-by: Thomas Rast <trast@student.ethz.ch>
Improved-by: Sverre Rabbelier <srabbelier@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agofast-import: clarify documentation of "feature" command
Jonathan Nieder [Sun, 28 Nov 2010 19:43:57 +0000 (13:43 -0600)] 
fast-import: clarify documentation of "feature" command

The "feature" command allows streams to specify options for the import
that must not be ignored.  Logically, they are part of the stream,
even though technically most supported features are synonyms to
command-line options.

Make this more obvious by being more explicit about how the analogy
between most "feature" commands and command-line options works.  Treat
the feature (import-marks) that does not fit this analogy separately.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Sverre Rabbelier <srabbelier@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoDocumentation/merge subtree How-To: fix typo
Uwe Kleine-König [Wed, 9 Feb 2011 09:04:43 +0000 (10:04 +0100)] 
Documentation/merge subtree How-To: fix typo

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agocheckout: rearrange update_refs_for_switch for clarity
Jonathan Nieder [Tue, 8 Feb 2011 10:34:34 +0000 (04:34 -0600)] 
checkout: rearrange update_refs_for_switch for clarity

Take care of simple, exceptional cases before the meat of the "check
out by branch name" code begins.  After this change, the function
vaguely follows the following pseudocode:

if (-B or -b)
create branch;
if (plain "git checkout" or "git checkout HEAD")
;
else if (--detach or checking out by non-branch commit name)
detach HEAD;
else if (checking out by branch name)
attach HEAD;

One nice side benefit is to make it possible to remove handling of
the --detach option from outside switch_branches.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agocheckout: introduce --detach synonym for "git checkout foo^{commit}"
Junio C Hamano [Tue, 8 Feb 2011 10:32:49 +0000 (04:32 -0600)] 
checkout: introduce --detach synonym for "git checkout foo^{commit}"

For example, one might use this when making a temporary merge to
test that two topics work well together.

Patch by Junio, with tests from Jeff King.

[jn: with some extra checks for bogus commandline usage]

Suggested-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agocheckout: split off a function to peel away branchname arg
Jonathan Nieder [Tue, 8 Feb 2011 10:29:09 +0000 (04:29 -0600)] 
checkout: split off a function to peel away branchname arg

The code to parse and consume the tree name and "--" in commands such
as "git checkout @{-1} -- '*.c'" is intimidatingly long.  Split it out
into a separate function and make it easier to skip on first reading
by making the data it uses and produces more explicit.

No functional change intended.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agomingw_rmdir: set errno=ENOTEMPTY when appropriate
Johannes Schindelin [Mon, 7 Feb 2011 20:54:01 +0000 (21:54 +0100)] 
mingw_rmdir: set errno=ENOTEMPTY when appropriate

On Windows, EACCES overrules ENOTEMPTY when calling rmdir(). But if the
directory is busy, we only want to retry deleting the directory if it
is empty, so test specifically for that case and set ENOTEMPTY rather
than EACCES.

Noticed by Greg Hazel.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agomingw: add fallback for rmdir in case directory is in use
Heiko Voigt [Mon, 7 Feb 2011 20:52:34 +0000 (21:52 +0100)] 
mingw: add fallback for rmdir in case directory is in use

The same logic as for unlink and rename also applies to rmdir. For
example in case you have a shell open in a git controlled folder. This
will easily fail. So lets be nice for such cases as well.

Signed-off-by: Heiko Voigt <heiko.voigt@mahr.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agomingw: make failures to unlink or move raise a question
Heiko Voigt [Mon, 7 Feb 2011 20:51:21 +0000 (21:51 +0100)] 
mingw: make failures to unlink or move raise a question

On Windows in case a program is accessing a file unlink or
move operations may fail. To give the user a chance to correct
this we simply wait until the user asks us to retry or fail.

This is useful because of the following use case which seem
to happen rarely but when it does it is a mess:

After making some changes the user realizes that he was on the
incorrect branch. When trying to change the branch some file
is still in use by some other process and git stops in the
middle of changing branches. Now the user has lots of files
with changes mixed with his own. This is especially confusing
on repositories that contain lots of files.

Although the recent implementation of automatic retry makes
this scenario much more unlikely lets provide a fallback as
a last resort.

Thanks to Albert Dvornik for disabling the question if users can't see it.

If the stdout of the command is connected to a terminal but the stderr
has been redirected, the odds are good that the user can't see any
question we print out to stderr.  This will result in a "mysterious
hang" while the app is waiting for user input.

It seems better to be conservative, and avoid asking for input
whenever the stderr is not a terminal, just like we do for stdin.

Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
Signed-off-by: Albert Dvornik <dvornik+git@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agomingw: work around irregular failures of unlink on windows
Heiko Voigt [Mon, 7 Feb 2011 20:50:26 +0000 (21:50 +0100)] 
mingw: work around irregular failures of unlink on windows

If a file is opened by another process (e.g. indexing of an IDE) for
reading it is not allowed to be deleted. So in case unlink fails retry
after waiting for some time. This extends the workaround from 6ac6f878.

Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agomingw: move unlink wrapper to mingw.c
Heiko Voigt [Mon, 7 Feb 2011 20:49:33 +0000 (21:49 +0100)] 
mingw: move unlink wrapper to mingw.c

The next patch implements a workaround in case unlink fails on Windows.

Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agopull: Document the "--[no-]recurse-submodules" options
Jens Lehmann [Mon, 7 Feb 2011 22:24:54 +0000 (23:24 +0100)] 
pull: Document the "--[no-]recurse-submodules" options

In commits be254a0ea9 and 7dce19d374 the handling of the new fetch options
"--[no-]recurse-submodules" had been added to git-pull.sh. But they were
not documented as the pull options they now are, so let's fix that.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoquote.h: simplify the inclusion
Jonathan Nieder [Wed, 5 Jan 2011 00:36:34 +0000 (18:36 -0600)] 
quote.h: simplify the inclusion

Attempting to include quote.h without first including strbuf.h results
in warnings:

 ./quote.h:33:33: warning: ‘struct strbuf’ declared inside parameter list
 ./quote.h:33:33: warning: its scope is only this definition or declaration, which is probably not what you want
 ./quote.h:34:34: warning: ‘struct strbuf’ declared inside parameter list
 ...

Add a toplevel declaration for struct strbuf to avoid this.

While at it, stop including system headers from quote.h.  git source
files already need to include git-compat-util.h sooner to ensure the
appropriate feature test macros are defined.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agosha1_object_info: examine cached_object store too
Nguyễn Thái Ngọc Duy [Sat, 5 Feb 2011 14:03:02 +0000 (21:03 +0700)] 
sha1_object_info: examine cached_object store too

Cached object store was added in d66b37b (Add pretend_sha1_file()
interface. - 2007-02-04) as a way to temporarily inject some objects
to object store.

But only read_sha1_file() knows about this store. While it will return
an object from this store, sha1_object_info() will happily say
"object not found".

Teach sha1_object_info() about the cached store for consistency.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agosha1_file.c: move find_cached_object up so sha1_object_info can use it
Nguyễn Thái Ngọc Duy [Sat, 5 Feb 2011 14:03:01 +0000 (21:03 +0700)] 
sha1_file.c: move find_cached_object up so sha1_object_info can use it

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMake hash-object more robust against malformed objects
Nguyễn Thái Ngọc Duy [Sat, 5 Feb 2011 10:52:21 +0000 (17:52 +0700)] 
Make hash-object more robust against malformed objects

Commits, trees and tags have structure. Don't let users feed git
with malformed ones. Sooner or later git will die() when
encountering them.

Note that this patch does not check semantics. A tree that points
to non-existent objects is perfectly OK (and should be so, users
may choose to add commit first, then its associated tree for example).

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoAdd const to parse_{commit,tag}_buffer()
Nguyễn Thái Ngọc Duy [Sat, 5 Feb 2011 10:52:20 +0000 (17:52 +0700)] 
Add const to parse_{commit,tag}_buffer()

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agodiff: support --cached on unborn branches
Nguyễn Thái Ngọc Duy [Thu, 3 Feb 2011 06:23:34 +0000 (13:23 +0700)] 
diff: support --cached on unborn branches

"git diff --cached" (without revision) used to mean "git diff --cached
HEAD" (i.e. the user was too lazy to type HEAD). This "correctly"
failed when there was no commit yet. But was that correctness useful?

This patch changes the definition of what particular command means.
It is a request to show what _would_ be committed without further "git
add". The internal implementation is the same "git diff --cached HEAD"
when HEAD exists, but when there is no commit yet, it compares the index
with an empty tree object to achieve the desired result.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agogitweb: Mention optional Perl modules in INSTALL
Jakub Narebski [Thu, 3 Feb 2011 23:20:48 +0000 (00:20 +0100)] 
gitweb: Mention optional Perl modules in INSTALL

Some optional additional Perl modules are required for some of extra
features.  Mention those in gitweb/INSTALL.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agopost-receive-email: suppress error if description file missing
Sitaram Chamarty [Thu, 3 Feb 2011 01:00:32 +0000 (06:30 +0530)] 
post-receive-email: suppress error if description file missing

Signed-off-by: Sitaram Chamarty <sitaramc@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agot7407: fix line endings for mingw build
Pat Thoyts [Thu, 3 Feb 2011 15:31:44 +0000 (15:31 +0000)] 
t7407: fix line endings for mingw build

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agot4120-apply-popt: help systems with core.filemode=false
Johannes Sixt [Thu, 3 Feb 2011 15:31:43 +0000 (15:31 +0000)] 
t4120-apply-popt: help systems with core.filemode=false

A test case verifies that filemode-only patches work as expected. Help
systems where "test -x" does not work by applying the test patch also to
the index, where the effects can be verified even on such systems.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agot3509: use unconstrained initial test to setup repository.
Pat Thoyts [Thu, 3 Feb 2011 15:31:42 +0000 (15:31 +0000)] 
t3509: use unconstrained initial test to setup repository.

The first test did not run on msysGit due to the SYMLINKS constraint and
so subsequent tests failed because the test repository was not initialized.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agostart_command: flush buffers in the WIN32 code path as well
Johannes Sixt [Fri, 4 Feb 2011 08:41:58 +0000 (09:41 +0100)] 
start_command: flush buffers in the WIN32 code path as well

The POSIX code path did The Right Thing already, but we have to do the same
on Windows.

This bug caused failures in t5526-fetch-submodules, where the output of
'git fetch --recurse-submodules' was in the wrong order.

Debugged-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agobundle: Use OFS_DELTA in bundle files
Shawn O. Pearce [Sun, 6 Feb 2011 00:58:53 +0000 (16:58 -0800)] 
bundle: Use OFS_DELTA in bundle files

git-bundle first appeared in 2e0afafe ("Add git-bundle") in Feb 2007,
and first shipped in Git 1.5.1.

However, OFS_DELTA is an even earlier invention, coming about in
eb32d236 ("introduce delta objects with offset to base") in Sep 2006,
and first shipped in Git 1.4.4.5.

OFS_DELTA is smaller, about 3.2%-5% smaller, and is typically faster
to access than REF_DELTA because the exact location of the delta base
is available after parsing the object header.  Since all bundle aware
versions of Git are also OFS_DELTA aware, just make it the default.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Acked-by: Nicolas Pitre <nico@fluxnic.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoAdd testcases showing how pathspecs are handled with rev-list --objects
Elijah Newren [Sun, 19 Sep 2010 23:24:29 +0000 (09:24 +1000)] 
Add testcases showing how pathspecs are handled with rev-list --objects

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMake rev-list --objects work together with pathspecs
Elijah Newren [Fri, 17 Dec 2010 13:26:47 +0000 (20:26 +0700)] 
Make rev-list --objects work together with pathspecs

When traversing commits, the selection of commits would heed the list of
pathspecs passed, but subsequent walking of the trees of those commits
would not.  This resulted in 'rev-list --objects HEAD -- <paths>'
displaying objects at unwanted paths.

Have process_tree() call tree_entry_interesting() to determine which paths
are interesting and should be walked.

Naturally, this change can provide a large speedup when paths are specified
together with --objects, since many tree entries are now correctly ignored.
Interestingly, though, this change also gives me a small (~1%) but
repeatable speedup even when no paths are specified with --objects.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agot6004: add pathspec globbing test for log family
Junio C Hamano [Mon, 31 Jan 2011 20:09:53 +0000 (12:09 -0800)] 
t6004: add pathspec globbing test for log family

Earlier e10cb0f (tree_entry_interesting(): support wildcard matching,
2010-12-15) and b3d4b34 (tree_entry_interesting(): optimize wildcard
matching when base is matched, 2010-12-15) added tests for globbing
support for diff-tree plumbing.  This is a follow-up to update the test
for revision traversal and path pruning machinery for the same topic.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agot7810: overlapping pathspecs and depth limit
Nguyễn Thái Ngọc Duy [Wed, 15 Dec 2010 15:02:56 +0000 (22:02 +0700)] 
t7810: overlapping pathspecs and depth limit

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agogrep: drop pathspec_matches() in favor of tree_entry_interesting()
Nguyễn Thái Ngọc Duy [Fri, 17 Dec 2010 12:45:33 +0000 (19:45 +0700)] 
grep: drop pathspec_matches() in favor of tree_entry_interesting()

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agogrep: use writable strbuf from caller for grep_tree()
Nguyễn Thái Ngọc Duy [Fri, 17 Dec 2010 12:44:25 +0000 (19:44 +0700)] 
grep: use writable strbuf from caller for grep_tree()

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agogrep: use match_pathspec_depth() for cache/worktree grepping
Nguyễn Thái Ngọc Duy [Wed, 15 Dec 2010 15:02:52 +0000 (22:02 +0700)] 
grep: use match_pathspec_depth() for cache/worktree grepping

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agogrep: convert to use struct pathspec
Nguyễn Thái Ngọc Duy [Wed, 15 Dec 2010 15:02:51 +0000 (22:02 +0700)] 
grep: convert to use struct pathspec

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoConvert ce_path_match() to use match_pathspec_depth()
Nguyễn Thái Ngọc Duy [Wed, 15 Dec 2010 15:02:50 +0000 (22:02 +0700)] 
Convert ce_path_match() to use match_pathspec_depth()

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoConvert ce_path_match() to use struct pathspec
Nguyễn Thái Ngọc Duy [Fri, 17 Dec 2010 12:43:07 +0000 (19:43 +0700)] 
Convert ce_path_match() to use struct pathspec

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agostruct rev_info: convert prune_data to struct pathspec
Nguyễn Thái Ngọc Duy [Fri, 17 Dec 2010 12:43:06 +0000 (19:43 +0700)] 
struct rev_info: convert prune_data to struct pathspec

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agopathspec: add match_pathspec_depth()
Nguyễn Thái Ngọc Duy [Wed, 15 Dec 2010 15:02:48 +0000 (22:02 +0700)] 
pathspec: add match_pathspec_depth()

match_pathspec_depth() is a clone of match_pathspec() except that it
can take depth limit. Computation is a bit lighter compared to
match_pathspec() because it's usually precomputed and stored in struct
pathspec.

In long term, match_pathspec() and match_one() should be removed in
favor of this function.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agotree_entry_interesting(): optimize wildcard matching when base is matched
Nguyễn Thái Ngọc Duy [Wed, 15 Dec 2010 15:02:47 +0000 (22:02 +0700)] 
tree_entry_interesting(): optimize wildcard matching when base is matched

If base is already matched, skip that part when calling
fnmatch(). This happens quite often if users start a command from
worktree's subdirectory and prefix is usually prepended to all
pathspecs.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agotree_entry_interesting(): support wildcard matching
Nguyễn Thái Ngọc Duy [Wed, 15 Dec 2010 15:02:46 +0000 (22:02 +0700)] 
tree_entry_interesting(): support wildcard matching

never_interesting optimization is disabled if there is any wildcard
pathspec, even if it only matches exactly on trees.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agotree_entry_interesting(): fix depth limit with overlapping pathspecs
Nguyễn Thái Ngọc Duy [Wed, 15 Dec 2010 15:02:45 +0000 (22:02 +0700)] 
tree_entry_interesting(): fix depth limit with overlapping pathspecs

Suppose we have two pathspecs 'a' and 'a/b' (both are dirs) and depth
limit 1. In current code, pathspecs are checked in input order. When
'a/b' is checked against pathspec 'a', it fails depth limit and
therefore is excluded, although it should match 'a/b' pathspec.

This patch reorders all pathspecs alphabetically, then teaches
tree_entry_interesting() to check against the deepest pathspec first,
so depth limit of a shallower pathspec won't affect a deeper one.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agotree_entry_interesting(): support depth limit
Nguyễn Thái Ngọc Duy [Wed, 15 Dec 2010 15:02:44 +0000 (22:02 +0700)] 
tree_entry_interesting(): support depth limit

This is needed to replace pathspec_matches() in builtin/grep.c.

max_depth == -1 means infinite depth. Depth limit is only effective
when pathspec.recursive == 1. When pathspec.recursive == 0, the
behavior depends on match functions: non-recursive for
tree_entry_interesting() and recursive for match_pathspec{,_depth}

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agotree_entry_interesting(): refactor into separate smaller functions
Nguyễn Thái Ngọc Duy [Wed, 15 Dec 2010 15:02:43 +0000 (22:02 +0700)] 
tree_entry_interesting(): refactor into separate smaller functions

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agodiff-tree: convert base+baselen to writable strbuf
Nguyễn Thái Ngọc Duy [Wed, 15 Dec 2010 15:02:42 +0000 (22:02 +0700)] 
diff-tree: convert base+baselen to writable strbuf

In traversing trees, a full path is splitted into two parts: base
directory and entry. They are however quite often concatenated
whenever a full path is needed. Current code allocates a new buffer,
do two memcpy(), use it, then release.

Instead this patch turns "base" to a writable, extendable buffer. When
a concatenation is needed, the callee only needs to append "entry" to
base, use it, then truncate the entry out again. "base" must remain
unchanged before and after entering a function.

This avoids quite a bit of malloc() and memcpy().

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoglossary: define pathspec
Jonathan Nieder [Wed, 15 Dec 2010 15:02:41 +0000 (22:02 +0700)] 
glossary: define pathspec

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMove tree_entry_interesting() to tree-walk.c and export it
Nguyễn Thái Ngọc Duy [Wed, 15 Dec 2010 15:02:40 +0000 (22:02 +0700)] 
Move tree_entry_interesting() to tree-walk.c and export it

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agotree_entry_interesting(): remove dependency on struct diff_options
Nguyễn Thái Ngọc Duy [Wed, 15 Dec 2010 15:02:39 +0000 (22:02 +0700)] 
tree_entry_interesting(): remove dependency on struct diff_options

This function can be potentially used in more places than just
tree-diff.c. "struct diff_options" does not make much sense outside
diff_tree_sha1().

While removing the use of diff_options, it also removes
tree_entry_extract() call, which means S_ISDIR() uses the entry->mode
directly, without being filtered by canon_mode() (called internally
inside tree_entry_extract).

The only use of the mode information in this function is to check the
type of the entry by giving it to S_ISDIR() macro, and the result does
not change with or without canon_mode(), so it is ok to bypass
tree_entry_extract().

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoConvert struct diff_options to use struct pathspec
Nguyễn Thái Ngọc Duy [Wed, 15 Dec 2010 15:02:38 +0000 (22:02 +0700)] 
Convert struct diff_options to use struct pathspec

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agodiff-no-index: use diff_tree_setup_paths()
Nguyễn Thái Ngọc Duy [Wed, 15 Dec 2010 15:02:37 +0000 (22:02 +0700)] 
diff-no-index: use diff_tree_setup_paths()

diff_options.{paths,nr_paths} will be removed later. Do not
modify them directly.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoAdd struct pathspec
Nguyễn Thái Ngọc Duy [Wed, 15 Dec 2010 15:02:36 +0000 (22:02 +0700)] 
Add struct pathspec

The old pathspec structure remains as pathspec.raw[]. New things are
stored in pathspec.items[]. There's no guarantee that the pathspec
order in raw[] is exactly as in items[].

raw[] is external (source) data and is untouched by pathspec
manipulation functions. It eases migration from old const char ** to
this new struct.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMerge branch 'jl/fetch-submodule-recursive' into maint
Junio C Hamano [Mon, 31 Jan 2011 18:05:57 +0000 (10:05 -0800)] 
Merge branch 'jl/fetch-submodule-recursive' into maint

* jl/fetch-submodule-recursive:
  t5526: Fix wrong argument order in "git config"

13 years agot5526: Fix wrong argument order in "git config"
Jens Lehmann [Mon, 31 Jan 2011 16:51:25 +0000 (17:51 +0100)] 
t5526: Fix wrong argument order in "git config"

This fixes a typo where the "git config" arguments "-f" and "--unset" were
swapped leading to the creation of a "--unset" file.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoGit 1.7.4 ko-master v1.7.4
Junio C Hamano [Sun, 30 Jan 2011 19:53:13 +0000 (11:53 -0800)] 
Git 1.7.4

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agofsck: do not give up too early in fsck_dir()
Junio C Hamano [Wed, 26 Jan 2011 21:01:54 +0000 (13:01 -0800)] 
fsck: do not give up too early in fsck_dir()

When there is a random garbage file whose name happens to be 38-byte
long in a .git/objects/??/ directory, the loop terminated prematurely
without marking all the other files that it hasn't checked in the
readdir() loop.

Treat such a file just like any other garbage file, and do not break out
of the readdir() loop.

While at it, replace repeated sprintf() calls to a single one outside the
loop.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agofsck: drop unused parameter from traverse_one_object()
Junio C Hamano [Wed, 26 Jan 2011 20:46:55 +0000 (12:46 -0800)] 
fsck: drop unused parameter from traverse_one_object()

Also add comments to seemingly unsafe pointer dereferences, that
are all safe.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoDon't pass "--xhtml" to hightlight in gitweb.perl script.
Adam Tkac [Thu, 27 Jan 2011 12:51:51 +0000 (13:51 +0100)] 
Don't pass "--xhtml" to hightlight in gitweb.perl script.

The "--xhtml" option is supported only in highlight < 3.0. There is no option
to enforce (X)HTML output format compatible with both highlight < 3.0 and
highlight >= 3.0. However default output format is HTML so we don't need to
explicitly specify it.

Signed-off-by: Adam Tkac <atkac@redhat.com>
Helped-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMerge branch 'maint'
Junio C Hamano [Thu, 27 Jan 2011 18:27:49 +0000 (10:27 -0800)] 
Merge branch 'maint'

* maint:
  rebase -i: clarify in-editor documentation of "exec"
  tests: sanitize more git environment variables
  fast-import: treat filemodify with empty tree as delete
  rebase: give a better error message for bogus branch
  rebase: use explicit "--" with checkout

Conflicts:
t/t9300-fast-import.sh

13 years agorebase -i: clarify in-editor documentation of "exec" ko-maint
Jonathan Nieder [Fri, 21 Jan 2011 00:36:24 +0000 (18:36 -0600)] 
rebase -i: clarify in-editor documentation of "exec"

The hints in the current "instruction sheet" template look like so:

 # Rebase 3f14246..a1d7e01 onto 3f14246
 #
 # Commands:
 #  p, pick = use commit
 #  r, reword = use commit, but edit the commit message
 #  e, edit = use commit, but stop for amending
 #  s, squash = use commit, but meld into previous commit
 #  f, fixup = like "squash", but discard this commit's log message
 #  x <cmd>, exec <cmd> = Run a shell command <cmd>, and stop if it fails
 #
 # If you remove a line here THAT COMMIT WILL BE LOST.
 # However, if you remove everything, the rebase will be aborted.
 #

This does not make it clear that the format of each line is

<insn> <commit id> <explanatory text that will be printed>

but the reader will probably infer that from the automatically
generated pick examples above it.

What about the "exec" instruction?  By analogy, I might imagine that
the format of that line is "exec <command> <explanatory text>", and
the "x <cmd>" hint does not address that question (at first I read it
as taking an argument <cmd> that is the name of a shell).  Meanwhile,
the mention of <cmd> makes the hints harder to scan as a table.

So remove the <cmd> and add some words to remind the reader that
"exec" runs a command named by the rest of the line.  To make room, it
is left to the manpage to explain that that command is run using
$SHELL and that nonzero status from that command will pause the
rebase.

Wording from Junio.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agotests: sanitize more git environment variables
Jeff King [Wed, 26 Jan 2011 20:33:32 +0000 (15:33 -0500)] 
tests: sanitize more git environment variables

These variables should generally not be set in one's
environment, but they do get set by rebase, which means
doing an interactive rebase like:

  pick abcd1234 foo
  exec make test

will cause false negatives in the test suite.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMerge branch 'jn/fast-import-empty-tree-removal' into maint
Junio C Hamano [Thu, 27 Jan 2011 18:23:53 +0000 (10:23 -0800)] 
Merge branch 'jn/fast-import-empty-tree-removal' into maint

* jn/fast-import-empty-tree-removal:
  fast-import: treat filemodify with empty tree as delete

13 years agofast-import: treat filemodify with empty tree as delete
Jonathan Nieder [Thu, 27 Jan 2011 06:07:49 +0000 (00:07 -0600)] 
fast-import: treat filemodify with empty tree as delete

Normal git processes do not allow one to build a tree with an empty
subtree entry without trying hard at it.  This is in keeping with the
general UI philosophy: git tracks content, not empty directories.

v1.7.3-rc0~75^2 (2010-06-30) changed that by making it easy to include
an empty subtree in fast-import's active commit:

M 040000 4b825dc642cb6eb9a060e54bf8d69288fbee4904 subdir

One can trigger this by reading an empty tree (for example, the tree
corresponding to an empty root commit) and trying to move it to a
subtree.  It is better and more closely analogous to 'git read-tree
--prefix' to treat such commands as requests to remove the subtree.

Noticed-by: David Barr <david.barr@cordelta.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agorebase: give a better error message for bogus branch
Jeff King [Thu, 27 Jan 2011 00:27:11 +0000 (19:27 -0500)] 
rebase: give a better error message for bogus branch

When you give a non-existent branch to git-rebase, it spits
out the usage. This can be confusing, since you may
understand the usage just fine, but simply have made a
mistake in the branch name.

Before:

  $ git rebase origin bogus
  Usage: git rebase ...

After:

  $ git rebase origin bogus
  fatal: no such branch: bogus
  Usage: git rebase ...

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agorebase: use explicit "--" with checkout
Jeff King [Thu, 27 Jan 2011 00:26:59 +0000 (19:26 -0500)] 
rebase: use explicit "--" with checkout

In the case of a ref/pathname conflict, checkout will
already do the right thing and checkout the ref. However,
for a non-existant ref, this has two advantages:

  1. If a file with that pathname exists, rebase will
     refresh the file from the index and then rebase the
     current branch instead of producing an error.

  2. If no such file exists, the error message using an
     explicit "--" is better:

       # before
       $ git rebase -i origin bogus
       error: pathspec 'bogus' did not match any file(s) known to git.
       Could not checkout bogus

       # after
       $ git rebase -i origin bogus
       fatal: invalid reference: bogus
       Could not checkout bogus

The problems seem to be trigger-able only through "git
rebase -i", as regular git-rebase checks the validity of the
branch parameter as a ref very early on. However, it doesn't
hurt to be defensive.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoGit 1.7.4-rc3 v1.7.4-rc3
Junio C Hamano [Mon, 24 Jan 2011 19:00:00 +0000 (11:00 -0800)] 
Git 1.7.4-rc3

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMerge branch 'as/userdiff-pascal'
Junio C Hamano [Mon, 24 Jan 2011 18:54:12 +0000 (10:54 -0800)] 
Merge branch 'as/userdiff-pascal'

* as/userdiff-pascal:
  userdiff: match Pascal class methods