Commit graph

447 commits

Author SHA1 Message Date
Shawn Pearce 8371234eca Remove uncontested renamed files during merge.
Prior to 65ac6e9c3f we deleted a file
from the working directory during a merge if the file existed before
the merge started but was renamed by the branch being merged in.
This broke in 65ac6e as git-merge-recursive did not actually update
the working directory on an uncontested rename.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-13 09:13:21 -08:00
Junio C Hamano c93be3b539 add test case for recursive merge
This test case is based on the bug report by Shawn Pearce.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-12 17:07:05 -08:00
Johannes Schindelin c7c24889bb diff -b: ignore whitespace at end of line
This is _not_ the same as "treat eol as whitespace", since that would mean
that multiple empty lines would be treated as equal to e.g. a space.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-04 16:30:54 -08:00
Junio C Hamano ba988a83f0 Merge branch 'maint'
* maint:
  receive-pack: do not insist on fast-forward outside refs/heads/
  git-mv: search more precisely for source directory in index

Conflicts:

	receive-pack.c
2006-12-04 16:30:00 -08:00
Jim Meyering 7c0f7028ee Set permissions of each new file before "cvs add"ing it.
Otherwise, an executable script in git would end up being
checked into the CVS repository without the execute bit.

[jc: with an additional test script from Robin Rosenberg.]

Signed-off-by: Jim Meyering <jim@meyering.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-04 13:34:45 -08:00
Johannes Schindelin aca085e577 git-mv: search more precisely for source directory in index
A move of a directory should find the entries in the index by
searching for the name _including_ the slash. Otherwise, the
directory can be shadowed by a file when it matches the prefix
and is lexicographically smaller, e.g. "ab.c" shadows "ab/".

Noticed by Sergey Vlasov.

[jc: added Sergey's original reproduction recipe as a test case
 at the end of t7001.]

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-04 00:55:12 -08:00
Eric Wong e15161198a git-svn: update tests for recent changes
* Enable test for delta transfers in full-svn-test.

* Run tests against the root of the repository so we won't have
  to revisit 308906fa6e and
  efe4631def again.
  The graft-branches test still runs as before.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-27 22:23:06 -08:00
Junio C Hamano a22f542700 Merge branch 'jc/push-delete-ref'
* jc/push-delete-ref:
  Allow git push to delete remote ref.
2006-11-26 22:51:17 -08:00
Junio C Hamano 88ffc1f28a Merge branch 'jc/merge'
* branch 'jc/merge':
  git-merge: do not leak rev-parse output used for checking internally.
  git-merge: tighten error checking.
  merge: allow merging into a yet-to-be-born branch.
  git-merge: make it usable as the first class UI
  remove merge-recursive-old
2006-11-26 22:19:56 -08:00
Junio C Hamano d4f694ba89 Allow git push to delete remote ref.
This allows you to say

	git send-pack $URL :refs/heads/$branch

to delete the named remote branch.  The refspec $src:$dst means
replace the destination ref with the object known as $src on the
local side, so this is a natural extension to make an empty $src
mean "No object" to delete the target.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-24 03:59:05 -08:00
Peter Baumann 0f03ca9461 config option log.showroot to show the diff of root commits
This allows one to see a root commit as a diff in commands like git-log,
git-show and git-whatchanged.

Signed-off-by: Peter Baumann <Peter.B.Baumannn@stud.informatik.uni-erlangen.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-24 02:35:26 -08:00
Junio C Hamano 2bbaaed9ee trust-executable-bit: fix breakage for symlinks
An earlier commit f28b34a broke symlinks when trust-executable-bit
is not set because it incorrectly assumed that everything was a
regular file.

Reported by Juergen Ruehle.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-22 16:36:49 -08:00
Junio C Hamano 7cdbff14d4 remove merge-recursive-old
This frees the Porcelain-ish that comes with the core Python-free.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-21 20:55:39 -08:00
Junio C Hamano 6c96c0f194 git-fetch: follow lightweit tags as well.
This side-ports commit fd19f620 from Cogito, in which I fixed
exactly the same bug.  Somehow nobody noticed this for a long
time in git.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-19 18:44:23 -08:00
Linus Torvalds d09e79cb1c git-pull: allow pulling into an empty repository
We used to complain that we cannot merge anything we fetched
with a local branch that does not exist yet.  Just treat the
case as a natural extension of fast forwarding and make the
local branch'es tip point at the same commit we just fetched.
After all an empty repository without an initial commit is an
ancestor of any commit.

[jc: I added a trivial test.  We've become sloppy but we should
 stick to the discipline of covering new behaviour with new
 tests. ]

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-16 23:45:48 -08:00
Junio C Hamano 2a54323ce5 Merge branch 'maint'
* maint:
  Rework cvsexportcommit to handle binary files for all cases.
  Catch errors when writing an index that contains invalid objects.
  test-lib.sh: A command dying due to a signal is an unexpected failure.
  git-update-index(1): fix use of quoting in section title
2006-11-13 14:30:39 -08:00
Robin Rosenberg fe142b3a45 Rework cvsexportcommit to handle binary files for all cases.
Also adds test cases for adding removing and deleting
binary and text files plus two tests for the checks on
binary files.

Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-13 14:27:38 -08:00
Johannes Sixt 3d12d0cfbb Catch errors when writing an index that contains invalid objects.
If git-write-index is called without --missing-ok, it reports invalid
objects that it finds in the index. But without this patch it dies
right away or may run into an infinite loop.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-13 14:26:51 -08:00
Johannes Sixt 40cf043389 test-lib.sh: A command dying due to a signal is an unexpected failure.
When test_expect_failure detects that a command failed, it still has to
treat a program that crashed from a signal as unexpected failure.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-13 14:26:41 -08:00
Junio C Hamano 368c2ac249 Merge branch 'maint'
* maint:
  git-rebase: Use --ignore-if-in-upstream option when executing git-format-patch.
  git-svn: fix dcommit losing changes when out-of-date from svn
  git-svn: don't die on rebuild when --upgrade is specified
  git-svn: avoid printing filenames of files we're not tracking
2006-11-09 15:08:19 -08:00
Eric Wong 45bf473a7b git-svn: fix dcommit losing changes when out-of-date from svn
There was a bug in dcommit (and commit-diff) which caused deltas
to be generated against the latest version of the changed file
in a repository, and not the revision we are diffing (the tree)
against locally.

This bug can cause recent changes to the svn repository to be
silently clobbered by git-svn if our repository is out-of-date.

Thanks to Steven Grimm for noticing the bug.

The (few) people using the commit-diff command are now required
to use the -r/--revision argument.  dcommit usage is unchanged.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-09 09:34:46 -08:00
Junio C Hamano acca687fa9 git-pickaxe: retire pickaxe
Just make it take over blame's place.  Documentation and command
have all stopped mentioning "git-pickaxe".  The built-in synonym
is left in the command table, so you can still say "git pickaxe",
but it probably is a good idea to retire it as well.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-08 18:49:37 -08:00
Junio C Hamano 24ad8e0ce2 Merge branch 'jc/pickaxe' 2006-11-07 16:33:59 -08:00
Junio C Hamano d0a75a179e Merge branch 'jc/read-tree'
* jc/read-tree:
  t6022: ignoring untracked files by merge-recursive when they do not matter
  merge-recursive: adjust to loosened "working file clobbered" check
  merge-recursive: make a few functions static.
  merge-recursive: use abbreviated commit object name.
  merge: loosen overcautious "working file will be lost" check.
2006-11-07 15:41:34 -08:00
Junio C Hamano 58a1e0e83b Merge branch 'lj/refs'
* lj/refs: (63 commits)
  Fix show-ref usagestring
  t3200: git-branch testsuite update
  sha1_name.c: avoid compilation warnings.
  Make git-branch a builtin
  ref-log: fix D/F conflict coming from deleted refs.
  git-revert with conflicts to behave as git-merge with conflicts
  core.logallrefupdates thinko-fix
  git-pack-refs --all
  core.logallrefupdates create new log file only for branch heads.
  Remove bashism from t3210-pack-refs.sh
  ref-log: allow ref@{count} syntax.
  pack-refs: call fflush before fsync.
  pack-refs: use lockfile as everybody else does.
  git-fetch: do not look into $GIT_DIR/refs to see if a tag exists.
  lock_ref_sha1_basic does not remove empty directories on BSD
  Do not create tag leading directories since git update-ref does it.
  Check that a tag exists using show-ref instead of looking for the ref file.
  Use git-update-ref to delete a tag instead of rm()ing the ref file.
  Fix refs.c;:repack_without_ref() clean-up path
  Clean up "git-branch.sh" and add remove recursive dir test cases.
  ...
2006-11-01 08:48:50 -08:00
Junio C Hamano 5b329a5f5e t6022: ignoring untracked files by merge-recursive when they do not matter
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-27 17:16:40 -07:00
Junio C Hamano ed93b449c5 merge: loosen overcautious "working file will be lost" check.
The three-way merge complained unconditionally when a path that
does not exist in the index is involved in a merge when it
existed in the working tree.  If we are merging an old version
that had that path tracked, but the path is not tracked anymore,
and if we are merging that old version in, the result will be
that the path is not tracked.  In that case we should not
complain.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-27 17:16:39 -07:00
Junio C Hamano 36889a5078 tests: merge-recursive is usable without Python
Many tests still protected themselves with $no_python; there is no need
to do so anymore.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-27 14:29:55 -07:00
Junio C Hamano 7756b1f1dc Merge branch 'maint'
* maint:
  xdiff: Match GNU diff behaviour when deciding hunk comment worthiness of lines
  Update cherry documentation.
  Refer to git-rev-parse:Specifying Revisions from git.txt
  git-fetch.sh printed protocol fix
  RPM package re-classification.
  Documentation: note about contrib/.
  git-svn: fix symlink-to-file changes when using command-line svn 1.4.0
  Set $HOME for selftests
2006-10-25 12:57:48 -07:00
Gerrit Pape 2eb10ac7b5 Set $HOME for selftests
Set HOME environment variable to test trash directory and export for
selftests.  This fixes the git-svn selftests with nonexistent or not
readable home, as found in at least one automated build system:

 http://buildd.debian.org/fetch.cgi?&pkg=git-core&ver=1%3A1.4.2.3-2&arch=alpha&stamp=1161537466&file=log

Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-24 14:38:46 -07:00
Junio C Hamano 5d9e8ee78b t3200: git-branch testsuite update
The test expected "git branch --help" to exit successfully, but
built-ins spawn "man" when given --help, and when the test is
run, manpages may not be installed yet and "man" can legally
exit non-zero in such a case.

Also the new implementation logs "Created from master", instead
of "Created from HEAD" in the reflog, which makes a lot more
sense, so adjust the test to match that.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-23 22:48:45 -07:00
Junio C Hamano cee7f245dc git-pickaxe: blame rewritten.
Currently it does what git-blame does, but only faster.

More importantly, its internal structure is designed to support
content movement (aka cut-and-paste) more easily by allowing
more than one paths to be taken from the same commit.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-19 22:42:49 -07:00
Junio C Hamano e19343ad54 Merge branch 'maint'
* maint:
  git-apply: prepare for upcoming GNU diff -u format change.
2006-10-19 21:28:12 -07:00
Linus Torvalds b507b465f7 git-apply: prepare for upcoming GNU diff -u format change.
The latest GNU diff from CVS emits an empty line to express
an empty context line, instead of more traditional "single
white space followed by a newline".  Do not get broken by it.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-19 21:28:06 -07:00
Junio C Hamano 3b463c3f02 ref-log: fix D/F conflict coming from deleted refs.
After deleting a branch l/k, you should be able to create a
branch l.  Earlier we added remove_empty_directories() on the
ref creation side to remove leftover .git/refs/l directory but
we also need a matching code to remove .git/logs/refs/l
directory.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-19 01:28:47 -07:00
Junio C Hamano 65606f3530 Merge branch 'js/diff'
* js/diff:
  Turn on recursive with --summary
2006-10-18 22:09:03 -07:00
Junio C Hamano 6847e56c9e Merge branch 'rs/zip'
* rs/zip:
  git-archive --format=zip: add symlink support
  git-archive --format=zip: use default version ID
2006-10-18 22:08:24 -07:00
Yasushi SHOJI ced78b3907 clone: the given repository dir should be relative to $PWD
the repository argument for git-clone should be relative to $PWD
instead of the given target directory.  The old behavior gave us
surprising success and you need a few minute to know why it worked.

GIT_DIR is already exported so no need to cd into $D. And this makes
$PWD for git-fetch-pack, which is the actual command to take the given
repository dir, the same as git-clone.

Signed-off-by: Yasushi SHOJI <yashi@atmark-techno.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-14 18:22:04 -07:00
Junio C Hamano 4035b46e12 t4015: work-around here document problem on Cygwin.
Signed-off-by: Junio C Hamano <junio@twinsun.com>
2006-10-13 14:21:22 -07:00
Johannes Schindelin 2344d47fba diff: fix 2 whitespace issues
When whitespace or whitespace change was ignored, the function
xdl_recmatch() returned memcmp() style differences, which is wrong,
since it should return 0 on non-match.

Also, there were three horrible off-by-one bugs, even leading to wrong
hashes in the whitespace special handling.

The issue was noticed by Ray Lehtiniemi.

For good measure, this commit adds a test.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-12 09:30:14 -07:00
Junio C Hamano b3d4204fc4 git-pack-refs --all
This changes 'git-pack-refs' to pack only tags by default.
Branches are meant to be updated, either by committing onto it
yourself or tracking remote branches, and packed entries can
become stale easily, but tags are usually "create once and live
forever" and benefit more from packing.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-08 01:36:08 -07:00
Rene Scharfe 62cdce17c5 git-archive --format=zip: add symlink support
Add symlink support to ZIP file creation, and a few tests.

This implementation sets the "version made by" field
(creator_version) to Unix for symlinks, only; regular files and
directories are still marked as originating from FAT/VFAT/NTFS.

Also set "external file attributes" (attr2) to 0 for regular
files and 16 for directories (FAT attribute), and to the file
mode for symlinks.

We could always set the creator_version to Unix and include the
mode, but then Info-ZIP unzip would set the mode of the extracted
files to *exactly* the value stored in attr2.  The FAT trick
makes it apply the umask instead.  Note: FAT has no executable
bit, so this information is not stored in the ZIP file.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-07 23:16:54 -07:00
Martin Waitz 7a0cf2d013 test-lib: separate individual test better in verbose mode.
When running tests with --verbose it is difficult to see where
one test starts and where it ends because everything is printed
in one big lump.
Fix that by printing one single newline between each test.

Signed-off-by: Martin Waitz <tali@admingilde.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-07 21:33:48 -07:00
Dennis Stosberg 26e5fc3415 Remove bashism from t3210-pack-refs.sh
This bashism makes the test fail if /bin/sh is not bash.

Signed-off-by: Dennis Stosberg <dennis@stosberg.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-06 02:52:37 -07:00
Johannes Schindelin d7014dc081 Turn on recursive with --summary
This makes "git log/diff --summary" imply recursive behaviour,
whose effect is summarized in one test output:

    --- a/t/t4013/diff.diff-tree_--pretty_--root_--summary_initial
    +++ b/t/t4013/diff.diff-tree_--pretty_--root_--summary_initial
    @@ -5,7 +5,7 @@ Date:   Mon Jun 26 00:00:00 2006 +0000

	 Initial

    - create mode 040000 dir
    + create mode 100644 dir/sub
      create mode 100644 file0
      create mode 100644 file2
     $

When a file is created in a subdirectory, we used to say just
the directory name only when that directory also was created,
which did not make sense from two reasons.  It is not any more
significant to create a new file in a new directory than to
create a new file in an existing directory, and even if it were,
reportinging the new directory name without saying the actual
filename is not useful.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-05 15:10:40 -07:00
Robin Rosenberg b599deec18 Error in test description of t1200-tutorial
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-03 01:02:27 -07:00
Junio C Hamano ff989b8d46 Merge branch 'master' into lj/refs
* master: (99 commits)
  lock_ref_sha1_basic does not remove empty directories on BSD
  git-push: .git/remotes/ file does not require SP after colon
  git-mv: invalidate the removed path properly in cache-tree
  Makefile: install and clean merge-recur, still.
  GIT 1.4.3-rc1
  gitweb: tree view: hash_base and hash are now context sensitive
  git-diff -B output fix.
  fetch: Reset remote refs list each time fetch_main is called
  Remove -fPIC which was only needed for Git.xs
  Fix approxidate() to understand 12:34 AM/PM are 00:34 and 12:34
  git-diff -B output fix.
  Make cvsexportcommit remove files.
  diff --stat: ensure at least one '-' for deletions, and one '+' for additions
  diff --stat=width[,name-width]: allow custom diffstat output width.
  gitweb: History: blob and tree are first, then commitdiff, etc
  gitweb: Remove redundant "commit" from history
  http/ftp: optionally ask curl to not use EPSV command
  gitweb: Don't use quotemeta on internally generated strings
  gitweb: Add snapshot to shortlog
  gitweb: Factor out gitweb_have_snapshot()
  ...
2006-10-02 11:49:59 -07:00
Junio C Hamano f5961572a0 Merge branch 'maint'
* maint:
  git-push: .git/remotes/ file does not require SP after colon
  git-mv: invalidate the removed path properly in cache-tree
2006-10-02 00:47:32 -07:00
Junio C Hamano 4fddf5798d git-mv: invalidate the removed path properly in cache-tree
The command updated the cache without invalidating the cache
tree entries while removing an existing entry.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-01 23:32:39 -07:00
Christian Couder 14c8a681f7 Clean up "git-branch.sh" and add remove recursive dir test cases.
Now that directory recursive remove works in the core C code, we
don't need to do it in "git-branch.sh".

Also add test cases to check that directory recursive remove will
continue to work.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-01 08:42:01 -07:00