Commit Graph

375 Commits

Author SHA1 Message Date
Junio C Hamano
688a750714 Merge branch '__/setup-n-mv' into next
This pulls Linus's setup_git_directory() restructuring in via
the setup-n-mv merge conflict resolution branch.

* __/setup-n-mv:
  Call setup_git_directory() much earlier
  Call setup_git_directory() early
  Display an error from update-ref if target ref name is invalid.
  Fix http-fetch
  t4103: fix binary patch application test.
  git-apply -R: binary patches are irreversible for now.
  Teach git-apply about '-R'
  Makefile: ssh-pull.o depends on ssh-fetch.c
2006-07-29 02:00:46 -07:00
Junio C Hamano
7061cf0f20 Merge branch 'lt/setup' into __/setup-n-mv
This merges the new built-in calling convention code into Johannes's
builtin-mv topic in order to resolve their conflicts early on.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-29 01:54:54 -07:00
Shawn Pearce
818f477c40 Display an error from update-ref if target ref name is invalid.
Alex Riesen (raa.lkml@gmail.com) recently observed that git branch
would fail with no error message due to unexpected situations with
regards to refs.  For example, if .git/refs/heads/gu is a file but
"git branch -b refs/heads/gu/fixa HEAD" was invoked by the user
it would fail silently due to refs/heads/gu being a file and not
a directory.

This change adds a test for trying to create a ref within a directory
that is actually currently a file, and adds error printing within
the ref locking routine should the resolve operation fail.

The error printing code probably belongs at this level of the library
as other failures within the ref locking, writing and logging code
are also currently at this level of the code.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-28 20:53:53 -07:00
Junio C Hamano
5afa69b415 t4103: fix binary patch application test.
The generated binary patch was _not_ binary -- earlier I made
the --full-index flag to imply binary patch generation to the diff
machinery, but later we made it independent from --binary (although
the latter implies the former).

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-28 12:23:28 -07:00
Johannes Schindelin
e5a94313c0 Teach git-apply about '-R'
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-28 11:18:02 -07:00
Junio C Hamano
5321e7ae74 Merge branch 'js/mv' into next
* js/mv:
  builtin git-mv: support moving directories
  Make git-mv a builtin
  Extract helper bits from c-merge-recursive work
  git-cvsserver: support multiline commit messages
  t7001: add test for git-mv dir1 dir2/
  gitweb: fix two warnings
  git-instaweb: respect bindir from Makefile
  git-instaweb: some Apache have mod_cgi builtin
  t4112: simplify the test and remove unneeded working tree file.
  Extend testing git-mv for renaming of subdirectories
2006-07-26 13:40:24 -07:00
Johannes Schindelin
ac64a72207 builtin git-mv: support moving directories
This fixes the builtin mv for the test which Josef provided, and also
fixes moving directories into existing directories, as noted by Jon Smirl.
In case the destination exists, fail early (this cannot be overridden
by -f).

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-26 13:36:36 -07:00
Johannes Schindelin
a1dad607fa t7001: add test for git-mv dir1 dir2/
If dir2 already exists, git-mv should move dir1 _into_dir2/.
Noticed by Jon Smirl.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-26 12:24:49 -07:00
Junio C Hamano
b7a036bb5f t4112: simplify the test and remove unneeded working tree file.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-26 11:05:44 -07:00
Josef Weidendorfer
afd222967c Extend testing git-mv for renaming of subdirectories
Signed-off-by: Josef Weidendorfer <Josef.Weidendorfer@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-26 11:05:44 -07:00
Junio C Hamano
a8861ea81b Merge branch 'ew/apply'
* ew/apply:
  Fix t4114 on cygwin
  apply: handle type-changing patch correctly.
  apply: split out removal and creation into different phases.
  apply: check D/F conflicts more carefully.
  typechange tests for git apply (currently failing)
2006-07-25 12:50:23 -07:00
Junio C Hamano
9bf31e8302 Merge branch 'lt/web' into next
* lt/web:
  gitweb.cgi: git_blame2: slight optimization reading the blame lines
  gitweb.cgi: git_blame2: Revision blocks now have alternating colors
  gitweb.cgi: git_blame2: Allow back-trekking through commits
  gitweb.cgi: git_blame2: an alternative simple working git blame
  gitweb.cgi: Centralize printing of the page path
  gitweb.cgi: Show "raw" head of project link even when $hash is not defined
  gitweb.cgi: Include direct link to "raw" files from "history"
  gitweb.cgi: Teach git_history() to read hash from $hash_base
  Trivial path optimization test
  Always reset the color _before_ printing out the newline
2006-07-24 18:22:25 -07:00
Alex Riesen
57c7d9a775 Trivial path optimization test
Linus:
    get_pathspec() does turn '.' into an empty string (which is
    correct - git internally does _not_ ever understand the notion of
    "." as the current working directory), but it doesn't ever do the
    optimization of noticing that a pathspec that consists solely of
    an empty string is "equivalent" to an empty pathspec.

The test is to ensure that this behaviour stays.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-24 17:32:22 -07:00
Junio C Hamano
efcd055a17 Merge branch 'ew/apply' into next
* ew/apply:
  apply: handle type-changing patch correctly.
  apply: split out removal and creation into different phases.
  apply: check D/F conflicts more carefully.
  typechange tests for git apply (currently failing)
2006-07-17 00:11:02 -07:00
Eric Wong
8641fb24ee typechange tests for git apply (currently failing)
I've found that git apply is incapable of handling patches
involving object type changes to the same path.

Of course git itself is perfectly capable of making commits that
generate these changes, as it only tracks trees states.  It's
just that the diffs between them are less useful if they can't
be applied.

Some of these are rare, but I've hit one of them (file becoming
a symlink) recently in real-world usage, and was inspired to
find more potential breakages :)

I'm not sure when I'll have time to fix these myself and I'm not
very familiar with the apply code.   So if someone could get
some or all of these cases working, they would be my hero :)

Some of these are what I would refer to as corner-cases from
hell.  Most (if not all) other systems fail some of these.  In
fact, they aren't even capable of representing most of these
changes in their histories; much less being able to handle
patches to that effect.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-16 22:15:21 -07:00
Junio C Hamano
a080bc7fcc Merge branch 'jc/clone-bind-failure' into next
* jc/clone-bind-failure:
  fetch/clone: check return status from ls-remote
  gitweb.css: Use monospace fonts for commits and tree-diff.
  Do not use perl in git-commit.sh
  diff: Support 256 colors
  diff: Support both attributes and colors
  Documentation about exclude/ignore files
  daemon: new option --detach to run git-daemon in background
  daemon: new option --pid-file=<path> to store the pid
  upload-pack: ignore write errors to stderr
  daemon: if one of the standard fds is missing open it to /dev/null
  daemon: use a custom die routine with syslog
  Documentation: Fix ssh://[user@]host.xz URL
  Adjust t4013 tests to corrected format-patch.
  format-patch: Generate a newline between the subject header and the message body
  t4013 diff format tests update
  Display help for Git mode after pressing `h' or `?' in *git-status*
  Wrap long lines in docstrings in contrib/emacs/git.el
2006-07-13 23:12:39 -07:00
Junio C Hamano
855409296d Adjust t4013 tests to corrected format-patch.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-13 21:40:44 -07:00
Junio C Hamano
a40d384cac t4013 diff format tests update
This changes one test commit in the sequence to have more than
one lines of commit log.  A few output formats (--pretty=email
aka format-patch and --pretty=oneline) need to behave
differently on single and multi-line log, and this change will
help catching breakages.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-13 21:40:43 -07:00
Junio C Hamano
aa1d55c718 Merge branch 'lt/unitype' into next
* lt/unitype:
  Remove TYPE_* constant macros and use object_type enums consistently.
  test-lib: unset GIT_TRACE
  git-repack: avoid redirecting stderr into git-pack-objects
  Fix grammatical error in git-revert
  fmt-merge-msg fix
  gitweb: Make command invocations go through the git wrapper

[builtin-prune needed to be adjusted for TYPE => OBJ]
2006-07-12 23:25:40 -07:00
Junio C Hamano
d3ba675aae Merge branch 'ml/trace'
* ml/trace:
  test-lib: unset GIT_TRACE
  GIT_TRACE: fix a mixed declarations and code warning
  GIT_TRACE: show which built-in/external commands are executed
2006-07-12 23:09:10 -07:00
Junio C Hamano
1d0361e806 test-lib: unset GIT_TRACE
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-12 23:09:00 -07:00
Junio C Hamano
e40e0135f2 Merge branch 'js/merge-base'
* js/merge-base:
  Additional merge-base tests (revised)
  merge-base: update the clean-up postprocessing
2006-07-12 22:44:59 -07:00
Junio C Hamano
5bae45fe2d Merge branch 'sp/reflog' into next
* sp/reflog:
  Log ref changes made by resolve.
  Log ref changes made by quiltimport.
  Log ref changes made by git-merge and git-pull.
  git-fetch: fix a bashism (==)
  Make the unpacked object header functions static to sha1_file.c
  git-send-email: Remove redundant Reply-To header
  typofix (git-name-rev documentation)
  Mention the [user@] part in documentation of ssh:// urls.
  tests: Set EDITOR=: and VISUAL=: globally
2006-07-11 14:21:48 -07:00
Eric Wong
8ff99e7417 tests: Set EDITOR=: and VISUAL=: globally
This way we don't have to remember to set it for each test; and
if we forget, we won't cause interactive editors to be spawned
for non-interactive tests.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-11 12:32:54 -07:00
Junio C Hamano
028cfcba78 Merge branch 'master' into next
* master:
  Log ref changes made by git-fetch and git-pull.
  Record the type of commit operation in the reflog.
  Allow user.name and user.email to drive reflog entry.
  Fix linking for not-so-clever linkers.
  git-rev-list: add documentation for --parents, --no-merges
2006-07-10 21:45:26 -07:00
Shawn Pearce
a3a733e63b Record the type of commit operation in the reflog.
If committing a merge (.git/MERGE_HEAD exists), an initial tree
(no HEAD) or using --amend to amend the prior commit then denote
the subtype of commit in the reflog.  This helps to distinguish
amended or merge commits from normal commits.

In the case of --amend the prior sha1 is probably the commit which
is being thrown away in favor of the new commit.  Since it is likely
that the old commit doesn't have any ref pointing to it anymore
it can be interesting to know why that the commit was replaced
and orphaned.

In the case of a merge the prior sha1 is probably the first parent
of the new merge commit.  Consequently having its prior sha1 in the
reflog is slightly less interesting but its still informative to
know the commit was the result of a merge which had to be completed
by hand.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-10 21:21:16 -07:00
Junio C Hamano
f1575a344c Merge branch 'master' into next
* master:
  Avoid C99 comments, use old-style C comments instead.
  Fix more typos, primarily in the code
  gitweb.cgi: Teach "a=blob" action to know the blob/file mime type
  gitweb.cgi: Create $git_temp if it doesn't exist
  git-svn: fix --file/-F option in commit-diff
  Avoid C99 initializers
2006-07-10 00:54:04 -07:00
Pavel Roskin
82e5a82fd7 Fix more typos, primarily in the code
The only visible change is that git-blame doesn't understand
"--compability" anymore, but it does accept "--compatibility" instead,
which is already documented.

Signed-off-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-10 00:36:44 -07:00
Junio C Hamano
83e36c1a2d Merge branch 'js/merge-base' into next
* js/merge-base:
  Additional merge-base tests (revised)
  merge-base: update the clean-up postprocessing
  Fix typos involving the word 'commit'
  Fix some doubled word typos
  "git -p cmd" to page anywhere
  change ent to tree in git-diff documentation
  Assorted typo fixes
2006-07-09 03:39:07 -07:00
A Large Angry SCM
cd6f207a44 Additional merge-base tests (revised)
Signed-off-by: A Large Angry SCM <gitzilla@gmail.com>
2006-07-09 03:38:12 -07:00
Junio C Hamano
5082a66602 Merge branch 'ew/svn' into next
* ew/svn:
  Makefile: export NO_SVN_TESTS
  git-svn: migrate out of contrib (follow-up)
2006-07-07 13:32:49 -07:00
Junio C Hamano
4b832e819d git-svn: migrate out of contrib (follow-up)
Check for SVN::Core so test 910[45] don't fail if the user
doesn't have those installed.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-07 03:17:59 -07:00
Junio C Hamano
66fee66ee0 Merge branch 'ew/svn' into next
* ew/svn:
  git-svn: migrate out of contrib
  core.compression documentation formatting fix.
2006-07-06 17:34:26 -07:00
Eric Wong
60d02ccc18 git-svn: migrate out of contrib
Allow NO_SVN_TESTS to be defined to skip git-svn tests.  These
tests are time-consuming due to SVN being slow, and even more so
if SVN Perl libraries are not available.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-06 17:02:47 -07:00
Junio C Hamano
a3d470c2d5 Merge branch 'jc/fmt-merge-msg-test'
* jc/fmt-merge-msg-test:
  t6200: fmt-merge-msg test.
2006-07-05 16:36:46 -07:00
Junio C Hamano
49b2788539 Merge branch 'jc/diff-test'
* jc/diff-test:
  t4013: add "diff" UI program tests.
2006-07-05 16:33:50 -07:00
Junio C Hamano
0c926a3d9c Merge branch 'th/diff'
* th/diff:
  builtin-diff: turn recursive on when defaulting to --patch format.
  t4013: note improvements brought by the new output code.
  t4013: add format-patch tests.
  format-patch: fix diff format option implementation
  combine-diff.c: type sanity.
  t4013 test updates for new output code.
  Fix some more diff options changes.
  Fix diff-tree -s
  log --raw: Don't descend into subdirectories by default
  diff-tree: Use ---\n as a message separator
  Print empty line between raw, stat, summary and patch
  t4013: add more tests around -c and --cc
  whatchanged: Default to DIFF_FORMAT_RAW
  Don't xcalloc() struct diffstat_t
  Add msg_sep to diff_options
  DIFF_FORMAT_RAW is not default anymore
  Set default diff output format after parsing command line
  Make --raw option available for all diff commands
  Merge with_raw, with_stat and summary variables to output_format
  t4013: add tests for diff/log family output options.
2006-07-05 16:31:24 -07:00
Junio C Hamano
c6de291f73 Merge branch 'jc/grepfix' into next
* jc/grepfix:
  git-grep: use a bit more specific error messages.
  git-grep: fix exit code when we use external grep.
  git-grep: fix parsing of pathspec separator '--'
  t8001-annotate: fix a bash-ism in this test
2006-07-04 03:16:04 -07:00
Eric Wong
4d62eaabeb t8001-annotate: fix a bash-ism in this test
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-04 02:55:52 -07:00
Junio C Hamano
e6c003648d Merge branch 'pb/gitpm' 2006-07-03 19:52:51 -07:00
Junio C Hamano
952a134142 Merge branch 'jc/fmt-merge-msg-test' into next
* jc/fmt-merge-msg-test:
  t6200: fmt-merge-msg test.
  send-email: do not barf when Term::ReadLine does not like your terminal
  boolean: accept yes and no as well
  annotate: Correct most merge following to annotate correctly.
  annotate: Support annotation of files on other revisions.
  Make zlib compression level configurable, and change default.
2006-07-03 19:44:26 -07:00
Junio C Hamano
30a95f3073 t6200: fmt-merge-msg test.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-03 19:12:43 -07:00
Junio C Hamano
280242d1cc send-email: do not barf when Term::ReadLine does not like your terminal
As long as we do not need to readline from the terminal, we
should not barf when starting up the program.  Without this
patch, t9001 test on Cygwin occasionally died with the following
error message:

Unable to get Terminal Size. The TIOCGWINSZ ioctl didn't work. The COLUMNS and LINES environment variables didn't work. The resize program didn't work. at /usr/lib/perl5/vendor_perl/5.8/cygwin/Term/ReadKey.pm line 362.
Compilation failed in require at /usr/lib/perl5/vendor_perl/5.8/Term/ReadLine/Perl.pm line 58.

Acked-by: Ryan Anderson <ryan@michonline.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-03 19:04:46 -07:00
Ryan Anderson
f560069bc5 annotate: Support annotation of files on other revisions.
This is a bug fix, and cleans up one or two other things spotted during the
course of tracking down the main bug here.

Also, the test-suite is updated to reflect this case.

Signed-off-by: Ryan Anderson <ryan@michonline.com>
(cherry picked from 2f7554b4db3ab2c2d3866b160245c91c9236fc9a commit)
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-03 18:41:58 -07:00
Petr Baudis
6fcca938b0 Use $GITPERLLIB instead of $RUNNING_GIT_TESTS and centralize @INC munging
This makes the Git perl scripts check $GITPERLLIB instead of
$RUNNING_GIT_TESTS, which makes more sense if you are setting up your shell
environment to use a non-installed Git instance.

It also weeds out the @INC munging from the individual scripts and makes
Makefile add it during the .perl files processing, so that we can change
just a single place when we modify this shared logic. It looks ugly in the
scripts, too. ;-)

And instead of doing arcane things with the @INC array, we just do 'use lib'
instead, which is essentialy the same thing anyway.

I first want to do three separate patches but it turned out that it's quite
a lot neater when bundled together, so I hope it's ok.

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-03 18:34:53 -07:00
Junio C Hamano
afcf3f6d09 Merge branch 'pb/gitpm' into next
* pb/gitpm: (37 commits)
  Perly Git: make sure we do test the freshly built one.
  Git.pm: Don't #define around die
  Git.xs: older perl do not know const char *
  Git.pm: Avoid ppport.h
  Git.pm: Remove PerlIO usage from Git.xs
  Make perl interface a separate package
  Delete manuals if compiling without docs
  Fix probing for already installed Error.pm
  Git.pm: clean generated files.
  Perly git: work around buggy make implementations.
  Makefile: Set USE_PIC on x86-64
  Perly Git: arrange include path settings properly.
  Add possibility to pass CFLAGS and LDFLAGS specific to the perl subdir
  Git.pm: Support for perl/ being built by a different compiler
  Makefile fix for Solaris
  "test" in Solaris' /bin/sh does not support -e
  Git.pm: Fix Git->repository("/somewhere/totally/elsewhere")
  Git.pm: Swap hash_object() parameters
  Git.pm: Try to support ActiveState output pipe
  Git.pm: tentative fix to test the freshly built Git.pm
  ...
2006-07-02 18:12:48 -07:00
Junio C Hamano
d3140f5c2a Perly Git: make sure we do test the freshly built one.
We could BEGIN { push @INC, '@@INSTLIBDIR@@'; } but that is not
a good idea for normal execution.  The would prevent a
workaround for a user who is trying to override an old, faulty
Git.pm installed on the system path with a newer version
installed under $HOME/.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-02 17:15:31 -07:00
Junio C Hamano
5e6ab8607e Perl interface: make testsuite work again.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-02 17:14:41 -07:00
Junio C Hamano
77d8c9107f Merge branches 'jc/diff-test' and 'th/diff' into next
* jc/diff-test:
  t4013: add "diff" UI program tests.

* th/diff:
  builtin-diff: turn recursive on when defaulting to --patch format.
2006-07-01 22:16:08 -07:00
Junio C Hamano
b319b02e2a t4013: add "diff" UI program tests.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-01 22:02:17 -07:00