Commit graph

22740 commits

Author SHA1 Message Date
Junio C Hamano c9a9766328 Merge branch 'jc/read-tree-cache-tree-fix'
* jc/read-tree-cache-tree-fix:
  Fix "read-tree -m A B" priming the cache-tree
2010-07-14 09:34:23 -07:00
Raja R Harinath c7d1d1b132 Use dev_t for device id (st_dev) from stat in setup_git_directory_gently()
The original declaration was int, which seems to cause trouble on my
machine.  It causes spurious "filesystem boundary" errors when running
the testsuite.  The cause seems to be

  $ stat -c%d .
  2147549952

which is too large for a 32-bit int type.

Using the correct type, dev_t, solves the issue.  (Because I'm
paranoid and forgetful, I checked -- yes, Unix v7 had dev_t.)

Other uses of st_dev seem to be reasonably safe.   fill_stat_cache_info
truncates it to an 'unsigned int', but that value seems to be used only
to validate the cache, and only if USE_STDEV is defined.

Signed-off-by: Raja R Harinath <harinath@hurrynot.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-14 07:57:08 -07:00
Junio C Hamano c008c0ff20 diff A...B: give one possible diff when there are more than one merge-base
We instead showed a combined diff that explains one of the randomly
chosen merge-base as if it were the result of merging all the other
merge bases and two tips given, which made no sense at all.

An alternative is to simply fail such a request, telling the user that
there are criss-cross merges, but it wouldn't be so helpful.

Noticed by James Pickens.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-13 13:53:20 -07:00
Junio C Hamano 449aeb10d5 Merge branch 'maint'
* maint:
  git fetch documentation: describe short '-p' synonym to '--prune' option
  format-patch: document the format.to configuration setting
2010-07-13 09:14:35 -07:00
Oren Held 1b79d1c2a8 git fetch documentation: describe short '-p' synonym to '--prune' option
It's already implemented, just undocumented.

Signed-off-by: Oren Held <orenhe@il.ibm.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-13 09:13:34 -07:00
Miklos Vajna 312a30eb5d format-patch: document the format.to configuration setting
[jc: with simplification from Jonathan Nieder]

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-13 09:02:59 -07:00
Jens Lehmann 108da0db12 git add: Add the "--ignore-missing" option for the dry run
Sometimes it is useful to know if a file or directory will be ignored
before it is added to the work tree. An example is "git submodule add",
where it would be really nice to be able to fail with an appropriate
error message before the submodule is cloned and checked out.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-12 15:13:54 -07:00
Michael J Gruber 637ab29b86 test-lib: TAP compliance for skipping tests on request
Make the output TAP compliant for tests skipped on request (GIT_SKIP_TESTS).

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Acked-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-12 07:53:08 -07:00
Michael J Gruber 47e67d479b test-lib: simplify GIT_SKIP_TESTS loop
04ece59 (GIT_SKIP_TESTS: allow users to omit tests that are known to break, 2006-12-28)
introduced GIT_SKIP_TESTS, and since then we have had two nested loops
iterating over GIT_SKIP_TESTS with the same loop variable.

Reduce this to one loop.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-12 07:52:52 -07:00
Junio C Hamano 609eb9f7ff Merge branch 'maint'
* maint:
  Documentation: Spelling fix in protocol-capabilities.txt
  checkout: accord documentation to what git does
  t0005: work around strange $? in ksh when program terminated by a signal
2010-07-11 23:47:29 -07:00
Jonathan Nieder bcefed419a t3000 (ls-files -o): modernize style
This script is part of the second batch of tests, from the same day
the test infrastructure was added to git.  Update it to use a more
modern style in the spirit of v1.6.4-rc0~45^2~2 (2009-05-22).
In particular:

 - Put setup code inside test assertions, to avoid unexpected
   breakages and avoid stray output without -v (as t/README
   recommends); and

 - Put the test title on the same line as the "test_expect_success",
   and end the line with a single-quote to begin the body of the test
   which is one multi-line string.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-11 23:14:17 -07:00
Heiko Voigt b963d11827 git-gui: fix usage of themed widgets variable
There was one forgotten global so NS was not visible to the method
which resulted in an error.

Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
2010-07-10 23:41:54 +01:00
Pat Thoyts 13a3d637b2 git-gui: Handle failure of core.worktree to identify the working directory.
Commit 21985a11 'git-gui: handle non-standard worktree locations' attempts
to use either GIT_WORK_TREE or core.worktree to set the _gitworktree
variable but these may not be set which leads to a failure to launch
gitk to review history. Use _gitdir to set the location for a standard
git layout where the parent of the .git directory is the working tree.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2010-07-10 23:40:59 +01:00
Fredrik Skolmli 5d1e34158a Documentation: Spelling fix in protocol-capabilities.txt
Signed-off-by: Fredrik Skolmli <fredrik@frsk.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-09 17:36:28 -07:00
Nicolas Sebrecht 5e5ffa091b merge-recursive: use "up-to-date" instead of "uptodate" in error message for consistency
Signed-off-by: Nicolas Sebrecht <nicolas.s.dev@gmx.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-09 16:28:46 -07:00
Nicolas Sebrecht 142183d096 checkout: accord documentation to what git does
Signed-off-by: Nicolas Sebrecht <nicolas.s.dev@gmx.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-09 16:28:21 -07:00
Johannes Sixt 0e418e568f t0005: work around strange $? in ksh when program terminated by a signal
ksh93 is known to report $? of programs that terminated by a signal as
256 + signal number instead of 128 + signal number like other POSIX
compliant shells (ksh's behavior is still POSIX compliant in this regard).

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-09 16:27:31 -07:00
Junio C Hamano 037c43c68e Merge remote branch 'ko/master' into jc/read-tree-cache-tree-fix
* ko/master: (2325 commits)
  Git 1.7.2-rc2
  backmerge a few more fixes to 1.7.1.X series
  fix git branch -m in presence of cross devices
  t/t0006: specify timezone as EST5 not EST to comply with POSIX
  add missing && to submodule-merge testcase
  t/README: document more test helpers
  test-date: fix sscanf type conversion
  xdiff: optimise for no whitespace difference when ignoring whitespace.
  gitweb: Move evaluate_gitweb_config out of run_request
  parse_date: fix signedness in timezone calculation
  t0006: test timezone parsing
  rerere.txt: Document forget subcommand
  t/README: proposed rewording...
  t/README: Document the do's and don'ts of tests
  t/README: Add a section about skipping tests
  t/README: Document test_expect_code
  t/README: Document test_external*
  t/README: Document the prereq functions, and 3-arg test_*
  t/README: Typo: paralell -> parallel
  t/README: The trash is in 't/trash directory.$name'
  ...

Conflicts:
	builtin-read-tree.c
2010-07-08 18:55:50 -07:00
Bo Yang e13f38a33e diff.c: fix a graph output bug
When --graph is in effect, the line-prefix typically has colored graph
line segments and ends with reset.  The color sequence "set" given to
this function is for showing the metainfo part of the patch text and
(1) it should not be applied to the graph lines, and (2) it will be
reset at the end of line_prefix so it won't be in effect anyway.

Signed-off-by: Bo Yang <struggleyb.nku@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-08 18:09:14 -07:00
Ævar Arnfjörð Bjarmason e8344e8666 tests: Use skip_all=* to skip tests
Change tests to skip with skip_all=* + test_done instead of using say
+ test_done.

This is a follow-up to "tests: Skip tests in a way that makes sense
under TAP" (fadb5156e4). I missed these cases when prepearing that
patch, hopefully this is all of them.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-08 17:53:12 -07:00
Junio C Hamano b1f47514f2 Fix "read-tree -m A B" priming the cache-tree
In 456156d a shortcut to priming the index tree reference was
introduced, but the justification for it was completely bogus.

"read-tree -m A B" is to take the index (and the working tree)
that is largely based on (but does not have to match exactly) A
and update it to B, while carrying the local change that does
not overlap the difference between A and B, so there is no reason
to expect that the resulting index should match the tree B.

Noticed and test provided by Heiko Voigt.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-08 17:27:43 -07:00
Eli Barzilay 4ded69169b Reorganize `git-log' man page to clarify common diff options.
This will reduce considerably the common confusion where people miss the
`--follow' option, and wonder why `-M'/`-C' is not working.

* Move the diff options include to after the log-specific flags, and add
  a "Common diff options" subtitle before them.  (These options apply
  only when patches are shown, which is not a common use case among
  newbies, so having them first is confusing.)

* Move the `--follow' description to the top of the listed options.  The
  options before that seem less important: `--full-diff' applies only
  when patches are shown, `--source' and `--decorate' are less useful
  with many common commit specifications.

* Clarify that `--follow' works only for a single path argument.

Signed-off-by: Eli Barzilay <eli@barzilay.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-08 17:00:09 -07:00
Jonathan Nieder 4ecb79386d t9118 (git-svn): prevent early failure from taking down later tests
When test #2 fails, the cwd is project/, causing all the
remaining tests in the same script to get confused and fail.

So in the spirit of v1.7.1.1~53^2~10 (t5550-http-fetch: Use subshell
for repository operations, 2010-04-17), use a subshell for svn
working copy operations.  This way, the cwd will reliably return
to the top of the trash directory and later tests can still be run
when a command has failed.

Reported-by: A Large Angry SCM <gitzilla@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Eric Wong <normalperson@yhbt.net>
2010-07-08 20:57:53 +00:00
Michael J Gruber 08fd28bb08 t9118: avoid PEG revision identifier in tests
@ is SVN's identifier for PEG revisions. But SVN's treatment of PEG
identifiers in copy target URLs changed in r954995/r952973, i.e. between
1.6.11 and 1.6.12. They get eaten now (which is considered the right
way).

Therefore, avoid the @ in the tests with funky branch names.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Acked-by: Eric Wong <normalperson@yhbt.net>
2010-07-08 20:35:42 +00:00
Nazri Ramliy e7b082a411 grep -O: Do not pass color sequences as filenames to pager
With a .gitconfig like this:

 [color]
	ui = auto
 [color "grep"]
	filename = magenta

if stdout is a terminal, the grep machinery will output the color
sequence \e[36m before each filename in its output.

In the case of "git grep -O foo", output is argv for the pager.
Disable color when calling the grep machinery in this case.

Signed-off-by: Nazri Ramliy <ayiehere@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-07 11:23:17 -07:00
Junio C Hamano 9918285fb1 Git 1.7.2-rc2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-07 11:19:42 -07:00
Junio C Hamano 2a16315031 Merge branch 'ab/tap'
* ab/tap:
  t/README: document more test helpers
  t/README: proposed rewording...
  t/README: Document the do's and don'ts of tests
  t/README: Add a section about skipping tests
  t/README: Document test_expect_code
  t/README: Document test_external*
  t/README: Document the prereq functions, and 3-arg test_*
  t/README: Typo: paralell -> parallel
  t/README: The trash is in 't/trash directory.$name'
  t/t9700/test.pl: don't access private object members, use public access methods
  t9700: Use Test::More->builder, not $Test::Builder::Test
  tests: Say "pass" rather than "ok" on empty lines for TAP
  tests: Skip tests in a way that makes sense under TAP
  test-lib: output a newline before "ok" under a TAP harness
  test-lib: Make the test_external_* functions TAP-aware
  test-lib: Adjust output to be valid TAP format
2010-07-07 11:18:44 -07:00
Junio C Hamano fcd91f8de2 Merge branch 'maint'
* maint:
  backmerge a few more fixes to 1.7.1.X series
  rev-parse: fix --parse-opt --keep-dashdash --stop-at-non-option
  fix git branch -m in presence of cross devices

Conflicts:
	RelNotes
	builtin/rev-parse.c
2010-07-07 11:18:26 -07:00
Junio C Hamano c30e742c49 backmerge a few more fixes to 1.7.1.X series
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-07 11:16:32 -07:00
Junio C Hamano 878bd809d7 Merge branch 'maint-1.6.4' into maint
* maint-1.6.4:
  rev-parse: fix --parse-opt --keep-dashdash --stop-at-non-option
2010-07-07 11:13:40 -07:00
Uwe Kleine-König 29981380d0 rev-parse: fix --parse-opt --keep-dashdash --stop-at-non-option
The ?: operator has a lower priority than |, so the implicit associativity
made the 6th argument of parse_options be PARSE_OPT_KEEP_DASHDASH if
keep_dashdash was true discarding PARSE_OPT_STOP_AT_NON_OPTION and
PARSE_OPT_SHELL_EVAL.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-07 11:11:50 -07:00
Junio C Hamano 8e99859266 Merge branch 'mg/doc-rev-parse-treepath-syntax' into maint
* mg/doc-rev-parse-treepath-syntax:
  git-rev-parse.txt: Add more examples for caret and colon
  git-rev-parse.txt: Document ":path" specifier
2010-07-07 10:34:04 -07:00
Junio C Hamano 56bfacef79 Merge branch 'tr/receive-pack-aliased-update-fix' into maint
* tr/receive-pack-aliased-update-fix:
  check_aliased_update: strcpy() instead of strcat() to copy
  receive-pack: detect aliased updates which can occur with symrefs
  receive-pack: switch global variable 'commands' to a parameter

Conflicts:
	t/t5516-fetch-push.sh
2010-07-07 10:25:15 -07:00
Pierre Habouzit 765c22588d fix git branch -m in presence of cross devices
When you have for example a bare repository stored on NFS, and that you
create new workdirs locally (using contrib's git-new-workdir), logs/refs
is a symlink to a different device. Hence when the reflogs are renamed,
all must happen below logs/refs or one gets cross device rename errors
like:

  git branch -m foo
  error: unable to move logfile logs/refs/heads/master to tmp-renamed-log: Invalid cross-device link
  fatal: Branch rename failed

The fix is hence to use logs/refs/.tmp-renamed-log as a temporary log
name, instead of just tmp-renamed-log.

Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-07 09:17:00 -07:00
Brandon Casey 0cc4da3036 t/t0006: specify timezone as EST5 not EST to comply with POSIX
POSIX requires that both the timezone "standard" and "offset" be specified
in the TZ environment variable.  This causes a problem on IRIX which does
not understand the timezone 'EST'.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-07 09:13:17 -07:00
Junio C Hamano d5f5d0a944 do not write out index when status does not have to
Some codepaths, such as "git status" and "git commit --dry-run",
tried to opportunisticly refresh the index and write the result
out.  But they did so without checking if there was actually any
change that needs to be written out.

Noticed by Jeff King and Daniel at Rutgers.edu

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-06 21:53:11 -07:00
Junio C Hamano 78db709ae5 Merge branch 'maint'
* maint:
  add missing && to submodule-merge testcase
  test-date: fix sscanf type conversion
2010-07-06 21:29:21 -07:00
Heiko Voigt 420432d434 add missing && to submodule-merge testcase
Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-06 21:28:55 -07:00
Jonathan Nieder c9667456d2 t/README: document more test helpers
There is no documentation in t/README for test_must_fail,
test_might_fail, test_cmp, or test_when_finished.

Reported-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-06 21:26:11 -07:00
Brandon Casey 49a43f5468 Makefile: work around ksh's failure to handle missing list argument to for loop
ksh does not like it when the list argument is missing in a 'for' loop.
This can happen when NO_CURL is set which causes REMOTE_CURL_ALIASES to be
unset.  In this case, the 'for' loop in the Makefile is expanded to look
like this:

   for p in ; do

and ksh complains like this:

   /bin/ksh: syntax error at line 15 : `;' unexpected

The existing attempt to work around this issue, introduced by 70b89f87,
tried to protect the 'for' loop by first testing whether REMOTE_CURL_ALIASES
was empty, but this does not work since, as Johannes Sixt explains, "Before
the test for emptyness can happen, the complete statement must be parsed,
but ksh finds a syntax error in the statement and, therefore, cannot even
begin to execute the statement. (ksh doesn't follow POSIX in this regard,
where this would not be a syntax error.)".

Make's $(foreach) function could be used to avoid this shell glitch, but
since it has already caused a problem once before by generating a command
line that exceeded the maximum argument list length on IRIX, let's adopt
Bruce Stephens's suggestion for working around this issue in the same way
the OpenSSL folks have done it.  This solution first assigns the contents
of the REMOTE_CURL_ALIASES make variable to a shell variable and then
supplies the shell variable as the list argument in the 'for' loop.  This
satisfies ksh and has the expected behavior even if $(REMOTE_CURL_ALIASES)
is empty.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-06 21:18:21 -07:00
Jeff King d66ee046fc test-date: fix sscanf type conversion
Reading into a time_t isn't portable, since we don't know
the exact type. Instead, use an unsigned long, which is what
show_date wants, anyway.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-06 08:42:15 -07:00
Junio C Hamano 5b5275f6e9 Merge branch 'maint'
* maint:
  xdiff: optimise for no whitespace difference when ignoring whitespace.
2010-07-05 23:33:07 -07:00
Dylan Reid b4cf0f1784 xdiff: optimise for no whitespace difference when ignoring whitespace.
In xdl_recmatch, do the memcmp to check if the two lines are equal before
checking if whitespace flags are set.  If the lines are identical, then
there is no need to check if they differ only in whitespace.
This makes the common case (there is no whitespace difference) faster.
It costs the case where lines are the same length and contain
whitespace differences, but the common case is more than 20% faster.

Signed-off-by: Dylan Reid <dgreid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-05 23:27:41 -07:00
Junio C Hamano 57f2b6b258 rebase-i: do not get fooled by a log message ending with backslash
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-05 23:23:37 -07:00
Junio C Hamano 41f556b947 rebase-i: style fix
Case arms should align with "case" and "esac".

Do not cat a file into a pipeline; just make the downstream command
read from the file.

Having a while statement as a downstream of a pipe is fine, but
the loop should begin on its own line.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-05 23:22:52 -07:00
Michael J Gruber f028cdae66 Documentation: link to gitrevisions rather than git-rev-parse
Currently, whenever we need documentation for revisions and ranges, we
link to the git-rev-parse man page, i.e. a plumbing man page, which has
this along with the documentation of all rev-parse modes.

Link to the new gitrevisions man page instead in all cases except
- when the actual git-rev-parse command is referred to or
- in very technical context (git-send-pack).

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-05 13:39:13 -07:00
Michael J Gruber 1ed6f2c5b9 Documentation: gitrevisions
Create a new man page gitrevisions(7) which contains the revsions and
ranges documentation but not more. This uses (per include) the same bits
as the pertaining section of git-rev-parse(1).

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-05 13:39:02 -07:00
Michael J Gruber 5a8f311789 Documentation: split off rev doc into include file
Currently, the documentation for revisions and ranges sits in the
git-rev-parse man page, i.e. a plumbing man page, along with the
documentation of all rev-parse modes.

Split off the revisions and ranges section into an included file to
prepare for restructuring.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-05 13:38:10 -07:00
Jakub Narebski 869d58813b gitweb: Move evaluate_gitweb_config out of run_request
Move evaluate_gitweb_config() and evaluate_git_version() out of
run_request() to run(), making them not run one for each request.
This changes how git behaves in FastCGI case.

This change makes it impossible to have config which changes with
request, but I don't think anyone relied on such (hidden action)
behavior.

While at it, reset timer and number of git commands at beginning of
run_request() in new reset_timer() subroutine.  This fixes case when
gitweb was run using FastCGI interface: time is reported for request,
and not for single run of gitweb script.  This changes slightly
behavior in non-FastCGI case: the number of git commands reported is
1 less (running `git --version` one per gitweb is not counted now).

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-05 13:28:20 -07:00
Jeff King 9ba0f0334d parse_date: fix signedness in timezone calculation
When no timezone is specified, we deduce the offset by
subtracting the result of mktime from our calculated
timestamp.

However, our timestamp is stored as an unsigned integer,
meaning we perform the subtraction as unsigned. For a
negative offset, this means we wrap to a very high number,
and our numeric timezone is in the millions of hours. You
can see this bug by doing:

   $ TZ=EST \
     GIT_AUTHOR_DATE='2010-06-01 10:00' \
     git commit -a -m foo
   $ git cat-file -p HEAD | grep author
   author Jeff King <peff@peff.net> 1275404416 +119304128

Instead, we should perform this subtraction as a time_t, the
same type that mktime returns.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-05 11:57:07 -07:00