git.git
15 years agoMerge branch 'jk/maint-1.6.0-trace-argv'
Junio C Hamano [Sat, 23 May 2009 08:39:08 +0000 (01:39 -0700)]
Merge branch 'jk/maint-1.6.0-trace-argv'

* jk/maint-1.6.0-trace-argv:
  fix GIT_TRACE segfault with shell-quoted aliases

Conflicts:
alias.c

15 years agoMerge branch 'jk/no-no-no-empty-directory'
Junio C Hamano [Sat, 23 May 2009 08:38:35 +0000 (01:38 -0700)]
Merge branch 'jk/no-no-no-empty-directory'

* jk/no-no-no-empty-directory:
  parseopt: add OPT_NEGBIT

15 years agoMerge branch 'rs/grep-parseopt'
Junio C Hamano [Sat, 23 May 2009 08:38:32 +0000 (01:38 -0700)]
Merge branch 'rs/grep-parseopt'

* rs/grep-parseopt:
  grep: make callback functions static
  grep: use parseopt
  grep: remove global variable builtin_grep
  parseopt: add PARSE_OPT_NODASH
  parseopt: add OPT_NUMBER_CALLBACK
  parseopt: add OPT_NEGBIT

15 years agoMerge branch 'fl/git-pm'
Junio C Hamano [Sat, 23 May 2009 08:38:28 +0000 (01:38 -0700)]
Merge branch 'fl/git-pm'

* fl/git-pm:
  Git.pm: Always set Repository to absolute path if autodetecting
  Git.pm: Set GIT_WORK_TREE if we set GIT_DIR

15 years agoMerge branch 'mt/submodule-reference'
Junio C Hamano [Sat, 23 May 2009 08:38:24 +0000 (01:38 -0700)]
Merge branch 'mt/submodule-reference'

* mt/submodule-reference:
  Add --reference option to git submodule.

15 years agogitweb: Sanitize title attribute in format_subject_html
Jakub Narebski [Fri, 22 May 2009 15:35:46 +0000 (17:35 +0200)]
gitweb: Sanitize title attribute in format_subject_html

Replace control characters with question mark '?' (like in
chop_and_esc_str).

A little background: some web browsers turn on strict (and
unforgiving) XML validating mode for XHTML documents served using
application/xhtml+xml content type.  This means among others that
control characters are forbidden to appear in gitweb output.

CGI.pm does by default slight escaping (using simple_escape subroutine
from CGI::Util) of all _attribute_ values (depending on the value of
autoEscape, by default on).  This escaping, at least in CGI.pm version
3.10 (most current version at CPAN is 3.43), is minimal: only '"',
'&', '<' and '>' are escaped using named HTML entity references
(&quot;, &amp;, &lt; and &gt; respectively).  But simple_escape does
not do escaping of control characters such as ^X which are invalid in
XHTML (in strict mode).

If by some accident commit message do contain some control character
in first 50 characters (more or less) of first line of commit message,
and this line is longer than 50 characters (so gitweb shortens it for
display), then gitweb would put this control character in title
attribute (and CGI.pm would not remove them).  The tag _contents_ is
safe because it is escaped using esc_html() explicitly, and it
replaces control characters by their printable representation.

While at it: chop_and_escape_str doesn't need capturing group.

Noticed-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoTerminate argv with NULL before calling setup_revisions()
Nguyễn Thái Ngọc Duy [Thu, 21 May 2009 09:32:44 +0000 (19:32 +1000)]
Terminate argv with NULL before calling setup_revisions()

It is convention that argv should be terminated with NULL, even if
argc is used to specify the size of argv. setup_revisions() requires
this and may segfault otherwise.

This patch makes sure that all argv (that I can find) is NULL terminated.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agodoc/git-rebase.txt: remove mention of multiple strategies
Nguyễn Thái Ngọc Duy [Thu, 21 May 2009 09:47:07 +0000 (19:47 +1000)]
doc/git-rebase.txt: remove mention of multiple strategies

git-rebase.sh does not seem to support this.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge git://git.bogomips.org/git-svn
Junio C Hamano [Thu, 21 May 2009 14:28:07 +0000 (07:28 -0700)]
Merge git://git.bogomips.org/git-svn

* git://git.bogomips.org/git-svn:
  git-svn: add --authors-prog option
  git-svn: Set svn.authorsfile if it is passed to git svn clone
  git-svn: Correctly report max revision when following deleted paths
  git-svn: Fix for svn paths removed > log-window-size revisions ago
  git-svn testsuite: use standard configuration for Subversion tools

15 years agogit-send-email: Handle quotes when parsing .mailrc files
Eric W. Biederman [Thu, 21 May 2009 02:45:53 +0000 (19:45 -0700)]
git-send-email: Handle quotes when parsing .mailrc files

It is legal and not uncommon to use quotes in a .mailrc file so
you can include a persons fullname as well as their email alias.
Handle this by using quotewords instead of split when parsing
.mailrc files.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit-svn: add --authors-prog option
Mark Lodato [Fri, 15 May 2009 01:27:15 +0000 (21:27 -0400)]
git-svn: add --authors-prog option

Add a new option, --authors-prog, to git-svn that allows a more flexible
alternative (or supplement) to --authors-file.  This allows more
advanced username operations than the authors file will allow.  For
example, one may look up Subversion users via LDAP, or may generate the
name and email address from the Subversion username.

Notes:

* If both --authors-name and --authors-prog are given, the former is
  tried first, falling back to the later.

* The program is called once per unique SVN username, and the result is
  cached.

* The command-line argument must be the path to a program, not a generic
  shell command line.  The absolute path to this program is taken at
  startup since the git-svn script changes directory during operation.

* The option is not enabled for `git svn log'.

[ew: fixed case where neither --authors-(name|prog) were defined]
Signed-off-by: Mark Lodato <lodatom@gmail.com>
Acked-by: Eric Wong <normalperson@yhbt.net>
15 years agogit-svn: Set svn.authorsfile if it is passed to git svn clone
Alex Vandiver [Wed, 6 May 2009 20:19:45 +0000 (16:19 -0400)]
git-svn: Set svn.authorsfile if it is passed to git svn clone

Signed-off-by: Alex Vandiver <alexmv@mit.edu>
Acked-by: Eric Wong <normalperson@yhbt.net>
15 years agogit-svn: Correctly report max revision when following deleted paths
Alex Vandiver [Wed, 6 May 2009 20:18:53 +0000 (16:18 -0400)]
git-svn: Correctly report max revision when following deleted paths

Report the maximum found revision in the range, instead of the minimum
changed revision.

Signed-off-by: Alex Vandiver <alexmv@mit.edu>
Acked-by: Eric Wong <normalperson@yhbt.net>
15 years agogit-svn: Fix for svn paths removed > log-window-size revisions ago
Alex Vandiver [Wed, 6 May 2009 20:18:52 +0000 (16:18 -0400)]
git-svn: Fix for svn paths removed > log-window-size revisions ago

Instead of trying to find the end of the commit history only in the
last window, track if we have seen commits yet, and use that to judge
if we need to backtrack and look for a tail.  Otherwise, conversion
can silently lose up to 100 revisions of a branch if it was deleted
>100 revisions ago.

Signed-off-by: Alex Vandiver <alexmv@mit.edu>
Acked-by: Eric Wong <normalperson@yhbt.net>
15 years agogit-svn testsuite: use standard configuration for Subversion tools
Eygene Ryabinkin [Fri, 8 May 2009 08:06:16 +0000 (12:06 +0400)]
git-svn testsuite: use standard configuration for Subversion tools

I have tweaked configuration in my ~/.subversion directory, namely I am
running auto-properties and automatically adding '$Id$' expansion to
every file.  This choke the last test named 'proplist' from
t9101-git-svn-props.sh, because one more property, svn:keywords is
automatically added.

I had just wrapped svn invocation with the svn_cmd that specifies empty
directory via --config-dir argument.  Since the latter is the global
option, it should be recognized by all svn subcommands, so no
regressions will be introduced.

Now svn_cmd is used everywhere, not just in the failed test module: this
should guard us from the future clashes with user-defined configuration
tweaks.

Signed-off-by: Eygene Ryabinkin <rea-git@codelabs.ru>
Acked-by: Eric Wong <normalperson@yhbt.net>
15 years agoMerge branch 'maint'
Junio C Hamano [Thu, 21 May 2009 01:59:09 +0000 (18:59 -0700)]
Merge branch 'maint'

* maint:
  grep: fix word-regexp colouring
  completion: use git rev-parse to detect bare repos
  Cope better with a _lot_ of packs
  for-each-ref: fix segfault in copy_email

15 years agogrep: fix word-regexp colouring
René Scharfe [Wed, 20 May 2009 21:31:53 +0000 (23:31 +0200)]
grep: fix word-regexp colouring

As noticed by Dmitry Gryazin: When a pattern is found but it doesn't
start and end at word boundaries, bol is forwarded to after the match and
the pattern is searched again.  When a pattern is finally found between
word boundaries, the match offsets are off by the number of characters
that have been skipped.

This patch corrects the offsets to be relative to the value of bol as
passed to match_one_pattern() by its caller.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agocompletion: use git rev-parse to detect bare repos
Giuseppe Bilotta [Mon, 18 May 2009 16:24:30 +0000 (18:24 +0200)]
completion: use git rev-parse to detect bare repos

Its check is more robust than a config check for core.bare

Trivially-Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoCope better with a _lot_ of packs
Johannes Schindelin [Fri, 15 May 2009 18:52:47 +0000 (20:52 +0200)]
Cope better with a _lot_ of packs

You might end up with a situation where you have tons of pack files, e.g.
when using hg2git.  In this situation, all kinds of operations may
end up with a "too many files open" error.  Let's recover gracefully from
that.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Looks-right-to-me-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogrep: make callback functions static
René Scharfe [Wed, 20 May 2009 22:05:22 +0000 (00:05 +0200)]
grep: make callback functions static

Suggested by Stephen Boyd: make the callback functions used for option
parsing static.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agofor-each-ref: fix segfault in copy_email
Jeff King [Mon, 18 May 2009 17:58:11 +0000 (13:58 -0400)]
for-each-ref: fix segfault in copy_email

You can trigger a segfault in git.git by doing:

  git for-each-ref --format='%(taggeremail)' refs/tags/v0.99

The v0.99 tag is special in that it contains no "tagger"
header.

The bug is obvious in copy_email, which carefully checks to
make sure the result of a strchr is non-NULL, but only after
already having used it to perform other work. The fix is to
move the check up.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoExtend sample pre-commit hook to check for non ascii filenames
Heiko Voigt [Tue, 19 May 2009 20:01:54 +0000 (22:01 +0200)]
Extend sample pre-commit hook to check for non ascii filenames

At the moment non-ascii encodings of filenames are not portably
converted between different filesystems by git. This will most likely
change in the future but to allow repositories to be portable among
different file/operating systems this check is enabled by default.

Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoUnify signedness in hashing calls
Dan McGee [Tue, 19 May 2009 04:34:02 +0000 (23:34 -0500)]
Unify signedness in hashing calls

Our hash_obj and hashtable_index calls and functions were doing a lot of
funny things with signedness. Unify all of it to 'unsigned int'.

Signed-off-by: Dan McGee <dpmcgee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'np/push-delta'
Junio C Hamano [Mon, 18 May 2009 16:01:16 +0000 (09:01 -0700)]
Merge branch 'np/push-delta'

* np/push-delta:
  allow OFS_DELTA objects during a push

15 years agoMerge branch 'ar/merge-one-file-diag'
Junio C Hamano [Mon, 18 May 2009 16:01:11 +0000 (09:01 -0700)]
Merge branch 'ar/merge-one-file-diag'

* ar/merge-one-file-diag:
  Clarify kind of conflict in merge-one-file helper

15 years agoMerge branch 'ar/unlink-err'
Junio C Hamano [Mon, 18 May 2009 16:01:06 +0000 (09:01 -0700)]
Merge branch 'ar/unlink-err'

* ar/unlink-err:
  print unlink(2) errno in copy_or_link_directory
  replace direct calls to unlink(2) with unlink_or_warn
  Introduce an unlink(2) wrapper which gives warning if unlink failed

15 years agoMerge branch 'jk/maint-add-empty'
Junio C Hamano [Mon, 18 May 2009 16:01:01 +0000 (09:01 -0700)]
Merge branch 'jk/maint-add-empty'

* jk/maint-add-empty:
  add: don't complain when adding empty project root

15 years agoMerge branch 'js/add-edit'
Junio C Hamano [Mon, 18 May 2009 16:00:06 +0000 (09:00 -0700)]
Merge branch 'js/add-edit'

* js/add-edit:
  t3702: fix reliance on SHELL_PATH being '/bin/sh'
  git-add: introduce --edit (to edit the diff vs. the index)

15 years agoMerge branch 'mh/diff-stat-color'
Junio C Hamano [Mon, 18 May 2009 15:59:54 +0000 (08:59 -0700)]
Merge branch 'mh/diff-stat-color'

* mh/diff-stat-color:
  diff: do not color --stat output like patch context

15 years agoMerge branch 'mh/show-branch-color'
Junio C Hamano [Mon, 18 May 2009 15:59:48 +0000 (08:59 -0700)]
Merge branch 'mh/show-branch-color'

* mh/show-branch-color:
  bash completion: show-branch color support
  show-branch: color the commit status signs

Conflicts:
contrib/completion/git-completion.bash

15 years agoMerge branch 'ac/graph-horizontal-line'
Junio C Hamano [Mon, 18 May 2009 15:59:30 +0000 (08:59 -0700)]
Merge branch 'ac/graph-horizontal-line'

* ac/graph-horizontal-line:
  graph API: Use horizontal lines for more compact graphs

15 years agoMerge branch 'ae/anon-fetch-info'
Junio C Hamano [Mon, 18 May 2009 15:59:27 +0000 (08:59 -0700)]
Merge branch 'ae/anon-fetch-info'

* ae/anon-fetch-info:
  fetch: Strip usernames from url's before storing them

15 years agoMerge branch 'maint'
Junio C Hamano [Mon, 18 May 2009 15:59:20 +0000 (08:59 -0700)]
Merge branch 'maint'

* maint:
  show-branch: Fix die message in parse_reflog_param()

15 years agoshow-branch: Fix die message in parse_reflog_param()
Stephen Boyd [Sun, 17 May 2009 10:47:02 +0000 (03:47 -0700)]
show-branch: Fix die message in parse_reflog_param()

Commit 76a44c5 (show-branch --reflog: show the reflog message at the
top, 2007-01-19) introduced parse_reflog_param(). The die() call was
incorrectly passed arg + 9, when it should have been passed arg.

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'maint'
Junio C Hamano [Sun, 17 May 2009 06:08:49 +0000 (23:08 -0700)]
Merge branch 'maint'

* maint:
  completion: add missing options to show-branch and show
  dir.c: clean up handling of 'path' parameter in read_directory_recursive()
  Fix type-punning issues

15 years agocompletion: add missing options to show-branch and show
Stephen Boyd [Sun, 17 May 2009 03:42:43 +0000 (20:42 -0700)]
completion: add missing options to show-branch and show

Add --oneline and --abbrev-commit to show and --sparse to show-branch.

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agodir.c: clean up handling of 'path' parameter in read_directory_recursive()
Linus Torvalds [Thu, 14 May 2009 20:05:03 +0000 (13:05 -0700)]
dir.c: clean up handling of 'path' parameter in read_directory_recursive()

Right now we pass two different pathnames ('path' and 'base') down to
read_directory_recursive(), and the only real reason for that is that we
want to allow an empty 'base' parameter, but when we do so, we need the
pathname to "opendir()" to be "." rather than the empty string.

And rather than handle that confusion in the caller, we can just fix
read_directory_recursive() to handle the case of an empty path itself,
by just passing opendir() a "." ourselves if the path is empty.

This would allow us to then drop one of the pathnames entirely from the
calling convention, but rather than do that, we'll start separating them
out as a "filesystem pathname" (the one we use for filesystem accesses)
and a "git internal base name" (which is the name that we use for git
internally).

That will eventually allow us to do things like handle different
encodings (eg the filesystem pathnames might be Latin1, while git itself
would use UTF-8 for filename information).

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoFix type-punning issues
Dan McGee [Tue, 12 May 2009 01:17:38 +0000 (20:17 -0500)]
Fix type-punning issues

In these two places we are casting part of our unsigned char sha1 array into
an unsigned int, which violates GCCs strict-aliasing rules (and probably
other compilers).

Signed-off-by: Dan McGee <dpmcgee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'maint'
Junio C Hamano [Sun, 17 May 2009 02:49:42 +0000 (19:49 -0700)]
Merge branch 'maint'

* maint:
  test: checkout shouldn't say that HEAD has moved if it didn't
  completion: enhance "current branch" display
  completion: simplify "current branch" in __git_ps1()
  completion: fix PS1 display during a merge on detached HEAD
  builtin-checkout: Don't tell user that HEAD has moved before it has
  pre-commit.sample: don't print incidental SHA1
  tests: Add tests for missing format-patch long options
  api-parse-options.txt: use 'func' instead of 'funct'
  Turn on USE_ST_TIMESPEC for OpenBSD
  ls-tree manpage: output of ls-tree is compatible with update-index
  ls-tree manpage: use "unless" instead of "when ... is not"

15 years agotest: checkout shouldn't say that HEAD has moved if it didn't
Nanako Shiraishi [Sun, 17 May 2009 02:43:08 +0000 (11:43 +0900)]
test: checkout shouldn't say that HEAD has moved if it didn't

Signed-off-by: しらいしななこ <nanako3@lavabit.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agocompletion: enhance "current branch" display
Junio C Hamano [Sun, 10 May 2009 08:56:21 +0000 (01:56 -0700)]
completion: enhance "current branch" display

Introduce GIT_PS1_DESCRIBE option you can set to "contains", "branch", or
"describe" to tweak the way how a detached HEAD is described.

The default behaviour is to describe only exact match with some tag
(otherwise use the first 7 hexdigits) as before.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agocompletion: simplify "current branch" in __git_ps1()
Junio C Hamano [Sun, 10 May 2009 08:53:19 +0000 (01:53 -0700)]
completion: simplify "current branch" in __git_ps1()

As I very often work on a detached HEAD, I found it pretty confusing
when __git_ps1() said 'some-name'.  Did I create a branch with that name
by mistake, or do I happen to be on a commit with that exact tag?

This patch fixes the issue by enclosing non branch names in a pair of
parentheses when used to substitute %s token in __git_ps1() argument.

It also fixes a small bug where the branch part is left empty when
.git/HEAD is unreadable for whatever reason.  The output now says
"(unknown)".

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agocompletion: fix PS1 display during a merge on detached HEAD
Junio C Hamano [Sat, 16 May 2009 18:46:22 +0000 (11:46 -0700)]
completion: fix PS1 display during a merge on detached HEAD

If your merge stops in a conflict while on a detached HEAD, recent
completion code fails to show anything.  This was because various cases
added to support the operation-in-progress markers (e.g. REBASE, MERGING)
forgot that they need to set the variable "b" to something for the result
they computed to be displayed at all.

Probably not many people make trial merges on a detached HEAD (which is
tremendously useful feature of git, by the way), and that may be why this
was not noticed for a long time.

Acked-By: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoImprove the naming of guessed target repository for git clone
Alex Riesen [Wed, 13 May 2009 16:32:06 +0000 (18:32 +0200)]
Improve the naming of guessed target repository for git clone

Strip leading and trailing spaces off guessed target directory, and
replace sequences of whitespace and 'control' characters with one
space character.

User still can have any name by specifying it explicitely after url.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoUse UTF-8 instead of utf8 for backward compatibility
Alex Riesen [Thu, 14 May 2009 12:55:54 +0000 (14:55 +0200)]
Use UTF-8 instead of utf8 for backward compatibility

An old iconv (GNU libiconv 1.11) does not know about utf8, it does know
UTF-8 though, which is also understood by all newer iconv implementations.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agobuiltin-checkout: Don't tell user that HEAD has moved before it has
Daniel Cordero [Sat, 16 May 2009 17:54:45 +0000 (10:54 -0700)]
builtin-checkout: Don't tell user that HEAD has moved before it has

Previously, checkout would tell the user this message before moving HEAD,
without regard to whether the upcoming move will result in success.
If the move failed, this causes confusion.

Show the message after the move, unless the move failed.

Signed-off-by: Daniel Cordero <theappleman@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agopre-commit.sample: don't print incidental SHA1
Jim Meyering [Sat, 16 May 2009 10:21:50 +0000 (12:21 +0200)]
pre-commit.sample: don't print incidental SHA1

Make the sample pre-commit hook script discard
all git-rev-parse output, not just stderr.
Otherwise, it would print an SHA1.

Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agotests: Add tests for missing format-patch long options
Stephen Boyd [Sat, 16 May 2009 09:24:45 +0000 (02:24 -0700)]
tests: Add tests for missing format-patch long options

Exercise format-patch's --signoff, --in-reply-to and --start-number long
options.

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoapi-parse-options.txt: use 'func' instead of 'funct'
Stephen Boyd [Sat, 16 May 2009 09:24:44 +0000 (02:24 -0700)]
api-parse-options.txt: use 'func' instead of 'funct'

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoTurn on USE_ST_TIMESPEC for OpenBSD
Tony Kemp [Thu, 14 May 2009 06:47:41 +0000 (16:47 +1000)]
Turn on USE_ST_TIMESPEC for OpenBSD

Like Darwin, OpenBSD's stat struct uses st_ctimespec and st_mtimestruct
rather than st_ctim and st_mtim.

Signed-off-by: Tony Kemp <tony.kemp@newcastle.edu.au>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'maint-1.6.2' into maint
Junio C Hamano [Sat, 16 May 2009 07:12:58 +0000 (00:12 -0700)]
Merge branch 'maint-1.6.2' into maint

* maint-1.6.2:
  ls-tree manpage: output of ls-tree is compatible with update-index
  ls-tree manpage: use "unless" instead of "when ... is not"

15 years agoMerge branch 'maint-1.6.1' into maint-1.6.2
Junio C Hamano [Thu, 14 May 2009 04:06:11 +0000 (21:06 -0700)]
Merge branch 'maint-1.6.1' into maint-1.6.2

* maint-1.6.1:
  ls-tree manpage: output of ls-tree is compatible with update-index
  ls-tree manpage: use "unless" instead of "when ... is not"

15 years agoMerge branch 'maint-1.6.0' into maint-1.6.1
Junio C Hamano [Thu, 14 May 2009 04:05:59 +0000 (21:05 -0700)]
Merge branch 'maint-1.6.0' into maint-1.6.1

* maint-1.6.0:
  ls-tree manpage: output of ls-tree is compatible with update-index
  ls-tree manpage: use "unless" instead of "when ... is not"

15 years agoQuote LF in urls git fetch saves in FETCH_HEAD
Alex Riesen [Wed, 13 May 2009 18:08:53 +0000 (20:08 +0200)]
Quote LF in urls git fetch saves in FETCH_HEAD

The fmt-merge-msg does a strong syntax checking of its input and fails
with if it is incorrect. The LF character is the only character
important for fmt-merge-msg. As the url in FETCH_HEAD plays only
informational role, a quoted representation of the url should be good
and true enough.
The url often comes from either user-editable config or command line,
so it is reasonable to expect all kinds of characters in it, including
the characters which the format of FETCH_HEAD considers special (line
separator in this case).

Noticed and reported by Hugo Mildenberger.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoDocumentation: clarify / requirement in 'git check-ref-format'
Michael J Gruber [Wed, 13 May 2009 15:43:06 +0000 (17:43 +0200)]
Documentation: clarify / requirement in 'git check-ref-format'

'git check-ref-format' checks for the presence of at least one '/', the
idea being that there should be no refs directly below 'refs/', so there
should be a category like 'heads/' or 'tags/' in a refname.

Try and make this clearer in the man page.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agobash completion: complete variable names for "git config" with options
Stephen Boyd [Sat, 9 May 2009 01:23:32 +0000 (18:23 -0700)]
bash completion: complete variable names for "git config" with options

This makes it easier for users to get and unset their configuration
variables without having to open documentation or dig through their
configuration file.

__git_config_get_set_variables() retrieves the set configuration
variables from the appropriate configuration file. For example, if
the user has previously specified --global only the global variables
are returned. The same applies for --system, and --file. If no
location has been specified, all set variables are returned.

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'maint'
Junio C Hamano [Wed, 13 May 2009 05:51:09 +0000 (22:51 -0700)]
Merge branch 'maint'

* maint:
  GIT 1.6.3.1
  Revert "checkout branch: prime cache-tree fully"

15 years agoGIT 1.6.3.1 v1.6.3.1
Junio C Hamano [Wed, 13 May 2009 05:28:22 +0000 (22:28 -0700)]
GIT 1.6.3.1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'maint-1.6.2' into maint
Junio C Hamano [Tue, 12 May 2009 16:58:34 +0000 (09:58 -0700)]
Merge branch 'maint-1.6.2' into maint

* maint-1.6.2:
  Revert "checkout branch: prime cache-tree fully"

15 years agoMerge branch 'jc/maint-read-tree-multi' into maint-1.6.2
Junio C Hamano [Tue, 12 May 2009 16:58:21 +0000 (09:58 -0700)]
Merge branch 'jc/maint-read-tree-multi' into maint-1.6.2

* jc/maint-read-tree-multi:
  Revert "checkout branch: prime cache-tree fully"

15 years agoRevert "checkout branch: prime cache-tree fully"
Junio C Hamano [Tue, 12 May 2009 16:41:28 +0000 (09:41 -0700)]
Revert "checkout branch: prime cache-tree fully"

The logic in 83ae209 (checkout branch: prime cache-tree fully,
2009-04-20) is bogus; checkout can switch branches with a dirty
index and in such a case the tree won't match HEAD.

Add t2014-switch to catch this breakage.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agot3900: ISO-2022-JP has more than one popular variants
Junio C Hamano [Tue, 12 May 2009 09:01:51 +0000 (02:01 -0700)]
t3900: ISO-2022-JP has more than one popular variants

When converting from other encodings (e.g. EUC-JP or UTF-8), there are
subtly different variants of ISO-2022-JP, all of which are valid.  At the
end of line or when a run of string switches to 1-byte sequence, ESC ( B
can be used to switch to ASCII or ESC ( J can be used to switch to ISO
646:JP (JIS X 0201) but they essentially are the same character set and
are used interchangeably.  Similarly the set ESC $ @ switches to (JIS X
0208-1978) and ESC $ B switches to (JIS X 0208-1983) are in practice used
interchangeably.

Depending on the iconv library and the locale definition on the system, a
program that converts from another encoding to ISO-2022-JP can produce
different byte sequence, and GIT_TEST_CMP (aka "diff -u") will report the
difference as a failure.

Fix this by converting the expected and the actual output to UTF-8 before
comparing when the end result is ISO-2022-JP.  The test vector string in
t3900/ISO-2022-JP.txt is expressed with ASCII and JIS X 0208-1983, but it
can be expressed with any other possible variant, and when converted back
to UTF-8, these variants produce identical byte sequences.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 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 <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 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 <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 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

15 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 <gitster@pobox.com>
15 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 <mst@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 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 <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 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 <flichtenheld@astaro.com>
Acked-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 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 <flichtenheld@astaro.com>
Acked-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 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 <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 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 <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 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 <aspotashev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 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 <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 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 <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 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 <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 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 <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 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 <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 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 <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 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 <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 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 <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 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 <gitster@pobox.com>
15 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 <gitster@pobox.com>
15 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 <gitster@pobox.com>
15 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:

15 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

15 years agoGIT 1.6.3 v1.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 <gitster@pobox.com>
15 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 <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 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 <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 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 <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 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 <gitster@pobox.com>
15 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 <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 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 <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 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 <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 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 <gitster@pobox.com>
15 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

15 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

15 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

15 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 <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 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 <drafnel@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>