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
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>
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>
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>
* 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
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>
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>
* 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)
* 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
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>
* 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)
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>
* 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
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>
* 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]
* 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
* 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
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>
* 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
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>
* 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
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>
* 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
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>
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>
* 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.
* 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
* 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.
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>
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>
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>
* 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
...
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>