1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-11-01 23:07:55 +01:00
Commit graph

24522 commits

Author SHA1 Message Date
Jeff King
3b21a438c9 rebase: use explicit "--" with checkout
In the case of a ref/pathname conflict, checkout will
already do the right thing and checkout the ref. However,
for a non-existant ref, this has two advantages:

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

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

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

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

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

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-26 17:26:58 -08:00
Junio C Hamano
630fc7878b Git 1.7.4-rc3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-24 11:00:00 -08:00
Junio C Hamano
342953a686 Merge branch 'as/userdiff-pascal'
* as/userdiff-pascal:
  userdiff: match Pascal class methods
2011-01-24 10:54:12 -08:00
Junio C Hamano
0efbb7d9f4 Merge branch 'jn/setup-fixes'
* jn/setup-fixes:
  t1510: fix typo in the comment of a test
  Documentation updates for 'GIT_WORK_TREE without GIT_DIR' historical usecase
  Subject: setup: officially support --work-tree without --git-dir
  tests: compress the setup tests
  tests: cosmetic improvements to the repo-setup test
  t/README: hint about using $(pwd) rather than $PWD in tests
  Fix expected values of setup tests on Windows
2011-01-24 10:53:09 -08:00
Jonathan Nieder
6abbee8c60 t1510: fix typo in the comment of a test
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-24 10:14:57 -08:00
Junio C Hamano
ea472c1e35 Documentation updates for 'GIT_WORK_TREE without GIT_DIR' historical usecase
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-24 10:13:59 -08:00
Jonathan Nieder
4868b2ea17 Subject: setup: officially support --work-tree without --git-dir
The original intention of --work-tree was to allow people to work in a
subdirectory of their working tree that does not have an embedded .git
directory.  Because their working tree, which their $cwd was in, did not
have an embedded .git, they needed to use $GIT_DIR to specify where it is,
and because this meant there was no way to discover where the root level
of the working tree was, so we needed to add $GIT_WORK_TREE to tell git
where it was.

However, this facility has long been (mis)used by people's scripts to
start git from a working tree _with_ an embedded .git directory, let git
find .git directory, and then pretend as if an unrelated directory were
the associated working tree of the .git directory found by the discovery
process.  It happens to work in simple cases, and is not worth causing
"regression" to these scripts.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-21 14:31:24 -08:00
Jonathan Nieder
8c0db6fd51 Documentation: do not treat reset --keep as a special case
The current treatment of "git reset --keep" emphasizes how it
differs from --hard (treatment of local changes) and how it breaks
down into plumbing (git read-tree -m -u HEAD <commit> followed by git
update-ref HEAD <commit>).  This can discourage people from using
it, since it might seem to be a complex or niche option.

Better to emphasize what the --keep flag is intended for --- moving
the index and worktree from one commit to another, like "git checkout"
would --- so the reader can make a more informed decision about the
appropriate situations in which to use it.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-21 12:41:14 -08:00
Björn Steinbrink
25f3af3f9d Correctly report corrupted objects
The errno check added in commit 3ba7a06 "A loose object is not corrupt
if it cannot be read due to EMFILE" only checked for whether errno is
not ENOENT and thus incorrectly treated "no error" as an error
condition.

Because of that, it never reached the code path that would report that
the object is corrupted and instead caused funny errors like:

  fatal: failed to read object 333c4768ce595793fdab1ef3a036413e2a883853: Success

So we have to extend the check to cover the case in which the object
file was successfully read, but its contents are corrupted.

Reported-by: Will Palmer <wmpalmer@gmail.com>
Signed-off-by: Björn Steinbrink <B.Steinbrink@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-20 13:18:51 -08:00
Jonathan Nieder
786dabecd4 tests: compress the setup tests
New test helpers:

 - setup_repo, to initialize a repository or gitfile pointing to a
   repository, with core.bare and core.worktree set as specified;

 - try_case, to run setup from a given directory and validate the
   result, with GIT_DIR and GIT_WORK_TREE set as specified;

 - try_repo, to initialize a repository and call "try_case" from the
   toplevel and a subdirectory;

 - run_wt_tests, to run a battery of tests that check for sane
   behavior when GIT_WORK_TREE is set to various positions relative to
   the .git dir and cwd.

Use these helpers to make the test shorter, less repetitive, and (one
hopes) easier to understand and modify.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-19 10:27:16 -08:00
Jonathan Nieder
91c031df67 tests: cosmetic improvements to the repo-setup test
Give an overview in "sh t1510-repo-setup.sh --help" output.
Waste some vertical and horizontal space for clearer code.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-19 10:27:16 -08:00
Junio C Hamano
b20e9b0b52 Merge branch 'maint'
* maint:
  exec_cmd: remove unused extern
2011-01-19 08:33:54 -08:00
Erik Faye-Lund
b312b4123b exec_cmd: remove unused extern
This definition was added by commit 77cb17e9, but it's left unused since
commit 511707d. Remove the left-over definition.

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-19 08:27:22 -08:00
Junio C Hamano
14154ce3ca Merge branch 'jn/gitweb-no-logo' into maint
* jn/gitweb-no-logo:
  gitweb: make logo optional
2011-01-19 08:26:47 -08:00
Junio C Hamano
ae830c211b Merge branch 'jk/diff-driver-binary-doc' into maint
* jk/diff-driver-binary-doc:
  docs: explain diff.*.binary option
2011-01-19 08:26:44 -08:00
Junio C Hamano
8a59702ad8 Merge branch 'tr/submodule-relative-scp-url' into maint
* tr/submodule-relative-scp-url:
  submodule: fix relative url parsing for scp-style origin
2011-01-19 08:26:41 -08:00
Junio C Hamano
ea9590789f Merge branch 'rj/maint-difftool-cygwin-workaround' into maint
* rj/maint-difftool-cygwin-workaround:
  difftool: Fix failure on Cygwin
2011-01-19 08:26:24 -08:00
Junio C Hamano
f8d0215c81 Merge branch 'rj/maint-test-fixes' into maint
* rj/maint-test-fixes:
  t9501-*.sh: Fix a test failure on Cygwin
  lib-git-svn.sh: Add check for mis-configured web server variables
  lib-git-svn.sh: Avoid setting web server variables unnecessarily
  t9142: Move call to start_httpd into the setup test
  t3600-rm.sh: Don't pass a non-existent prereq to test #15
2011-01-19 08:26:17 -08:00
Junio C Hamano
305579f78d Merge branch 'jn/maint-gitweb-pathinfo-fix' into maint
* jn/maint-gitweb-pathinfo-fix:
  gitweb: Fix handling of whitespace in generated links
2011-01-19 08:26:04 -08:00
Junio C Hamano
3a1882c1fe Merge branch 'ak/describe-exact' into maint
* ak/describe-exact:
  describe: Delay looking up commits until searching for an inexact match
  describe: Store commit_names in a hash table by commit SHA1
  describe: Do not use a flex array in struct commit_name
  describe: Use for_each_rawref
2011-01-19 08:25:52 -08:00
Junio C Hamano
267684f0b7 Merge branch 'jn/maint-fast-import-object-reuse' into maint
* jn/maint-fast-import-object-reuse:
  fast-import: insert new object entries at start of hash bucket
2011-01-19 08:25:46 -08:00
Junio C Hamano
f326a06497 Merge branch 'jn/submodule-b-current' into maint
* jn/submodule-b-current:
  git submodule: Remove now obsolete tests before cloning a repo
  git submodule -b ... of current HEAD fails
2011-01-19 08:25:41 -08:00
Junio C Hamano
d84f280937 Merge branch 'jc/maint-svn-info-test-fix' into maint
* jc/maint-svn-info-test-fix:
  t9119: do not compare "Text Last Updated" line from "svn info"
2011-01-19 08:25:38 -08:00
Junio C Hamano
0bc6180bcb Merge branch 'nd/maint-relative' into maint
* nd/maint-relative:
  get_cwd_relative(): do not misinterpret root path
2011-01-19 08:25:31 -08:00
Jonathan Nieder
e5959106d6 Documentation/fast-import: put explanation of M 040000 <dataref> "" in context
Omit needless words ("Additionally ... <path> may also" is redundant).
While at it, place the explanation of this special case after the
general rules for paths to provide the reader with some context.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-18 16:51:13 -08:00
Ramsay Jones
5ee5f5a65d svndump.c: Fix a printf format compiler warning
In particular, on systems that define uint32_t as an unsigned long,
gcc complains as follows:

        CC vcs-svn/svndump.o
    vcs-svn/svndump.c: In function `svndump_read':
    vcs-svn/svndump.c:215: warning: int format, uint32_t arg (arg 2)

In order to suppress the warning we use the C99 format specifier
macro PRIu32 from <inttypes.h>.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Acked-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-18 16:48:47 -08:00
Jonathan Nieder
60a2e3320f remote-ext: do not segfault for blank lines
Instead of stripping space characters past the beginning of the
line and overflowing a buffer, stop at the beginning of the line
(mimicking the corresponding fix in remote-fd).

The argument to isspace does not need to be cast explicitly because
git isspace takes care of that already.

Noticed-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-18 10:18:25 -08:00
Jonathan Nieder
898243b82d Documentation/fast-import: capitalize beginning of sentence
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-18 10:15:59 -08:00
Jonathan Nieder
4fb40c2b82 ll-merge: simplify opts == NULL case
As long as sizeof(struct ll_merge_options) is small, there is not
much reason not to keep a copy of the default merge options in the BSS
section.  In return, we get clearer code and one less stack frame in
the opts == NULL case.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-15 20:34:14 -08:00
Junio C Hamano
adf872e783 Git 1.7.4-rc2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-13 12:14:18 -08:00
Junio C Hamano
477039c53c Merge branch 'jn/gitweb-no-logo'
* jn/gitweb-no-logo:
  gitweb: make logo optional
2011-01-13 11:39:18 -08:00
Junio C Hamano
17e1c9e2fd Merge branch 'jn/perl-funcname'
* jn/perl-funcname:
  userdiff/perl: catch BEGIN/END/... and POD as headers
  diff: funcname and word patterns for perl
2011-01-13 11:38:05 -08:00
Junio C Hamano
17fd68d0d8 Merge branch 'sr/gitweb-hilite-more'
* sr/gitweb-hilite-more:
  gitweb: remove unnecessary test when closing file descriptor
  gitweb: add extensions to highlight feature map
2011-01-13 11:36:12 -08:00
Junio C Hamano
857ba709df Merge branch 'rj/svn-test'
* rj/svn-test:
  lib-git-svn.sh: Move web-server handling code into separate function
2011-01-13 11:36:05 -08:00
Junio C Hamano
7810c6b6d6 Merge branch 'rj/test-fixes'
* rj/test-fixes:
  t4135-*.sh: Skip the "backslash" tests on cygwin
  t3032-*.sh: Do not strip CR from line-endings while grepping on MinGW
  t3032-*.sh: Pass the -b (--binary) option to sed on cygwin
  t6038-*.sh: Pass the -b (--binary) option to sed on cygwin

Conflicts:
	t/t3032-merge-recursive-options.sh
2011-01-13 11:35:28 -08:00
Junio C Hamano
37ee62bc6b Merge branch 'jk/diff-driver-binary-doc'
* jk/diff-driver-binary-doc:
  docs: explain diff.*.binary option
2011-01-13 11:34:56 -08:00
Junio C Hamano
4b297df9b2 Merge branch 'jn/t9010-work-around-broken-svnadmin'
* jn/t9010-work-around-broken-svnadmin:
  t9010: svnadmin can fail even if available
2011-01-13 11:34:52 -08:00
Junio C Hamano
4f93fc745a Merge branch 'tr/submodule-relative-scp-url'
* tr/submodule-relative-scp-url:
  submodule: fix relative url parsing for scp-style origin
2011-01-13 11:34:39 -08:00
Michael J Gruber
3e70e37e72 RelNotes/1.7.4: minor fixes
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-13 11:32:39 -08:00
Thomas Rast
9cf3f14766 t0000: quote TAP snippets in test code
t0000 contains two snippets of actual test output.  This causes
problems when passing -v to the test[*]: the test infrastructure
echoes the tests before running them, and the TAP parser then sees
this test output and concludes that two tests failed and that the TAP
output was badly formatted.

Guard against this by quoting the output in the source.

[*] either by running 'make smoke' with GIT_TEST_OPTS=-v, or with
prove ./t0000-basic.sh :: -v

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-13 11:32:31 -08:00
Junio C Hamano
d2f15e29a6 Merge branch 'maint'
* maint:
  commit: suggest --amend --reset-author to fix commiter identity
2011-01-12 21:26:51 -08:00
Matthieu Moy
3f14246899 commit: suggest --amend --reset-author to fix commiter identity
Since the message advises to fix the configuration first, the
advantage of using this command is that it is cut-and-paste ready,
while using --author='...' requires the user to type his name and
email again.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-12 12:43:58 -08:00
Junio C Hamano
0cb6ad3c3d checkout: fix bug with ambiguous refs
The usual dwim_ref lookup prefers tags to branches. Because
checkout primarily works on branches, though, we switch that
behavior to prefer branches.

However, there was a bug in the implementation in which we
used lookup_commit_reference (which used the regular lookup
rules) to get the actual commit to checkout. Checking out an
ambiguous ref therefore ended up putting us in an extremely
broken state in which we wrote the branch ref into HEAD, but
actually checked out the tree for the tag.

This patch fixes the bug by always attempting to pull the
commit to be checked out from the branch-ified version of
the name we were given.

Patch by Junio, tests and commit message from Jeff King.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-11 13:14:56 -08:00
Ramsay Jones
7fad99e14a t9157-*.sh: Make the svn version check more precise
These tests require an svn version 1.5 or newer to run correctly.
In particular, all 1.4.x versions and earlier are too old, so fix
up the case label regex to cover this range exactly.

[Fix provided by Anders Kaseorg <andersk@MIT.EDU>]

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-11 13:01:43 -08:00
Alexey Shumkin
ad5b6942d5 userdiff: match Pascal class methods
Class declarations were already covered by the second pattern, but class
methods have the 'class' keyword in front too. Account for it.

Signed-off-by: Alexey Shumkin <zapped@mail.ru>
Acked-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-11 11:03:48 -08:00
Johannes Sixt
95b104c830 t/README: hint about using $(pwd) rather than $PWD in tests
This adds just a "do it this way" instruction without a lot of explanation,
because the details are too complex to be explained at this point.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-11 10:51:25 -08:00
Johannes Sixt
e6ec2b6a23 Fix expected values of setup tests on Windows
On Windows, bash stores absolute path names in shell variables in POSIX
format that begins with a slash, rather than in drive-letter format; such
a value is converted to the latter format when it is passed to a non-MSYS
program such as git.

When an expected test value is constructed, it must contain the value that
will be produced by git, which will be in the drive-letter format. But
TRASH_DIRECTORY is in POSIX format. Fix this by using $(pwd), which
produces drive-letter format since 4114156a (Tests on Windows: $(pwd) must
return Windows-style paths).

The change in t1510 is a straight seach-and-replace, except for the first
hunk of the diff.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-11 10:49:38 -08:00
Junio C Hamano
a6fd3d4925 Merge branch 'maint'
* maint:
  Documentation/githooks: post-rewrite-copy-notes never existed
  Documentation/git-archive: spell --worktree-attributes correctly
2011-01-10 10:39:38 -08:00
Junio C Hamano
54f4cd9e8c Merge branch 'maint-1.7.2' into maint
* maint-1.7.2:
  Documentation/githooks: post-rewrite-copy-notes never existed
  Documentation/git-archive: spell --worktree-attributes correctly
2011-01-10 10:39:28 -08:00
Junio C Hamano
7a876edf5d Merge branch 'maint-1.7.1' into maint-1.7.2
* maint-1.7.1:
  Documentation/githooks: post-rewrite-copy-notes never existed
  Documentation/git-archive: spell --worktree-attributes correctly
2011-01-10 10:39:18 -08:00