1
0
mirror of https://github.com/git/git.git synced 2024-10-19 15:18:24 +02:00
Commit Graph

2297 Commits

Author SHA1 Message Date
Eric Wong
dbc6c74d08 git-svn: handle empty files marked as symlinks in SVN
Broken SVN clients generate empty files with the svn:special set
to '*'.  This attempts to denote a symlink pointing to a file
with an empty path (""), which cannot be generated on a POSIX
system.

Thus, we mimic the behavior of svn(1) and create a zero-byte
file in our tree.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
2009-01-18 15:38:27 -08:00
Brandon Casey
a83c88525e t7700: demonstrate misbehavior of 'repack -a' when local packs exist
The ability to "...fatten [the] local repository by packing everything that
is needed by the local ref into a single new pack, including things that are
borrowed from alternates"[1] is supposed to be provided by the '-a' or '-A'
options to repack when '-l' is not used, but there is a flaw.  For each
pack in the local repository without a .keep file, repack supplies a
--unpacked=<pack> argument to pack-objects.

The --unpacked option to pack-objects, with or without an argument, causes
pack-objects to ignore any object which is packed in a pack not mentioned
in an argument to --unpacked=.  So, if there are local packs, and
'repack -a' is called, then any objects which reside in packs accessible
through alternates will _not_ be packed.  If there are no local packs, then
no --unpacked argument will be supplied, and repack will behave as expected.

[1] http://mid.gmane.org/7v8wrwidi3.fsf@gitster.siamese.dyndns.org

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-17 23:44:33 -08:00
Keith Cascio
7a38329130 test more combinations of ignore-whitespace options to diff
There are three flags involved (-w -b and --ignore-space-at-eol) which
makes 8 combinations possible in total, but only 3 cases are tested (none,
-w alone and -b alone).

This adds the other 5 cases.

Signed-off-by: Keith Cascio <keith@cs.ucla.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-17 23:43:31 -08:00
Junio C Hamano
8f31355692 Merge branch 'mv/apply-parse-opt'
* mv/apply-parse-opt:
  Resurrect "git apply --flags -" to read from the standard input
  parse-opt: migrate builtin-apply.
2009-01-17 23:06:53 -08:00
Junio C Hamano
90abc19b5a Merge branch 'tr/rebase-root'
* tr/rebase-root:
  rebase: update documentation for --root
  rebase -i: learn to rebase root commit
  rebase: learn to rebase root commit
  rebase -i: execute hook only after argument checking
2009-01-17 23:06:38 -08:00
Junio C Hamano
6af384ce73 Merge branch 'ap/clone-into-empty'
* ap/clone-into-empty:
  Allow cloning to an existing empty directory
  add is_dot_or_dotdot inline function
2009-01-17 23:05:54 -08:00
Junio C Hamano
33256e6b1b Merge branch 'tr/maint-no-index-fixes'
* tr/maint-no-index-fixes:
  diff --no-index -q: fix endless loop
  diff --no-index: test for pager after option parsing
  diff: accept -- when using --no-index
2009-01-17 23:05:38 -08:00
Junio C Hamano
58f37f3c07 Merge branch 'maint'
* maint:
  Update draft release notes for 1.6.1.1
  builtin-fsck: fix off by one head count
  t5540: clarify that http-push does not handle packed-refs on the remote
  http-push: when making directories, have a trailing slash in the path name
  http-push: fix off-by-path_len
  Documentation: let asciidoc align related options
  githooks.txt: add missing word
  builtin-commit.c: do not remove COMMIT_EDITMSG
2009-01-17 23:04:40 -08:00
Johannes Schindelin
8ee09acd8f t5540: clarify that http-push does not handle packed-refs on the remote
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-17 18:20:00 -08:00
Johannes Schindelin
466ddf90c2 http-push: when making directories, have a trailing slash in the path name
The function lock_remote() sends MKCOL requests to make leading
directories; However, if it does not put a forward slash '/' at the end of
the path, the server sends a 301 redirect.

By leaving the '/' in place, we can avoid this additional step.

Incidentally, at least one version of Curl (7.16.3) does not resend
credentials when it follows a 301 redirect, so this commit also fixes
a bug.

Original patch by Tay Ray Chuan <rctay89@gmail.com>.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-17 18:19:46 -08:00
Junio C Hamano
7bbd8d6c13 Merge branch 'maint'
* maint:
  t3404: Add test case for auto-amending only edited commits after "edit"
  t3404: Add test case for aborted --continue after "edit"
  t3501: check that commits are actually done
2009-01-15 18:52:35 -08:00
Junio C Hamano
ebb7bbf769 Merge branch 'maint-1.6.0' into maint
* maint-1.6.0:
  t3404: Add test case for auto-amending only edited commits after "edit"
  t3404: Add test case for aborted --continue after "edit"
  t3501: check that commits are actually done
2009-01-15 14:33:54 -08:00
Stephan Beyer
f8aa1b6902 t3404: Add test case for auto-amending only edited commits after "edit"
Add a test case for the bugfix introduced by commit c14c3c82d
"git-rebase--interactive: auto amend only edited commit".

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-15 14:22:53 -08:00
Stephan Beyer
dc7f55cbe9 t3404: Add test case for aborted --continue after "edit"
Add a test case for the bugfix introduced by commit 8beb1f33d
"git-rebase-interactive: do not squash commits on abort".

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-15 14:22:42 -08:00
Stephan Beyer
944019c8b3 t3501: check that commits are actually done
The basic idea of t3501 is to check whether revert
and cherry-pick works on renamed files.
But as there is no pure cherry-pick/revert test, it is
good to also check if commits are actually done in that
scenario.

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-15 14:22:12 -08:00
Junio C Hamano
b32acd21d8 Merge branch 'maint'
* maint:
  Update draft release notes to 1.6.1.1
  Make t3411 executable
  fix handling of multiple untracked files for git mv -k
  add test cases for "git mv -k"
2009-01-14 22:58:46 -08:00
Junio C Hamano
914186a5c3 Merge branch 'maint-1.6.0' into maint
* maint-1.6.0:
  fix handling of multiple untracked files for git mv -k
  add test cases for "git mv -k"
2009-01-14 22:34:05 -08:00
Miklos Vajna
8dca683346 Make t3411 executable
Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-14 17:00:00 -08:00
Michael J Gruber
be17262d13 fix handling of multiple untracked files for git mv -k
The "-k" option to "git mv" should allow specifying multiple untracked
files. Currently, multiple untracked files raise an assertion if they
appear consecutively as arguments. Fix this by decrementing the loop
index after removing one entry from the array of arguments.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-14 09:34:22 -08:00
Michael J Gruber
3772923f14 add test cases for "git mv -k"
Add test cases for ignoring nonexisting and untracked files using the -k
option to "git mv". There is one known breakage related to multiple
untracked files specfied as consecutive arguments.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-14 09:29:24 -08:00
Junio C Hamano
6a15416a89 Merge branch 'nd/grep-assume-unchanged'
* nd/grep-assume-unchanged:
  grep: grep cache entries if they are "assume unchanged"
  grep: support --no-ext-grep to test builtin grep
2009-01-13 23:10:02 -08:00
Junio C Hamano
9735a44440 Merge branch 'js/bundle-tags'
* js/bundle-tags:
  bundle: allow rev-list options to exclude annotated tags
2009-01-13 23:09:50 -08:00
Junio C Hamano
132d04b565 Merge branch 'js/add-not-submodule'
* js/add-not-submodule:
  git add: do not add files from a submodule
2009-01-13 23:09:47 -08:00
Junio C Hamano
f39adc250c Merge branch 'cb/maint-unpack-trees-absense'
* cb/maint-unpack-trees-absense:
  unpack-trees: remove redundant path search in verify_absent
  unpack-trees: fix path search bug in verify_absent
  unpack-trees: handle failure in verify_absent
2009-01-13 23:09:20 -08:00
Junio C Hamano
0f2d01d4fc Merge branch 'mc/cd-p-pwd'
* mc/cd-p-pwd:
  git-sh-setup: Fix scripts whose PWD is a symlink to a work-dir on OS X
2009-01-13 23:09:13 -08:00
Junio C Hamano
94468bc1f7 Merge branch 'js/maint-merge-recursive-r-d-conflict' into maint
* js/maint-merge-recursive-r-d-conflict:
  merge-recursive: mark rename/delete conflict as unmerged
2009-01-13 01:15:19 -08:00
Junio C Hamano
9e8f6e7f6e Merge branch 'cb/maint-merge-recursive-fix' into maint
* cb/maint-merge-recursive-fix:
  merge-recursive: do not clobber untracked working tree garbage
  modify/delete conflict resolution overwrites untracked file

Conflicts:
	builtin-merge-recursive.c
2009-01-13 01:13:56 -08:00
Junio C Hamano
ae5a97fdd0 Merge branch 'ap/maint-apply-modefix' into maint
* ap/maint-apply-modefix:
  builtin-apply: prevent non-explicit permission changes
2009-01-13 00:56:40 -08:00
Junio C Hamano
687004b512 Merge branch 'jc/maint-do-not-switch-to-non-commit' into maint
* jc/maint-do-not-switch-to-non-commit:
  git checkout: do not allow switching to a tree-ish that is not a commit
2009-01-11 23:24:42 -08:00
Thomas Rast
d911d1465d rebase -i: learn to rebase root commit
Teach git-rebase -i a new option --root, which instructs it to rebase
the entire history leading up to <branch>.  This is mainly for
symmetry with ordinary git-rebase; it cannot be used to edit the root
commit in-place (it requires --onto <newbase>).  Commits that already
exist in <newbase> are skipped.

In the normal mode of operation, this is fairly straightforward.  We
run cherry-pick in a loop, and cherry-pick has supported picking the
root commit since f95ebf7 (Allow cherry-picking root commits,
2008-07-04).

In --preserve-merges mode, we track the mapping from old to rewritten
commits and use it to update the parent list of each commit.  In this
case, we define 'rebase -i -p --root --onto $onto $branch' to rewrite
the parent list of all root commit(s) on $branch to contain $onto
instead.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-11 23:04:45 -08:00
Thomas Rast
190f53232d rebase: learn to rebase root commit
Teach git-rebase a new option --root, which instructs it to rebase the
entire history leading up to <branch>.  This option must be used with
--onto <newbase>, and causes commits that already exist in <newbase>
to be skipped.  (Normal operation skips commits that already exist in
<upstream> instead.)

One possible use-case is with git-svn: suppose you start hacking
(perhaps offline) on a new project, but later notice you want to
commit this work to SVN.  You will have to rebase the entire history,
including the root commit, on a (possibly empty) commit coming from
git-svn, to establish a history connection.  This previously had to
be done by cherry-picking the root commit manually.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-11 23:03:36 -08:00
Eric Wong
d727f676ad git-svn: add --authors-file test
I'm not sure how often this functionality is used, but in case
it's not, having an extra test here will help catch breakage
sooner.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-11 16:16:40 -08:00
Alexander Potashev
55892d2398 Allow cloning to an existing empty directory
The die() message updated accordingly.

The previous behaviour was to only allow cloning when the destination
directory doesn't exist.

[jc: added trivial tests]

Signed-off-by: Alexander Potashev <aspotashev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-11 13:26:29 -08:00
Adeodato Simó
7eb5bbdb64 t7501-commit.sh: explicitly check that -F prevents invoking the editor
The "--signoff" test case in t7500-commit.sh was setting VISUAL while
using -F -, which indeed tested that the editor is not spawned with -F.
However, having it there was confusing, since there was no obvious reason
to the casual reader for it to be there.

This commits removes the setting of VISUAL from the --signoff test, and
adds in t7501-commit.sh a dedicated test case, where the rest of tests for
-F are.

Signed-off-by: Adeodato Simó <dato@net.com.org.es>
Okay-then-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-10 17:45:02 -08:00
Pierre Habouzit
d3240d935c filter-branch: add git_commit_non_empty_tree and --prune-empty.
git_commit_non_empty_tree is added to the functions that can be run from
commit filters. Its effect is to commit only commits actually touching the
tree and that are not merge points either.

The option --prune-empty is added. It defaults the commit-filter to
'git_commit_non_empty_tree "$@"', and can be used with any other
combination of filters, except --commit-hook that must used
'git_commit_non_empty_tree "$@"' where one puts 'git commit-tree "$@"'
usually to achieve the same result.

Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-10 17:35:58 -08:00
Junio C Hamano
64912a67a4 Resurrect "git apply --flags -" to read from the standard input
The previous "parse-opt"ification broke git-apply reading from the
standard input.  "git apply A - C <B" is supposed to read patches from
files A, B and C in this order.

Before "parse-opt"ification, we used be able to:

	git apply --stat - --apply <A B

to read the patch from file A, showing only the diffstat, and then read the
patch from file B, showing the diffstat and actually applying it.  Even
with this fix we cannot do that anymore, but that is so crazy use case I
do not think anybody sane relied on such a broken behaviour.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-09 22:21:36 -08:00
Junio C Hamano
7bb5321be0 Merge branch 'rs/diff-ihc'
* rs/diff-ihc:
  diff: add option to show context between close hunks

Conflicts:
	Documentation/diff-options.txt
2009-01-07 00:10:14 -08:00
Junio C Hamano
ff32340669 Merge branch 'js/maint-merge-recursive-r-d-conflict'
* js/maint-merge-recursive-r-d-conflict:
  merge-recursive: mark rename/delete conflict as unmerged
2009-01-07 00:09:42 -08:00
Junio C Hamano
a19528c9fd Merge branch 'cb/merge-recursive-fix'
* cb/merge-recursive-fix:
  merge-recursive: do not clobber untracked working tree garbage
  modify/delete conflict resolution overwrites untracked file
2009-01-07 00:09:27 -08:00
Thomas Rast
e423ffd8a6 diff: accept -- when using --no-index
Accept -- as an "end of options" marker even when using --no-index.
Previously, the -- triggered a "normal" index/tree diff and subsequently
failed because of the unrecognized (in that mode) --no-index.

Note that the second loop can treat '--' as a normal option, because
the preceding checks ensure it is the third-to-last argument.

While at it, fix the parsing of "-q" option in --no-index mode as well.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-06 23:18:20 -08:00
Clemens Buchacher
837e5fe95d unpack-trees: fix path search bug in verify_absent
Commit 0cf73755 (unpack-trees.c: assume submodules are clean during
check-out) changed an argument to verify_absent from 'path' to 'ce',
which is however shadowed by a local variable of the same name.

The bug triggers if verify_absent is used on a tree entry, for which
the index contains one or more subsequent directories of the same
length. The affected subdirectories are removed from the index. The
testcase included in this commit bisects to 55218834 (checkout: do not
lose staged removal), which reveals the bug in this case, but is
otherwise unrelated.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-05 12:46:35 -08:00
Clemens Buchacher
6b9315d5a1 unpack-trees: handle failure in verify_absent
Commit 203a2fe1 (Allow callers of unpack_trees() to handle failure)
changed the "die on error" behavior to "return failure code".
verify_absent did not handle errors returned by
verify_clean_subdirectory, however.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-05 12:45:38 -08:00
Marcel M. Cary
dd6c1360b2 git-sh-setup: Fix scripts whose PWD is a symlink to a work-dir on OS X
On Mac OS X and possibly BSDs, /bin/pwd reads PWD from the environment if
available and shows the logical path by default rather than the physical
one.

Unset PWD before running /bin/pwd in both cd_to_toplevel and its test.

Still use the external /bin/pwd because in my Bash on Linux, the builtin
pwd prints the same result whether or not PWD is set.

Signed-off-by: Marcel M. Cary <marcel@oak.homeunix.org>
Tested-by: Wincent Colaiuta <win@wincent.com> (on Mac OS X 10.5.5)
Tested-by: Marcel Koeppen <git-dev@marzelpan.de> (on Mac OS X 10.5.6)
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-05 11:46:58 -08:00
Johannes Schindelin
2ce53f9b77 git add: do not add files from a submodule
It comes quite as a surprise to an unsuspecting Git user that calling
"git add submodule/file" (which is a mistake, alright) _removes_
the submodule in the index, and adds the file.  Instead, complain loudly.

While at it, be nice when the user said "git add submodule/" which is
most likely the consequence of tab-completion, and stage the submodule,
instead of trying to add the contents of that directory.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-05 10:48:32 -08:00
Johannes Schindelin
c9a42c4a12 bundle: allow rev-list options to exclude annotated tags
With options such as "--all --since=2.weeks.ago", annotated tags used to
be included, when they should have been excluded.  The reason is that we
heavily abuse the revision walker to determine what needs to be included
or excluded.  And the revision walker does not show tags at all (and
therefore never marks tags as uninteresting).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-05 10:47:07 -08:00
Junio C Hamano
8ea6ae99b2 Merge branch 'jc/maint-do-not-switch-to-non-commit'
* jc/maint-do-not-switch-to-non-commit:
  git checkout: do not allow switching to a tree-ish that is not a commit
2009-01-03 13:57:30 -08:00
Junio C Hamano
caf8b2fbd4 Merge branch 'ap/maint-apply-modefix'
* ap/maint-apply-modefix:
  builtin-apply: prevent non-explicit permission changes
2009-01-03 13:57:10 -08:00
Junio C Hamano
3442ea4a75 git checkout: do not allow switching to a tree-ish that is not a commit
"git checkout -b newbranch $commit^{tree}" mistakenly created a new branch
rooted at the current HEAD, because in that case, the two structure fields
used to see if the command was invoked without any argument (hence it
needs to default to checking out the HEAD) were populated incorrectly.

Upon seeing a command line argument that we took as a rev, we should store
that string in new.name, even if that does not name a commit.  This will
correctly trigger the existing safety logic.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Acked-by: Daniel Barkalow <barkalow@iabervon.org>
2009-01-03 13:34:19 -08:00
Junio C Hamano
1f7903a371 builtin-apply: prevent non-explicit permission changes
A git patch that does not change the executable bit records the mode bits
on its "index" line.  "git apply" used to interpret this mode exactly the
same way as it interprets the mode recorded on "new mode" line, as the
wish by the patch submitter to set the mode to the one recorded on the
line.

The reason the mode does not agree between the submitter and the receiver
in the first place is because there is _another_ commit that only appears
on one side but not the other since their histories diverged, and that
commit changes the mode.  The patch has "index" line but not "new mode"
line because its change is about updating the contents without affecting
the mode.  The application of such a patch is an explicit wish by the
submitter to only cherry-pick the commit that updates the contents without
cherry-picking the commit that modifies the mode.  Viewed this way, the
current behaviour is problematic, even though the command does warn when
the mode of the path being patched does not match this mode, and a careful
user could detect this inconsistencies between the patch submitter and the
patch receiver.

This changes the semantics of the mode recorded on the "index" line;
instead of interpreting it as the submitter's wish to set the mode to the
recorded value, it merely informs what the mode submitter happened to
have, and the presense of the "index" line is taken as submitter's wish to
keep whatever the mode is on the receiving end.

This is based on the patch originally done by Alexander Potashev with a
minor fix; the tests are mine.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-02 13:24:12 -08:00
Junio C Hamano
78d4096d57 Merge branch 'np/auto-thread'
* np/auto-thread:
  Force t5302 to use a single thread
  pack-objects: don't use too many threads with few objects
  autodetect number of CPUs by default when using threads
2008-12-29 01:21:33 -08:00