Commit graph

18649 commits

Author SHA1 Message Date
Eygene Ryabinkin da083d688e 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>
2009-05-21 00:31:07 -07:00
Junio C Hamano 065b0702f7 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
2009-05-20 18:59:09 -07:00
René Scharfe e701fadb9e 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>
2009-05-20 18:49:20 -07:00
Giuseppe Bilotta 8dfb17e1fd 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>
2009-05-20 18:35:23 -07:00
Johannes Schindelin fd73ccf279 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>
2009-05-20 18:23:06 -07:00
Jeff King e64c1b0053 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>
2009-05-20 00:06:19 -07:00
Heiko Voigt d00e364de9 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>
2009-05-20 00:04:37 -07:00
Dan McGee 91fe2f9091 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>
2009-05-20 00:02:24 -07:00
Junio C Hamano 99ddd24ad7 Merge branch 'np/push-delta'
* np/push-delta:
  allow OFS_DELTA objects during a push
2009-05-18 09:01:16 -07:00
Junio C Hamano d430262fac Merge branch 'ar/merge-one-file-diag'
* ar/merge-one-file-diag:
  Clarify kind of conflict in merge-one-file helper
2009-05-18 09:01:11 -07:00
Junio C Hamano 36587681b4 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
2009-05-18 09:01:06 -07:00
Junio C Hamano f2a56171ac Merge branch 'jk/maint-add-empty'
* jk/maint-add-empty:
  add: don't complain when adding empty project root
2009-05-18 09:01:01 -07:00
Junio C Hamano 362724af6c 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)
2009-05-18 09:00:06 -07:00
Junio C Hamano c16cea7345 Merge branch 'mh/diff-stat-color'
* mh/diff-stat-color:
  diff: do not color --stat output like patch context
2009-05-18 08:59:54 -07:00
Junio C Hamano 96825a8054 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
2009-05-18 08:59:48 -07:00
Junio C Hamano 7f1eaec7f4 Merge branch 'ac/graph-horizontal-line'
* ac/graph-horizontal-line:
  graph API: Use horizontal lines for more compact graphs
2009-05-18 08:59:30 -07:00
Junio C Hamano 983e9b63ae Merge branch 'ae/anon-fetch-info'
* ae/anon-fetch-info:
  fetch: Strip usernames from url's before storing them
2009-05-18 08:59:27 -07:00
Junio C Hamano 59e5fb356e Merge branch 'maint'
* maint:
  show-branch: Fix die message in parse_reflog_param()
2009-05-18 08:59:20 -07:00
Stephen Boyd 5acb3e5012 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>
2009-05-17 12:05:22 -07:00
Junio C Hamano 55524fcf9d 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
2009-05-16 23:08:49 -07:00
Stephen Boyd 076c32370d 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>
2009-05-16 22:46:22 -07:00
Linus Torvalds da4b3e8c28 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>
2009-05-16 22:41:46 -07:00
Dan McGee b867d324ce 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>
2009-05-16 22:41:18 -07:00
Junio C Hamano 671d1bc6a0 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"
2009-05-16 19:49:42 -07:00
Nanako Shiraishi e4b09dad9f 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>
2009-05-16 19:49:25 -07:00
Junio C Hamano dd42c2f015 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>
2009-05-16 19:46:31 -07:00
Junio C Hamano ff790b6a4b 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>
2009-05-16 19:46:31 -07:00
Junio C Hamano 8763dbb1b2 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>
2009-05-16 19:46:31 -07:00
Alex Riesen 8a94bc7bdc 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>
2009-05-16 19:43:29 -07:00
Alex Riesen 39d404d137 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>
2009-05-16 19:43:29 -07:00
Daniel Cordero 77ebd56dc3 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>
2009-05-16 12:51:58 -07:00
Jim Meyering c646217e13 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>
2009-05-16 11:57:17 -07:00
Stephen Boyd f044fe2de6 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>
2009-05-16 11:47:19 -07:00
Stephen Boyd ca156cfcc2 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>
2009-05-16 11:47:10 -07:00
Tony Kemp 90f2e6526b 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>
2009-05-16 10:23:26 -07:00
Junio C Hamano 13c5833c09 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"
2009-05-16 00:12:58 -07:00
Junio C Hamano 213195185c 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"
2009-05-13 21:06:11 -07:00
Junio C Hamano 58066bec5a 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"
2009-05-13 21:05:59 -07:00
Alex Riesen 95405ba6cf 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>
2009-05-13 13:13:30 -07:00
Michael J Gruber 1a28725954 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>
2009-05-13 13:12:22 -07:00
Stephen Boyd 00652369ff 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>
2009-05-13 12:59:06 -07:00
Junio C Hamano 4bf1f68ee7 Merge branch 'maint'
* maint:
  GIT 1.6.3.1
  Revert "checkout branch: prime cache-tree fully"
2009-05-12 22:51:28 -07:00
Junio C Hamano 4774780ab1 GIT 1.6.3.1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-05-12 22:30:29 -07:00
Junio C Hamano 235236c83d Merge branch 'maint-1.6.2' into maint
* maint-1.6.2:
  Revert "checkout branch: prime cache-tree fully"
2009-05-12 09:58:34 -07:00
Junio C Hamano a83502f8e5 Merge branch 'jc/maint-read-tree-multi' into maint-1.6.2
* jc/maint-read-tree-multi:
  Revert "checkout branch: prime cache-tree fully"
2009-05-12 09:58:21 -07:00
Junio C Hamano 49d833dc07 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>
2009-05-12 09:57:21 -07:00
Junio C Hamano eb127887fa 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>
2009-05-12 02:01:51 -07:00
Alex Riesen c98a95eea8 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>
2009-05-10 09:32:30 -07:00
Alex Riesen 713697b34f 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>
2009-05-10 09:32:29 -07:00
Junio C Hamano 6345d7a0d1 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
2009-05-09 09:27:43 -07:00