git.git
16 years agomktree: do not barf on a submodule commit
Junio C Hamano [Sun, 10 May 2009 17:45:52 +0000 (10:45 -0700)]
mktree: do not barf on a submodule commit

It is perfectly normal if a tree entry points at a missing commit as long
as the mode of the entry says it is a submodule.

Signed-off-by: Junio C Hamano <redacted>
16 years agobuiltin-mktree.c: use a helper function to handle one line of input
Junio C Hamano [Sun, 10 May 2009 17:41:22 +0000 (10:41 -0700)]
builtin-mktree.c: use a helper function to handle one line of input

The main() function used to do the whole thing; this moves the handling of
a single input line to a separate function to make it easier to read.

Signed-off-by: Junio C Hamano <redacted>
16 years agomktree: use parse-options
Junio C Hamano [Sun, 10 May 2009 17:31:56 +0000 (10:31 -0700)]
mktree: use parse-options

Signed-off-by: Junio C Hamano <redacted>
16 years agols-tree manpage: output of ls-tree is compatible with update-index
Alex Riesen [Sun, 10 May 2009 16:14:49 +0000 (18:14 +0200)]
ls-tree manpage: output of ls-tree is compatible with update-index

Such format relationships are very useful things to remember for
script writers.

Signed-off-by: Alex Riesen <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agols-tree manpage: use "unless" instead of "when ... is not"
Alex Riesen [Sun, 10 May 2009 16:13:45 +0000 (18:13 +0200)]
ls-tree manpage: use "unless" instead of "when ... is not"

Delayed negation in a statement is harder to spot and keep in mind.

Signed-off-by: Alex Riesen <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agoam: simplify "sq" function by using "git rev-parse --sq-quote"
Christian Couder [Fri, 24 Apr 2009 06:29:01 +0000 (08:29 +0200)]
am: simplify "sq" function by using "git rev-parse --sq-quote"

Signed-off-by: Christian Couder <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agobisect: use "git rev-parse --sq-quote" instead of a custom "sq" function
Christian Couder [Fri, 24 Apr 2009 06:29:00 +0000 (08:29 +0200)]
bisect: use "git rev-parse --sq-quote" instead of a custom "sq" function

As the "sq" function was the only place using Perl in "git-bisect.sh",
this removes the Perl dependency in this script.

While at it, we also remove the sed instruction in the Makefile that
substituted @@PERL@@ with the Perl path in shell scripts, as this is
not needed anymore. (It is now only needed in "git-instaweb.sh" but
this command is dealt with separately in the Makefile.)

Signed-off-by: Christian Couder <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agorev-parse: add --sq-quote to shell quote arguments
Christian Couder [Sat, 25 Apr 2009 04:55:26 +0000 (06:55 +0200)]
rev-parse: add --sq-quote to shell quote arguments

Signed-off-by: Christian Couder <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agorev-list: remove stringed output flag from "show_bisect_vars"
Christian Couder [Tue, 21 Apr 2009 05:54:10 +0000 (07:54 +0200)]
rev-list: remove stringed output flag from "show_bisect_vars"

Because it was used only by "git bisect--helper --next-vars" but
the "--next-vars" option has been removed.

Signed-off-by: Christian Couder <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agobisect--helper: remove "--next-vars" option as it is now useless
Christian Couder [Tue, 21 Apr 2009 05:54:09 +0000 (07:54 +0200)]
bisect--helper: remove "--next-vars" option as it is now useless

Because it has been replaced by "--next-exit".

Signed-off-by: Christian Couder <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agobisect: use "git bisect--helper --next-exit" in "git-bisect.sh"
Christian Couder [Sun, 19 Apr 2009 09:56:16 +0000 (11:56 +0200)]
bisect: use "git bisect--helper --next-exit" in "git-bisect.sh"

instead of "git bisect--helper --next-vars".

Signed-off-by: Christian Couder <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agobisect--helper: add "--next-exit" to output bisect results
Christian Couder [Sun, 19 Apr 2009 09:56:07 +0000 (11:56 +0200)]
bisect--helper: add "--next-exit" to output bisect results

The goal of this patch is to port more shell code from the "bisect_next"
function in "git-bisect.sh" to C code in "builtin-bisect--helper.c".

So we port the code that interprets the bisection result and stops or
continues (by checking out the next revision) the bisection process.

Signed-off-by: Christian Couder <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agobisect: move common bisect functionality to "bisect_common"
Christian Couder [Sun, 19 Apr 2009 09:55:57 +0000 (11:55 +0200)]
bisect: move common bisect functionality to "bisect_common"

So we can easily reuse the code in a later patch.

Signed-off-by: Christian Couder <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agorev-list: refactor printing bisect vars
Christian Couder [Sun, 19 Apr 2009 09:55:43 +0000 (11:55 +0200)]
rev-list: refactor printing bisect vars

This simplifies the code, and while at it we create the
"print_commit_list" function that will be reused later.

Signed-off-by: Christian Couder <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agorev-list: make "estimate_bisect_steps" non static
Christian Couder [Sun, 19 Apr 2009 09:55:38 +0000 (11:55 +0200)]
rev-list: make "estimate_bisect_steps" non static

Because it will be used from "bisect.c" too.

Signed-off-by: Christian Couder <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agomerge-recursive: never leave index unmerged while recursing
Dave Olszewski [Sat, 9 May 2009 21:49:59 +0000 (14:49 -0700)]
merge-recursive: never leave index unmerged while recursing

When you are trying to come up with the final result (i.e. depth=0), you
want to record how the conflict arose by registering the state of the
common ancestor, your branch and the other branch in the index, hence you
want to do update_stages().

When you are merging with positive depth, that is because of a criss-cross
merge situation.  In such a case, you would need to record the tentative
result, with conflict markers and all, as if the merge went cleanly, even
if there are conflicts, in order to write it out as a tree object later to
be used as a common ancestor tree.

update_file() calls update_file_flags() with update_cache=1 to signal that
the result needs to be written to the index at stage #0 (i.e. merged), and
the code should not clobber the index further by calling update_stages().

The codepath to deal with rename/delete conflict in a recursive merge
however left the index unmerged.

Signed-off-by: Dave Olszewski <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agoTeach 'git checkout' to preload the index contents
Linus Torvalds [Sat, 9 May 2009 22:11:17 +0000 (15:11 -0700)]
Teach 'git checkout' to preload the index contents

This makes git checkout know to use the threaded index preloading if it
is enabled in the config file. You need to have

[core]
preloadindex = true

in your config file to see it, and for that feature to make sense your
filesystem needs to be able to do concurrent 'lstat()' lookups, but when
that is the case (especially NFS over a high-latency network), this can
be a noticeable performance win.

But with a low-latency network and at least older Linux NFS clients, this
will clearly potentially cause a lot of lock contention. It may still
speed up the uncached case, but the threading and locking overhead will
result in the cached case likely slowing down.

That was almost certainly fixed by Linux commit fc0f684c2 ("NFS: Remove
BKL from NFS lookup code"), but that one got merged into 2.6.27-rc1, so
older kernel versions than 2.6.27 will not scale very well.

But regardless, it's the right thing to do. If your filesystem doesn't
scale, don't enable index preloading.

Signed-off-by: Linus Torvalds <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agoAvoid unnecessary 'lstat()' calls in 'get_stat_data()'
Linus Torvalds [Sat, 9 May 2009 21:57:30 +0000 (14:57 -0700)]
Avoid unnecessary 'lstat()' calls in 'get_stat_data()'

When we ask get_stat_data() to get the mode and size of an index entry,
we can avoid the lstat() call if we have marked the index entry as being
uptodate due to earlier lstat() calls.

This avoids a lot of unnecessary lstat() calls in eg 'git checkout',
where the last phase shows the differences to the working tree
(requiring a diff), but earlier phases have already verified the index.

On the kernel repo (with a fast machine and everything cached), this
changes timings of a nul 'git checkout' from

 - Before (best of ten):

0.14user 0.05system 0:00.19elapsed 100%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+13237minor)pagefaults 0swaps

 - After
0.11user 0.03system 0:00.15elapsed 98%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+13235minor)pagefaults 0swaps

so it can obviously be noticeable, although equally obviously it's not a
show-stopper on this particular machine. The difference is likely larger
on slower machines, or with operating systems that don't do as good a job
of name caching.

Signed-off-by: Linus Torvalds <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agoMerge branch 'maint'
Junio C Hamano [Sat, 9 May 2009 16:27:43 +0000 (09:27 -0700)]
Merge branch 'maint'

* maint:
  Documentation: cloning to empty directory is allowed
  Clarify kind of conflict in merge-one-file helper
  git config: clarify --add and --get-color
  archive-tar.c: squelch a type mismatch warning

16 years agoallow -t abbreviation for --track in git branch
Sitaram Chamarty [Tue, 28 Apr 2009 15:21:20 +0000 (20:51 +0530)]
allow -t abbreviation for --track in git branch

also makes it consistent with git-checkout

Signed-off-by: Junio C Hamano <redacted>
16 years agoAdd --reference option to git submodule.
Michael S. Tsirkin [Mon, 4 May 2009 19:30:01 +0000 (22:30 +0300)]
Add --reference option to git submodule.

This adds --reference option to git submodule add and
git submodule update commands, which is passed to git clone.

Signed-off-by: Michael S. Tsirkin <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agoadd: don't complain when adding empty project root
Jeff King [Wed, 29 Apr 2009 03:21:01 +0000 (23:21 -0400)]
add: don't complain when adding empty project root

We try to warn the user if one of their pathspecs caused no
matches, as it may have been a typo. However, we disable the
warning if the pathspec points to an existing file, since
that means it is not a typo but simply an empty directory.

Unfortunately, the file_exists() test was broken for one
special case: the pathspec of the project root is just "".
This patch detects this special case and acts as if the file
exists (which it must, since it is the project root).

The user-visible effect is that this:

  $ mkdir repo && cd repo && git init && git add .

used to complain like:

  fatal: pathspec '' did not match any files

but now is a silent no-op.

Signed-off-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agoGit.pm: Always set Repository to absolute path if autodetecting
Frank Lichtenheld [Thu, 7 May 2009 13:41:28 +0000 (15:41 +0200)]
Git.pm: Always set Repository to absolute path if autodetecting

So far we only set it to absolute paths in some cases which lead
to problems like wc_chdir not working.

Signed-off-by: Frank Lichtenheld <redacted>
Acked-by: Petr Baudis <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agoGit.pm: Set GIT_WORK_TREE if we set GIT_DIR
Frank Lichtenheld [Thu, 7 May 2009 13:41:27 +0000 (15:41 +0200)]
Git.pm: Set GIT_WORK_TREE if we set GIT_DIR

Otherwise git will use the current directory as work tree which will
lead to unexpected results if we operate in sub directory of the
work tree.

Signed-off-by: Frank Lichtenheld <redacted>
Acked-by: Petr Baudis <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agomergetool--lib: specialize diff options for emerge and ecmerge
David Aguilar [Sat, 2 May 2009 08:57:21 +0000 (01:57 -0700)]
mergetool--lib: specialize diff options for emerge and ecmerge

The ecmerge documentation mentions the following form:

ecmerge --mode=diff2 $1 $2

Since git-difftool is about diffing, we should use that instead
of --mode=merge2.  Likewise, this drops the $MERGED argument to
emerge, as discussed on the git list ($gmane/117930).

Signed-off-by: David Aguilar <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agoformat-patch let -k override a config-specified format.numbered
Jim Meyering [Sat, 9 May 2009 08:12:01 +0000 (10:12 +0200)]
format-patch let -k override a config-specified format.numbered

Let a command-line --keep-subject (-k) override a config-specified
format.numbered (--numbered (-n)), rather than provoking the
"-n and -k are mutually exclusive" failure.
* t4021-format-patch-numbered.sh: Test for the above

Signed-off-by: Jim Meyering <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agofix GIT_TRACE segfault with shell-quoted aliases
Jeff King [Fri, 8 May 2009 09:06:15 +0000 (05:06 -0400)]
fix GIT_TRACE segfault with shell-quoted aliases

The alias argv comes from the split_cmdline function, which
splits the config text for the alias into an array of
strings. It returns the number of elements in the array, but
does not actually put a NULL at the end of the array.
Later, the trace function tries to print this argv and
assumes that it has the trailing NULL.

The split_cmdline function is probably at fault, since argv
lists almost always end with a NULL signal. This patch adds
one, in addition to the returned count; this doesn't hurt
the other callers at all, since they were presumably using
the count already (and will never look at the NULL).

While we're there and using ALLOC_GROW, let's clean up the
other manual grow.

Signed-off-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agoDisallow '\' in ref names
Robin Rosenberg [Fri, 8 May 2009 05:32:37 +0000 (07:32 +0200)]
Disallow '\' in ref names

This is asking for trouble since '\' is a directory separator in
Windows and thus may produce unpredictable results.

Signed-off-by: Robin Rosenberg <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agogitweb: Remove function prototypes (cleanup)
Jakub Narebski [Thu, 7 May 2009 17:11:29 +0000 (19:11 +0200)]
gitweb: Remove function prototypes (cleanup)

Use of function prototypes is considered bad practice in Perl.  The
ones used here didn't accomplish anything anyhow, so they've been
removed.

>From perlsub(1):

  [...] the intent of this feature [prototypes] is primarily to let
  you define subroutines that work like built-in functions [...]
  you can generate new syntax with it [...]

We don't want to have subroutines behaving exactly like built-in
functions, we don't want to define new syntax / syntactic sugar, so
prototypes in gitweb are not needed... and they can have unintended
consequences.

Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agoDocumentation: cloning to empty directory is allowed
Alexander Potashev [Thu, 7 May 2009 12:04:08 +0000 (16:04 +0400)]
Documentation: cloning to empty directory is allowed

Cloning into an existing empty directory is now allowed:
commit 55892d23981917aefdb387ad7d0429f90cbd446a
("Allow cloning to an existing empty directory")

Signed-off-by: Alexander Potashev <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agoExtend sample update hook, disable modifying of existing tags
Heiko Voigt [Fri, 8 May 2009 15:22:30 +0000 (17:22 +0200)]
Extend sample update hook, disable modifying of existing tags

Because no special rule for this existed it was allowed by default

Signed-off-by: Heiko Voigt <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agogrep: use parseopt
René Scharfe [Thu, 7 May 2009 19:46:48 +0000 (21:46 +0200)]
grep: use parseopt

Convert git-grep to parseopt.

The bitfields in struct grep_opt are converted to full ints,
increasing its size.  This shouldn't be a problem as there is only a
single instance in memory.

Signed-off-by: Rene Scharfe <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agogrep: remove global variable builtin_grep
René Scharfe [Thu, 7 May 2009 19:46:17 +0000 (21:46 +0200)]
grep: remove global variable builtin_grep

Replace the only global variable in builtin-grep.c, builtin_grep, by a
local one and a function parameter with reversed meaning.

Signed-off-by: Rene Scharfe <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agoparseopt: add PARSE_OPT_NODASH
René Scharfe [Thu, 7 May 2009 19:45:42 +0000 (21:45 +0200)]
parseopt: add PARSE_OPT_NODASH

Add support for options that don't start with a dash.  Initially, they
don't accept arguments and can only be short options, i.e. consist of a
single character.

Signed-off-by: Rene Scharfe <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agoparseopt: add OPT_NUMBER_CALLBACK
René Scharfe [Thu, 7 May 2009 19:45:08 +0000 (21:45 +0200)]
parseopt: add OPT_NUMBER_CALLBACK

Add a way to recognize numerical options.  The number is passed to
a callback function as a string.

Signed-off-by: Rene Scharfe <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agoparseopt: add OPT_NEGBIT
Jeff King [Fri, 8 May 2009 05:01:17 +0000 (01:01 -0400)]
parseopt: add OPT_NEGBIT

On Thu, May 07, 2009 at 09:44:17PM +0200, René Scharfe wrote:
Subject: [PATCH] ls-files: make --no-empty-directory properly negatable

This option was specified to parseopt as an OPT_BIT; however, we
actually want to _set_ the bit on --no-empty-directory. Thus the
existing implementation used --no-empty-directory, and required
--no-no-empty-directory to negate it.

Now that OPT_NEGBIT exists, we can properly support it as
--empty-directory and --no-empty-directory (but of course
still defaulting to showing empty directories).

Signed-off-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agoparseopt: add OPT_NEGBIT
René Scharfe [Thu, 7 May 2009 19:44:17 +0000 (21:44 +0200)]
parseopt: add OPT_NEGBIT

Add OPTION_NEGBIT and OPT_NEGBIT, mirroring OPTION_BIT and OPT_BIT.
OPT_NEGBIT can be used together with OPT_BIT to define two options
that cancel each other out.

Note: this patch removes the reminder from the test script because
it adds a test for --no-or4 and there already was one for --or4.

Signed-off-by: Rene Scharfe <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agoClarify kind of conflict in merge-one-file helper
Alex Riesen [Wed, 29 Apr 2009 21:40:50 +0000 (23:40 +0200)]
Clarify kind of conflict in merge-one-file helper

Not as verbose as the recursive merge driver, but better still.

Signed-off-by: Alex Riesen <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agogit config: clarify --add and --get-color
Felipe Contreras [Wed, 6 May 2009 22:57:08 +0000 (01:57 +0300)]
git config: clarify --add and --get-color

Signed-off-by: Felipe Contreras <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agoarchive-tar.c: squelch a type mismatch warning
Junio C Hamano [Thu, 7 May 2009 08:08:19 +0000 (01:08 -0700)]
archive-tar.c: squelch a type mismatch warning

On some systems, giving a value of type time_t to printf "%lo" that
expects an unsigned long would give a type mismatch warning.

Signed-off-by: Junio C Hamano <redacted>
16 years agoStart 1.6.4 development
Junio C Hamano [Sat, 9 May 2009 04:56:57 +0000 (21:56 -0700)]
Start 1.6.4 development

Signed-off-by: Junio C Hamano <redacted>
16 years agoStart 1.6.3.1 maintenance series.
Junio C Hamano [Sat, 9 May 2009 04:49:14 +0000 (21:49 -0700)]
Start 1.6.3.1 maintenance series.

Signed-off-by: Junio C Hamano <redacted>
16 years agoMerge branch 'maint-1.6.1' into maint-1.6.2
Junio C Hamano [Sat, 9 May 2009 04:13:47 +0000 (21:13 -0700)]
Merge branch 'maint-1.6.1' into maint-1.6.2

* maint-1.6.1:

16 years agoMerge branch 'maint-1.6.0' into maint-1.6.1
Junio C Hamano [Sat, 9 May 2009 04:12:41 +0000 (21:12 -0700)]
Merge branch 'maint-1.6.0' into maint-1.6.1

* maint-1.6.0:
  dir.c: Fix two minor grammatical errors in comments

16 years agoGIT 1.6.3
Junio C Hamano [Thu, 7 May 2009 00:13:27 +0000 (17:13 -0700)]
GIT 1.6.3

Signed-off-by: Junio C Hamano <redacted>
16 years agot4029: use sh instead of bash
Nguyễn Thái Ngọc Duy [Wed, 6 May 2009 14:33:34 +0000 (00:33 +1000)]
t4029: use sh instead of bash

Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agot4200: convert sed expression which operates on non-text file to perl
Brandon Casey [Wed, 6 May 2009 22:56:18 +0000 (17:56 -0500)]
t4200: convert sed expression which operates on non-text file to perl

POSIX only requires sed to work on text files and MERGE_RR is not a text
file.  Some versions of sed complain that this file is not newline
terminated, and exit non-zero.  Use perl instead which does not have a
problem with it.

Signed-off-by: Brandon Casey <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agot4200: remove two unnecessary lines
Brandon Casey [Wed, 6 May 2009 22:56:17 +0000 (17:56 -0500)]
t4200: remove two unnecessary lines

These two lines appear to be unnecessary.  They set variables which are not
used afterwards.  The primary motivation to remove them is that the sed
invocation exits non-zero for seds which require newline termination of
input files.

Signed-off-by: Brandon Casey <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agot/annotate-tests.sh: avoid passing a non-newline terminated file to sed
Brandon Casey [Wed, 6 May 2009 18:29:16 +0000 (13:29 -0500)]
t/annotate-tests.sh: avoid passing a non-newline terminated file to sed

Some versions of sed exit non-zero if the file they are supplied is not
newline terminated.  Solaris's /usr/xpg4/bin/sed is one such sed.  So
rework this test to avoid doing so.

This affects tests t8001-annotate.sh and t8002-blame.sh.

Signed-off-by: Junio C Hamano <redacted>
16 years agot4118: avoid sed invocation on file without terminating newline
Brandon Casey [Wed, 6 May 2009 18:29:15 +0000 (13:29 -0500)]
t4118: avoid sed invocation on file without terminating newline

Some versions of sed exit non-zero if the file they are supplied is not
newline terminated. Solaris's /usr/xpg4/bin/sed is one such sed.  In
this case the sed invocation can be avoided entirely since the resulting
file is equivalent to a previously created file.  So, just copy that file
into place instead.

Signed-off-by: Brandon Casey <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agot4118: add missing '&&'
Brandon Casey [Wed, 6 May 2009 18:29:14 +0000 (13:29 -0500)]
t4118: add missing '&&'

Signed-off-by: Brandon Casey <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agot8005: use egrep when extended regular expressions are required
Brandon Casey [Wed, 6 May 2009 18:31:42 +0000 (13:31 -0500)]
t8005: use egrep when extended regular expressions are required

Not all versions of grep understand backslashed extended regular
expressions.  Possibly only gnu grep does.

Signed-off-by: Brandon Casey <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agogit-clean doc: the command only affects paths under $(cwd)
Junio C Hamano [Wed, 6 May 2009 17:48:26 +0000 (10:48 -0700)]
git-clean doc: the command only affects paths under $(cwd)

Fredrik Skolmli and Thomas Rast noticed that it was left unstated that
"git clean" ran from a subdirectory will not affect anything outside it,
with or without path limiters.

Signed-off-by: Junio C Hamano <redacted>
16 years agoMerge branch 'maint'
Junio C Hamano [Wed, 6 May 2009 05:52:17 +0000 (22:52 -0700)]
Merge branch 'maint'

* maint:
  improve error message in config.c
  t4018-diff-funcname: add cpp xfuncname pattern to syntax test
  Work around BSD whose typeof(tv.tv_sec) != time_t
  git-am.txt: reword extra headers in message body
  git-am.txt: Use date or value instead of time or timestamp
  git-am.txt: add an 'a', say what 'it' is, simplify a sentence
  dir.c: Fix two minor grammatical errors in comments
  git-svn: fix a sloppy Getopt::Long usage

16 years agoMerge branch 'rj/maint-1.6.0-svn-parse-fix' into maint
Junio C Hamano [Wed, 6 May 2009 05:51:49 +0000 (22:51 -0700)]
Merge branch 'rj/maint-1.6.0-svn-parse-fix' into maint

* rj/maint-1.6.0-svn-parse-fix:
  git-svn: fix a sloppy Getopt::Long usage

16 years agoMerge branch 'maint-1.6.0' into maint
Junio C Hamano [Wed, 6 May 2009 05:51:31 +0000 (22:51 -0700)]
Merge branch 'maint-1.6.0' into maint

* maint-1.6.0:
  dir.c: Fix two minor grammatical errors in comments

16 years agoimprove error message in config.c
Alex Riesen [Wed, 29 Apr 2009 21:27:54 +0000 (23:27 +0200)]
improve error message in config.c

Show errno if opening a lockfile fails.

Signed-off-by: Alex Riesen <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agot4018-diff-funcname: add cpp xfuncname pattern to syntax test
Brandon Casey [Sat, 2 May 2009 14:31:16 +0000 (09:31 -0500)]
t4018-diff-funcname: add cpp xfuncname pattern to syntax test

Signed-off-by: Brandon Casey <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agoWork around BSD whose typeof(tv.tv_sec) != time_t
Bernd Ahlers [Mon, 6 Apr 2009 17:26:37 +0000 (19:26 +0200)]
Work around BSD whose typeof(tv.tv_sec) != time_t

According to POSIX, tv_sec is supposed to be a time_t, but OpenBSD
(and FreeBSD, too) defines it to be a long, which triggers a type
mismatch when a pointer to it is given to localtime_r().

Acked-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agogit-am.txt: reword extra headers in message body
Stephen Boyd [Mon, 4 May 2009 06:46:58 +0000 (23:46 -0700)]
git-am.txt: reword extra headers in message body

Signed-off-by: Stephen Boyd <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agogit-am.txt: Use date or value instead of time or timestamp
Stephen Boyd [Tue, 5 May 2009 05:19:00 +0000 (22:19 -0700)]
git-am.txt: Use date or value instead of time or timestamp

Signed-off-by: Stephen Boyd <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agogit-am.txt: add an 'a', say what 'it' is, simplify a sentence
Stephen Boyd [Tue, 5 May 2009 05:18:42 +0000 (22:18 -0700)]
git-am.txt: add an 'a', say what 'it' is, simplify a sentence

It's nice to know that 'it' is git-am or the subject line. Whitespace
implies characters so just remove characters.

Signed-off-by: Stephen Boyd <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agocompletion: complete values for send-email
Stephen Boyd [Mon, 4 May 2009 06:25:35 +0000 (23:25 -0700)]
completion: complete values for send-email

Add completion for --confirm, --suppress-cc, and --smtp-encryption
command line arguments. Add completion for aliasfiletype and confirm
configuration variables.

Since --smtp-ssl is deprecated, replace it with --smtp-encryption and
the two options ssl and tls.

Signed-off-by: Stephen Boyd <redacted>
Acked-by: Shawn O. Pearce <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agocompletion: complete values for log.date
Stephen Boyd [Mon, 4 May 2009 06:25:34 +0000 (23:25 -0700)]
completion: complete values for log.date

Add raw to the date formats too.

Signed-off-by: Stephen Boyd <redacted>
Acked-by: Shawn O. Pearce <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agocompletion: complete values for help.format
Stephen Boyd [Mon, 4 May 2009 06:25:33 +0000 (23:25 -0700)]
completion: complete values for help.format

Signed-off-by: Stephen Boyd <redacted>
Acked-by: Shawn O. Pearce <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agocompletion: add {gui,diff,merge}tool, man, and pager config variables
Stephen Boyd [Mon, 4 May 2009 06:25:32 +0000 (23:25 -0700)]
completion: add {gui,diff,merge}tool, man, and pager config variables

Signed-off-by: Stephen Boyd <redacted>
Acked-by: Shawn O. Pearce <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agocompletion: add missing configuration variables to _git_config()
Stephen Boyd [Mon, 4 May 2009 06:25:31 +0000 (23:25 -0700)]
completion: add missing configuration variables to _git_config()

Signed-off-by: Stephen Boyd <redacted>
Acked-by: Shawn O. Pearce <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agodir.c: Fix two minor grammatical errors in comments
Allan Caffee [Mon, 4 May 2009 17:37:30 +0000 (13:37 -0400)]
dir.c: Fix two minor grammatical errors in comments

Signed-off-by: Allan Caffee <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agogit-svn: fix a sloppy Getopt::Long usage
Robin H. Johnson [Tue, 5 May 2009 18:16:14 +0000 (11:16 -0700)]
git-svn: fix a sloppy Getopt::Long usage

Getopt-Long v2.38 is much stricter about sloppy getopt usage. The
trailing pipe causes git-svn testcases to fail for all of the --stdin
argument calls.

Signed-off-by: Robin H. Johnson <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agoSync with GIT 1.6.2.5
Junio C Hamano [Sun, 3 May 2009 23:46:34 +0000 (16:46 -0700)]
Sync with GIT 1.6.2.5

16 years agoGIT 1.6.2.5
Junio C Hamano [Sun, 3 May 2009 23:14:58 +0000 (16:14 -0700)]
GIT 1.6.2.5

Signed-off-by: Junio C Hamano <redacted>
16 years agoMerge branch 'np/maint-no-ofs-delta' into maint
Junio C Hamano [Sun, 3 May 2009 23:50:47 +0000 (16:50 -0700)]
Merge branch 'np/maint-no-ofs-delta' into maint

* np/maint-no-ofs-delta:
  honor repack.usedeltabaseoffset when fetching packs

16 years agoMerge branch 'maint-1.6.1' into maint
Junio C Hamano [Sun, 3 May 2009 23:14:07 +0000 (16:14 -0700)]
Merge branch 'maint-1.6.1' into maint

* maint-1.6.1:
  GIT 1.6.1.4

Conflicts:
GIT-VERSION-GEN

16 years agoGIT 1.6.1.4
Junio C Hamano [Sun, 3 May 2009 22:20:03 +0000 (15:20 -0700)]
GIT 1.6.1.4

With a handful of fixes backmerged from 1.6.2.X series

Signed-off-by: Junio C Hamano <redacted>
16 years agoMerge branch 'jc/maint-read-tree-multi' into maint
Junio C Hamano [Sun, 3 May 2009 22:02:59 +0000 (15:02 -0700)]
Merge branch 'jc/maint-read-tree-multi' into maint

* jc/maint-read-tree-multi:
  checkout branch: prime cache-tree fully
  read-tree -m A B: prime cache-tree from the switched-to tree
  Move prime_cache_tree() to cache-tree.c
  read-tree A B: do not corrupt cache-tree

16 years agoMerge branch 'mk/maint-apply-swap' into maint
Junio C Hamano [Sun, 3 May 2009 22:02:52 +0000 (15:02 -0700)]
Merge branch 'mk/maint-apply-swap' into maint

* mk/maint-apply-swap:
  tests: make test-apply-criss-cross-rename more robust
  builtin-apply: keep information about files to be deleted
  tests: test applying criss-cross rename patch

16 years agoMerge branch 'mm/maint-add-p-quit' into maint
Junio C Hamano [Sun, 3 May 2009 22:02:46 +0000 (15:02 -0700)]
Merge branch 'mm/maint-add-p-quit' into maint

* mm/maint-add-p-quit:
  git add -p: add missing "q" to patch prompt

16 years agoMerge branch 'lt/pack-object-memuse' into maint
Junio C Hamano [Sun, 3 May 2009 22:02:40 +0000 (15:02 -0700)]
Merge branch 'lt/pack-object-memuse' into maint

* lt/pack-object-memuse:
  show_object(): push path_name() call further down
  process_{tree,blob}: show objects without buffering

16 years agoMerge branch 'jc/maint-1.6.0-keep-pack' into maint-1.6.1
Junio C Hamano [Sun, 3 May 2009 22:01:31 +0000 (15:01 -0700)]
Merge branch 'jc/maint-1.6.0-keep-pack' into maint-1.6.1

* jc/maint-1.6.0-keep-pack:
  pack-objects: don't loosen objects available in alternate or kept packs
  t7700: demonstrate repack flaw which may loosen objects unnecessarily
  Remove --kept-pack-only option and associated infrastructure
  pack-objects: only repack or loosen objects residing in "local" packs
  git-repack.sh: don't use --kept-pack-only option to pack-objects
  t7700-repack: add two new tests demonstrating repacking flaws
  is_kept_pack(): final clean-up
  Simplify is_kept_pack()
  Consolidate ignore_packed logic more
  has_sha1_kept_pack(): take "struct rev_info"
  has_sha1_pack(): refactor "pretend these packs do not exist" interface
  git-repack: resist stray environment variable

16 years agoMerge branch 'jc/maint-1.6.0-diff-borrow-carefully' into maint-1.6.1
Junio C Hamano [Sun, 3 May 2009 22:01:26 +0000 (15:01 -0700)]
Merge branch 'jc/maint-1.6.0-diff-borrow-carefully' into maint-1.6.1

* jc/maint-1.6.0-diff-borrow-carefully:
  diff --cached: do not borrow from a work tree when a path is marked as assume-unchanged

16 years agoMerge branch 'bs/maint-1.6.0-tree-walk-prefix' into maint-1.6.1
Junio C Hamano [Sun, 3 May 2009 22:01:19 +0000 (15:01 -0700)]
Merge branch 'bs/maint-1.6.0-tree-walk-prefix' into maint-1.6.1

* bs/maint-1.6.0-tree-walk-prefix:
  match_tree_entry(): a pathspec only matches at directory boundaries
  tree_entry_interesting: a pathspec only matches at directory boundary

16 years agoGIT 1.6.3-rc4
Junio C Hamano [Sat, 2 May 2009 06:31:00 +0000 (23:31 -0700)]
GIT 1.6.3-rc4

Signed-off-by: Junio C Hamano <redacted>
16 years agohonor repack.usedeltabaseoffset when fetching packs
Nicolas Pitre [Sat, 2 May 2009 00:18:02 +0000 (20:18 -0400)]
honor repack.usedeltabaseoffset when fetching packs

If the local receiving repository has disabled the use of delta base
offset, for example to retain compatibility with older versions of
Git that predate OFS_DELTA, we shouldn't ask for ofs-delta support
when we obtain a pack from the remote server.

[ issue noticed by Shawn Pearce ]

Signed-off-by: Nicolas Pitre <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agoMerge git://repo.or.cz/git-gui
Junio C Hamano [Sat, 2 May 2009 05:11:57 +0000 (22:11 -0700)]
Merge git://repo.or.cz/git-gui

* git://repo.or.cz/git-gui:
  git-gui: Fixes for Mac OS X TkAqua
  git-gui: Update Russian translation
  git-gui: run post-checkout hook after clone
  git-gui: Ensure consistent usage of mergetool.keepBackup
  git-gui: fix use of undeclared variable diff_empty_count
  git-gui (Win): make starting via "Git GUI Here" on .git/ possible
  git-gui (Win): make "Explore Working Copy" more robust
  git-gui: run post-checkout hook on checkout
  git-gui: When calling post-commit hook wrong variable was cleared.
  git-gui: use `git --html-path` to get the location of installed HTML docs
  git-gui: fix deleting from the context menu with empty selection
  git-gui: minor spelling fix and string factorisation.
  git-gui: various French translation fixes
  git-gui: Fix merge conflict display error when filename contains spaces
  git-gui: don't hide the Browse button when resizing the repo chooser
  Append ampersand to "Target" of lnk files created by do_cygwin_shortcut
  git-gui: Support more git version notations.
  git-gui: Avoid an infinite rescan loop in handle_empty_diff.
  git-gui: Fix post-commit status with subject in non-locale encoding

16 years agoallow OFS_DELTA objects during a push
Nicolas Pitre [Fri, 1 May 2009 20:56:47 +0000 (16:56 -0400)]
allow OFS_DELTA objects during a push

The fetching of OFS_DELTA objects has been negotiated between both peers
since git version 1.4.4.  However, this was missing from the push side
where every OFS_DELTA objects were always converted to REF_DELTA objects
causing an increase in transferred data.

To fix this, both the client and the server processes have to be
modified: the former to invoke pack-objects with --delta-base-offset
when the server provides the ofs-delta capability, and the later to send
that capability when OFS_DELTA objects are allowed as already indicated
by the repack.usedeltabaseoffset config variable which is TRUE by
default since git v1.6.0.

Signed-off-by: Nicolas Pitre <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agoctype.c: fix typo in comment
René Scharfe [Fri, 1 May 2009 20:03:07 +0000 (22:03 +0200)]
ctype.c: fix typo in comment

Signed-off-by: Rene Scharfe <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agoFix a bunch of pointer declarations (codestyle)
Felipe Contreras [Fri, 1 May 2009 09:06:36 +0000 (12:06 +0300)]
Fix a bunch of pointer declarations (codestyle)

Essentially; s/type* /type */ as per the coding guidelines.

Signed-off-by: Felipe Contreras <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agogit-gui: Fixes for Mac OS X TkAqua
Daniel A. Steffen [Sat, 16 Aug 2008 01:20:09 +0000 (03:20 +0200)]
git-gui: Fixes for Mac OS X TkAqua

- detect more Tk.framework variants
- fix apple menu setup, use native preferences menu item
- don't set menu font

Signed-off-by: Daniel A. Steffen <redacted>
Signed-off-by: Shawn O. Pearce <redacted>
16 years agoMerge git://git.kernel.org/pub/scm/gitk/gitk
Junio C Hamano [Fri, 1 May 2009 02:56:28 +0000 (19:56 -0700)]
Merge git://git.kernel.org/pub/scm/gitk/gitk

* git://git.kernel.org/pub/scm/gitk/gitk:
  gitk: Add Russian translation
  gitk: Fix compare-commits function when we have local changes
  gitk: Avoid crash if closed while reading references
  gitk: Handle external diff tool with spaces in the path
  gitk: Remember and restore the window state with the geometry
  gitk: Map KP_Divide to focus the search box
  gitk: Mark some more strings for translation
  gitk: Mark forgotten string for translation
  gitk: Make .gitk a hidden file under windows
  gitk: Add a command to compare two strings of commits
  gitk: Add a way to mark a commit, plus a "find descendant" command
  gitk: Fixes for Mac OS X TkAqua
  gitk: Provide a 32x32 window icon based on the git logo
  gitk: Provide a window icon if possible
  gitk: Handle blobs containing a DOS end-of-file marker

16 years agoAbort if --rejoin fails.
Avery Pennarun [Fri, 1 May 2009 01:57:32 +0000 (21:57 -0400)]
Abort if --rejoin fails.

Thanks to Eduardo Kienetz for noticing this.

16 years agogitk: Use themed tk widgets
Pat Thoyts [Fri, 17 Apr 2009 00:24:35 +0000 (01:24 +0100)]
gitk: Use themed tk widgets

With Tk 8.5+, this uses the themed widgets to improve the appearance
on Windows and MacOSX.  On X11 less difference is apparent, but users
can select alternate themes by setting *TkTheme in the resource
database (eg: *TkTheme: clam).

With Tk 8.6 there is a built-in font selection dialog.  This will make
use of that when available, as on Windows and MacOSX it calls the
native font selection dialog.

[paulus@samba.org - folded in subsequent patch to restore saved
pane sizes for ttk widgets, and trimmed trailing whitespace.]

Signed-off-by: Pat Thoyts <redacted>
Signed-off-by: Paul Mackerras <redacted>
16 years agoMerge branch 'master' into dev
Paul Mackerras [Thu, 30 Apr 2009 23:34:57 +0000 (09:34 +1000)]
Merge branch 'master' into dev

16 years agogitk: Add Russian translation
Alex Riesen [Mon, 27 Apr 2009 18:04:27 +0000 (20:04 +0200)]
gitk: Add Russian translation

Thanks go to Dmitry Potapov for proofreading and suggested translation
of the word 'merge'.

Signed-off-by: Alex Riesen <redacted>
Signed-off-by: Paul Mackerras <redacted>
16 years agoClarify kind of conflict in merge-one-file helper
Alex Riesen [Wed, 29 Apr 2009 21:40:50 +0000 (23:40 +0200)]
Clarify kind of conflict in merge-one-file helper

Not as verbose as the recursive merge driver, but better still.

Signed-off-by: Alex Riesen <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agoimprove error message in config.c
Alex Riesen [Wed, 29 Apr 2009 21:27:54 +0000 (23:27 +0200)]
improve error message in config.c

Show errno if opening a lockfile fails.

Signed-off-by: Alex Riesen <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agoprint unlink(2) errno in copy_or_link_directory
Alex Riesen [Wed, 29 Apr 2009 21:24:52 +0000 (23:24 +0200)]
print unlink(2) errno in copy_or_link_directory

Signed-off-by: Alex Riesen <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agoreplace direct calls to unlink(2) with unlink_or_warn
Alex Riesen [Wed, 29 Apr 2009 21:22:56 +0000 (23:22 +0200)]
replace direct calls to unlink(2) with unlink_or_warn

This helps to notice when something's going wrong, especially on
systems which lock open files.

I used the following criteria when selecting the code for replacement:
- it was already printing a warning for the unlink failures
- it is in a function which already printing something or is
  called from such a function
- it is in a static function, returning void and the function is only
  called from a builtin main function (cmd_)
- it is in a function which handles emergency exit (signal handlers)
- it is in a function which is obvously cleaning up the lockfiles

Signed-off-by: Alex Riesen <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agoIntroduce an unlink(2) wrapper which gives warning if unlink failed
Alex Riesen [Wed, 29 Apr 2009 21:21:46 +0000 (23:21 +0200)]
Introduce an unlink(2) wrapper which gives warning if unlink failed

This seem to be a very common pattern in the current code.

The function prints a generic removal failure message, the file name
which failed and readable errno presentation. The function preserves
errno and always returns the value unlink(2) returned, but prints
no message for ENOENT, as it was the most often filtered out in the
code calling unlink. Besides, removing a file is anyway the purpose of
calling unlink.

Signed-off-by: Alex Riesen <redacted>
Signed-off-by: Junio C Hamano <redacted>
16 years agoMerge branch 'maint'
Junio C Hamano [Wed, 29 Apr 2009 23:50:31 +0000 (16:50 -0700)]
Merge branch 'maint'

* maint:
  diff -c -p: do not die on submodules

Conflicts:
combine-diff.c

16 years agodaemon.c: fix segfault on OS X
Benjamin Kramer [Mon, 27 Apr 2009 13:59:49 +0000 (15:59 +0200)]
daemon.c: fix segfault on OS X

On OS X (and maybe other unices), getaddrinfo(3) returns NULL
in the ai_canonname field if it's called with an IP address for
the hostname. We'll now use the IP address for the hostname if
ai_canonname was NULL, this also matches the behaviour on Linux.

steps to reproduce:
$ git daemon --export-all
$ git clone git://127.0.0.1/frotz
=> git daemon's fork (silently) segfaults.

Remove the pointless loop while at it. There is only one iteration
because of the break; on the last line and there are no continues.

Signed-off-by: Benjamin Kramer <redacted>
Signed-off-by: Junio C Hamano <redacted>
git clone https://git.99rst.org/PROJECT