Commit graph

20474 commits

Author SHA1 Message Date
Jeff King 0974c117ff diff: use large integers for diffstat calculations
The diffstat "added" and "changed" fields generally store
line counts; however, for binary files, they store file
sizes. Since we store and print these values as ints, a
diffstat on a file larger than 2G can show a negative size.
Instead, let's use uintmax_t, which should be at least 64
bits on modern platforms.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-17 11:30:21 -07:00
Junio C Hamano 902f235378 Git 1.6.6
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-12-23 12:23:11 -08:00
Robert Zeh b7f44fdf27 git svn: add test for a git svn gc followed by a git svn mkdirs
git svn gc will compress the unhandled.log files that git svn mkdirs reads,
causing git svn mkdirs to skip directory creation.

[ew: trivial whitespace cleanups]
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Robert Zeh <robert.a.zeh@gmail.com>
2009-12-23 11:58:05 -08:00
Eric Wong 150d38c4f3 git svn: branch/tag commands detect username in URLs
svn+ssh:// repositories often have userinfo embedded in the URL
which were stripped out of the "git-svn-id:" trailers.  Since
the SVN::Client::copy function takes userinfo into account when
matching URLs for SVN repositories, we need to retrieve the full
URL with embedded userinfo in it to avoid mismatched URLs.

Tested-by: Florian Köberle <florian@fkoeberle.de>
Signed-off-by: Eric Wong <normalperson@yhbt.net>
2009-12-23 11:58:05 -08:00
Junio C Hamano 129a5a6dea Merge branch 'maint'
* maint:
  Prevent git blame from segfaulting on a missing author name
2009-12-22 12:32:39 -08:00
Eric Wong 0fe19753f2 git svn: lookup new parents correctly from svn:mergeinfo
This appears to be a trivial case where array indices were being
passed to git rev-list, instead of the contents stored in the
array itself.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
2009-12-22 12:15:40 -08:00
David Reiss c8cba79181 Prevent git blame from segfaulting on a missing author name
The human-readable author and committer name can be missing from
commits imported from foreign SCM interfaces.  Make sure we parse
the "author" and "committer" line a bit more leniently and avoid
segfaulting by assuming the name always exists.

Signed-off-by: David Reiss <dreiss@facebook.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-12-22 11:51:17 -08:00
Andrew Myrick 063681d72e git-svn: Remove obsolete MAXPARENT check
Change git-svn not to impose a limit of 16 parents on a merge.

This limit in git-svn artificially prevents cloning svn repositories
that contain commits with more than 16 merge parents.

The limit was removed from builtin-commit-tree.c for git v1.6.0 in commit
ef98c5cafb, so there is no need to check for it
it in git-svn.

Signed-off-by: Andrew Myrick <amyrick@apple.com>
Acked-by: Eric Wong <normalperson@yhbt.net>
2009-12-21 14:33:50 -08:00
Sam Vilain 7a955a5365 git-svn: detect cherry-picks correctly.
The old function was incorrect; in some instances it marks a cherry picked
range as a merged branch (because of an incorrect assumption that
'rev-list COMMIT --not RANGE' would work).  This is replaced with a
function which should detect them correctly, memoized to limit the expense
of dealing with branches with many cherry picks to one 'merge-base' call
per merge, per branch which used cherry picking.

Signed-off-by: Sam Vilain <sam@vilain.net>
Acked-by: Eric Wong <normalperson@yhbt.net>
2009-12-21 02:32:53 -08:00
Sam Vilain ea020cbd6a git-svn: exclude already merged tips using one rev-list call
The old function would have to check all mentioned merge tips, every time
that the mergeinfo ticket changed.  This involved 1-2 rev-list operation
for each listed mergeinfo line.  If there are a lot of feature branches
being merged into a trunk, this makes for a very expensive operation for
detecting the new parents on every merge.

This new version first uses a single 'rev-list' to figure out which commit
ranges are already reachable from the parents.  This is used to eliminate
the already merged branches from the list.

Signed-off-by: Sam Vilain <sam@vilain.net>
Acked-by: Eric Wong <normalperson@yhbt.net>
2009-12-21 02:32:52 -08:00
Sam Vilain 33973a5b17 git-svn: fix some mistakes with interpreting SVN mergeinfo commit ranges
SVN's list of commit ranges in mergeinfo tickets is inclusive, whereas
git commit ranges are exclusive on the left hand side.  Also, the end
points of the commit ranges may not exist; they simply delineate
ranges of commits which may or may not exist.  Fix these two mistakes.

Signed-off-by: Sam Vilain <sam@vilain.net>
Acked-by: Eric Wong <normalperson@yhbt.net>
2009-12-21 02:32:50 -08:00
Sam Vilain 7d944c3399 git-svn: memoize conversion of SVN merge ticket info to git commit ranges
Each time the svn mergeinfo ticket changes, we look it up in the rev_map;
when there are a lot of merged branches, this will result in many repeated
lookups of the same information for subsequent commits.  Arrange the slow
part of the function so that it may be memoized, and memoize it.  The more
expensive revision walking operation can be memoized separately.

[ew: changed "next" to "return" for function exit]

Signed-off-by: Sam Vilain <sam@vilain.net>
Acked-by: Eric Wong <normalperson@yhbt.net>
2009-12-21 02:32:48 -08:00
Sam Vilain 1d144aa25e git-svn: expand the svn mergeinfo test suite, highlighting some failures
As shown, git-svn has some problems; not all svn merges are correctly
detected, and cherry picks may incorrectly be detected as real merges.
These test cases will be marked as _success once the relevant fixes are in.

Signed-off-by: Sam Vilain <sam@vilain.net>
Acked-by: Eric Wong <normalperson@yhbt.net>
2009-12-21 02:32:46 -08:00
Eric Wong af57b41d41 update release notes for git svn in 1.6.6
Signed-off-by: Eric Wong <normalperson@yhbt.net>
2009-12-21 02:32:41 -08:00
Eric Wong 577e9fcad2 git svn: fix --revision when fetching deleted paths
When using the -r/--revision argument to fetch deleted history,
calling SVN::Ra::get_log() from an SVN::Ra object initialized
to track the deleted URL will fail.

This regression was introduced in:
  commit 4aacaeb3dc
  "fix shallow clone when upstream revision is too new"

We now ignore errors from SVN::Ra::get_log() here because using
--revision will always override the value of $head here if
(and only if) we're tracking deleted directories.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
2009-12-21 02:32:39 -08:00
Junio C Hamano ab0964d951 Git 1.6.6-rc4
Hopefully the last rc before the final one.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-12-20 12:15:02 -08:00
Junio C Hamano b6b9f83ea1 Merge branch 'maint'
* maint:
  rebase -i: abort cleanly if the editor fails to launch
  technical-docs: document hash API
  api-strbuf.txt: fix typos and document launch_editor()
2009-12-19 23:20:16 -08:00
Björn Gustavsson e49ca974d6 rebase -i: abort cleanly if the editor fails to launch
If the user's configured editor is emacsclient, the editor
will fail to launch if emacs is not running and the git
command that tried to lanuch the editor will abort. For most
commands, all you have to do is to start emacs and repeat
the command.

The "git rebase -i" command, however, aborts without cleaning
the "$GIT_DIR/rebase-merge" directory if it fails to launch the
editor, so you'll need to do "git rebase --abort" before
repeating the rebase command.

Change "git rebase -i" to terminate using "die_abort" (instead of
with "die") if the initial launch of the editor fails.

Signed-off-by: Björn Gustavsson <bgustavsson@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-12-19 23:20:05 -08:00
Eric Wong 8eca03c861 t9146: use 'svn_cmd' wrapper
Using 'svn' directly may not work for all users.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
2009-12-19 23:06:20 -08:00
Eric Wong a5b80d9263 git svn: make empty directory creation gc-aware
The "git svn gc" command creates and appends to unhandled.log.gz
files which should be parsed before the uncompressed
unhandled.log files.

Reported-by: Robert Zeh
Signed-off-by: Eric Wong <normalperson@yhbt.net>
2009-12-19 14:07:24 -08:00
Stephen Boyd afab0fe052 technical-docs: document hash API
Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-12-17 21:54:50 -08:00
Stephen Boyd 63b76948e1 api-strbuf.txt: fix typos and document launch_editor()
Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-12-17 21:54:28 -08:00
Junio C Hamano 94058a90cf Git 1.6.6-rc3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-12-16 12:50:33 -08:00
Junio C Hamano a1bb8f45f1 Merge branch 'maint' to sync with 1.6.5.7
* maint:
  Git 1.6.5.7
  worktree: don't segfault with an absolute pathspec without a work tree
  ignore unknown color configuration
  help.autocorrect: do not run a command if the command given is junk
  Illustrate "filter" attribute with an example
2009-12-16 12:47:15 -08:00
Junio C Hamano 527b9d704d Git 1.6.5.7
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-12-16 12:45:25 -08:00
Junio C Hamano b3100fd555 worktree: don't segfault with an absolute pathspec without a work tree
If a command is run with an absolute path as a pathspec inside a bare
repository, e.g. "rev-list HEAD -- /home", the code tried to run strlen()
on NULL, which is the result of get_git_work_tree(), and segfaulted.  It
should just fail instead.

Currently the function returns NULL even inside .git/ in a repository
with a work tree, but that is a separate issue.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-12-16 12:45:25 -08:00
Jeff King 8b8e862490 ignore unknown color configuration
When parsing the config file, if there is a value that is
syntactically correct but unused, we generally ignore it.
This lets non-core porcelains store arbitrary information in
the config file, and it means that configuration files can
be shared between new and old versions of git (the old
versions might simply ignore certain configuration).

The one exception to this is color configuration; if we
encounter a color.{diff,branch,status}.$slot variable, we
die if it is not one of the recognized slots (presumably as
a safety valve for user misconfiguration). This behavior
has existed since 801235c (diff --color: use
$GIT_DIR/config, 2006-06-24), but hasn't yet caused a
problem. No porcelain has wanted to store extra colors, and
we once a color area (like color.diff) has been introduced,
we've never changed the set of color slots.

However, that changed recently with the addition of
color.diff.func. Now a user with color.diff.func in their
config can no longer freely switch between v1.6.6 and older
versions; the old versions will complain about the existence
of the variable.

This patch loosens the check to match the rest of
git-config; unknown color slots are simply ignored. This
doesn't fix this particular problem, as the older version
(without this patch) is the problem, but it at least
prevents it from happening again in the future.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-12-16 12:45:16 -08:00
Johannes Sixt 06500a0299 help.autocorrect: do not run a command if the command given is junk
If a given command is not found, then help.c tries to guess which one the
user could have meant. If help.autocorrect is 0 or unset, then a list of
suggestions is given as long as the dissimilarity between the given command
and the candidates is not excessively high. But if help.autocorrect was
non-zero (i.e., a delay after which the command is run automatically), the
latter restriction on dissimilarity was not obeyed.

In my case, this happened:

 $ git ..daab02
 WARNING: You called a Git command named '..daab02', which does not exist.
 Continuing under the assumption that you meant 'read-tree'
 in 4.0 seconds automatically...

The patch reuses the similarity limit that is also applied when the list of
suggested commands is printed.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-12-15 16:21:51 -08:00
Nanako Shiraishi d79f5d1718 Illustrate "filter" attribute with an example
The example was taken from aa4ed402c9
(Add 'filter' attribute and external filter driver definition).

Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-12-14 22:04:30 -08:00
Björn Gustavsson e25e2b4201 bash: Support new 'git fetch' options
Support the new options --all, --prune, and --dry-run for
'git fetch'.

As the --multiple option was primarily introduced to enable
'git remote update' to be re-implemented in terms of 'git fetch'
(16679e37) and is not likely to be used much from the command
line, it does not seems worthwhile to complicate the code
(to support completion of multiple remotes) to handle it.

Signed-off-by: Björn Gustavsson <bgustavsson@gmail.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-12-12 15:32:07 -08:00
Junio C Hamano 4966688e55 Update Release Notes for 1.6.6 to remove old bugfixes
These three have already been backported to 1.6.5.5

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-12-10 16:22:42 -08:00
Junio C Hamano 4cb51a65a4 Sync with 1.6.5.6
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-12-10 16:20:59 -08:00
Junio C Hamano 9861b644e0 Git 1.6.5.6
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-12-10 15:42:30 -08:00
Junio C Hamano 782a0005fc Fix archive format with -- on the command line
Giving --format from the command line, or using output file extention to
DWIM the output format, with a pathspec that is disambiguated with an
explicit double-dash on the command line, e.g.

    git archive -o file --format=zip HEAD -- path
    git archive -o file.zip HEAD -- path

didn't work correctly.

This was because the code reordered (when one was given) or added (when
the format was inferred) a --format argument at the end, effectively
making it to "archive HEAD -- path --format=zip", i.e. an extra pathspec
that is unlikely to match anything.

The command line argument list should always be "options, revs and then
paths", and we should set a good example by inserting the --format at the
beginning instead.

Reported-by: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-12-10 15:29:05 -08:00
Junio C Hamano 1456b043fc Remove post-upload-hook
This hook runs after "git fetch" in the repository the objects are
fetched from as the user who fetched, and has security implications.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-12-10 12:21:40 -08:00
Junio C Hamano 80d93611c5 Git 1.6.6-rc2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-12-09 16:21:36 -08:00
Junio C Hamano 529f8c6ea6 Merge git://repo.or.cz/git-gui
* git://repo.or.cz/git-gui:
  git-gui: suppress RenderBadPicture X error caused by Tk bug
  git-gui: Increase blame viewer usability on MacOS.
  git-gui: search 4 directories to improve statistic of gc hint
  git gui: make current branch default in "remote delete branch" merge check
2009-12-09 15:38:51 -08:00
Junio C Hamano 47344eee9b Merge git://git.kernel.org/pub/scm/gitk/gitk
* git://git.kernel.org/pub/scm/gitk/gitk:
  gitk: Fix selection of tags
  gitk: Default to the system colours on Windows
  gitk: Update Japanese translation
  gitk: Fix "git gui blame" invocation when called from top-level directory
  gitk: Disable checkout of remote branches
  gitk: Improve appearance of radiobuttons and checkbuttons
  gitk: Skip translation of "wrong Tcl version" message
  gitk: Add Japanese translation
  gitk: Use the --submodule option for displaying diffs when available
  gitk: Fix diffing committed -> staged (typo in diffcmd)
  gitk: Add configuration for UI colour scheme
  gitk: Don't compare fake children when comparing commits
  gitk: Show diff of commits at end of compare-commits output
  gitk: Add a user preference to enable/disable use of themed widgets
  gitk: Fix errors in the theme patch
  gitk: Use themed tk widgets
  gitk: Restore scrolling position of diff pane on back/forward in history
2009-12-09 15:38:42 -08:00
Junio C Hamano 8eb65d9671 Update draft release notes to 1.6.6 before -rc2
Reword the 1.7.0 warnings, and drop deprecation of "merge <msg> HEAD <commit>..."
syntax.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-12-09 13:38:52 -08:00
Junio C Hamano ff86bdd5ca Merge branch 'maint'
* maint:
  add-interactive: fix deletion of non-empty files
  pull: clarify advice for the unconfigured error case
2009-12-08 22:47:09 -08:00
Junio C Hamano 5c30b8f7dd Merge branch 'mm/maint-merge-ff-error-message-fix' into maint
* mm/maint-merge-ff-error-message-fix:
  builtin-merge: show user-friendly error messages for fast-forward too.
  merge-recursive: make the error-message generation an extern function

Conflicts:
	merge-recursive.c
2009-12-08 22:42:23 -08:00
Junio C Hamano 389e0baa94 Merge branch 'jn/maint-pull-rebase-error-message' into maint
* jn/maint-pull-rebase-error-message:
  pull: clarify advice for the unconfigured error case
2009-12-08 22:39:20 -08:00
Junio C Hamano a876433c5f Merge branch 'jk/maint-add-p-delete-fix' into maint
* jk/maint-add-p-delete-fix:
  add-interactive: fix deletion of non-empty files
2009-12-08 22:37:50 -08:00
Junio C Hamano ca83dc5391 Merge git://git.bogomips.org/git-svn
* git://git.bogomips.org/git-svn:
  git-svn: set svn.authorsfile earlier when cloning
  git-svn: Set svn.authorsfile to an absolute path when cloning
2009-12-08 21:59:04 -08:00
Alex Vandiver f584150966 git-svn: set svn.authorsfile earlier when cloning
If a clone errors out because of a missing author, or user interrupt,
this allows `git svn fetch` to resume seamlessly, rather than forcing
the user to re-provide the path to the authors file.

[ew: shortened subject]
Signed-off-by: Alex Vandiver <alex@chmrr.net>
Acked-by: Eric Wong <normalperson@yhbt.net>
2009-12-08 20:39:58 -08:00
Alex Vandiver 2bc35dcbf7 git-svn: Set svn.authorsfile to an absolute path when cloning
If --authors-file is passed a relative path, cloning will work, but
future `git svn fetch`es will fail to locate the authors file
correctly.  Thus, use File::Spec->rel2abs to determine an absolute
path for the authors file before setting it.

Signed-off-by: Alex Vandiver <alex@chmrr.net>
Acked-by: Eric Wong <normalperson@yhbt.net>
2009-12-08 20:38:39 -08:00
Junio C Hamano 77c29b4aca Revert recent "git merge <msg> HEAD <commit>..." deprecation
This reverts commit c0ecb07048 "git-pull.sh:
Fix call to git-merge for new command format" and

commit b81e00a965 "git-merge: a deprecation
notice of the ancient command line syntax".

They caused a "git pull" (without any arguments, and without any local
commits---only to update to the other side) to warn that commit log
message is ignored because the merge resulted in a fast-forward.

Another possible solution is to add an extra option to "git merge" so that
"git pull" can tell it that the message given is not coming from the end
user (the canned message is passed just in case the merge resulted in a
non-ff and caused commit), but I think it is easier _not_ to deprecate the
old syntax.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-12-08 15:26:39 -08:00
Jeff King 8947fdd598 add-interactive: fix deletion of non-empty files
Commit 24ab81a fixed the deletion of empty files, but broke
deletion of non-empty files. The approach it took was to
factor out the "deleted" line from the patch header into its
own hunk, the same way we do for mode changes. However,
unlike mode changes, we only showed the special "delete this
file" hunk if there were no other hunks. Otherwise, the user
would annoyingly be presented with _two_ hunks: one for
deleting the file and one for deleting the content.

This meant that in the non-empty case, we forgot about the
deleted line entirely, and we submitted a bogus patch to
git-apply (with "/dev/null" as the destination file, but not
marked as a deletion).

Instead, this patch combines the file deletion hunk and the
content deletion hunk (if there is one) into a single
deletion hunk which is either staged or not.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-12-07 23:52:46 -08:00
Eric Wong f9ad77a739 git svn: log removals of empty directories
This also adds a test case for:
  "git svn: Don't create empty directories whose parents were deleted"
which was the reason we found this bug in the first place.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
2009-12-07 20:49:44 -08:00
Greg Price 33f2a3108e git svn: Don't create empty directories whose parents were deleted
Commit 6111b93 "git svn: attempt to create empty dirs on clone+rebase"
will create empty directories 'a/b' and 'a/c' if they were previously
created in SVN, even if their parent directory 'a' was deleted.

For example, unhandled.log may contain lines like this:

r32
  +empty_dir: packages/sipb-xen-remctl-auto/sipb-xen-remctl-auto/files/etc/remctl/sipb-xen-auto/acl
  +empty_dir: packages/sipb-xen-remctl-auto/sipb-xen-remctl-auto/files/etc/remctl/sipb-xen-auto/machine.d
  +empty_dir: packages/sipb-xen-remctl-auto/sipb-xen-remctl-auto/files/etc/remctl/sipb-xen-auto/moira-acl
[...]
r314
  -empty_dir: packages/sipb-xen-remctl-auto

[ew: rewrote to be line-wrapped at <= 80-columns]

Reported-by: Evan Broder <broder@mit.edu>
Signed-off-by: Greg Price <price@ksplice.com>
Acked-by: Eric Wong <normalperson@yhbt.net>
2009-12-07 20:47:08 -08:00