format-patch: Generate a newline between the subject header and the message body
format-patch previously didn't generate a newline after a subject. This
caused the diffstat to not be displayed in messages with only one line
for the commit message.
This patch fixes this by adding a newline after the headers if a body
hasn't been added. Signed-off-by: Robert Shearman <rob@codeweavers.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
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.
Display help for Git mode after pressing `h' or `?' in *git-status*
Add bindings for "h" and "?" in git-status-mode to display help about the mode,
including keymap via (describe-function 'git-status-mode), like in PCL-CVS.
Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* 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
git-repack: avoid redirecting stderr into git-pack-objects
We are trying to catch error condition of git-rev-list and cause
the downstream pack-objects to barf, but if you run rev-list
with anything that mucks with its stderr (such as GIT_TRACE),
any stderr output would cause the pipeline to fail.
[jc: originally from Matthias Lederhofer, with a reworded error message.]
We never talk about "xyz commit", except when we end up talking
about a commit as a branch head (notably, I would say "the HEAD
commit", or possibly "the top-of-master commit", but here
$commit is a SHA1 name, not anything else).
Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* lt/merge-tree:
Improved three-way blob merging code
Prepare "git-merge-tree" for future work
xdiff: generate "anti-diffs" aka what is common to two files
gitweb: Make command invocations go through the git wrapper
This patch makes invocations of core git commands go through the 'git'
binary itself, which improves readability and might help system
administrators lock down their CGI environment for security.
Signed-off-by: Alp Toker <alp@atoker.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
This helps users tell one 'git' bookmark apart from the other in their
browser and improves the indexing of gitweb sites in Web search engines.
The title defaults to the SERVER_NAME environment variable, often given
by the webserver.
Signed-off-by: Alp Toker <alp@atoker.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
gitweb: Send XHTML as 'application/xhtml+xml' where possible
"The 'text/html' media type [RFC2854] is primarily for HTML, not for
XHTML. In general, this media type is NOT suitable for XHTML."
This patch makes gitweb use content negotiation to conservatively send
pages as Content-Type 'application/xhtml+xml' when the user agent
explicitly claims to support it.
It falls back to 'text/html' even if the user agent appears to
implicitly support 'application/xhtml+xml' due to a '*/*' glob, working
around an insidious bug in Internet Explorer where sending the correct
media type prevents the page from being displayed.
Signed-off-by: Alp Toker <alp@atoker.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
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>
When git-fetch updates a reference record in the associated reflog
what type of update took place and who caused it (git-fetch or
git-pull, by invoking git-fetch).
Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
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>
Allow user.name and user.email to drive reflog entry.
Apparently calling setup_ident() after git_config causes the
user.name and user.email values read from the config file to be
replaced with the data obtained from the host. This means that
users who have setup their email address in user.email will instead
be writing reflog entries with their hostname.
Moving setup_ident() to before git_config in update-ref resolves
this ordering problem.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
On one of my systems, the linker is not intelligent enough to link with
pager.o (in libgit.a) when only the variable pager_in_use is needed. The
consequence is that the linker complains about an undefined variable. So,
put the variable into environment.o, where it is linked always.
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
Avoid C99 comments, use old-style C comments instead.
This doesn't make the code uglier or harder to read, yet it makes the
code more portable. This also simplifies checking for other potential
incompatibilities. "gcc -std=c89 -pedantic" can flag many incompatible
constructs as warnings, but C99 comments will cause it to emit an error.
Signed-off-by: Pavel Roskin <proski@gnu.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
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>
gitweb.cgi: Teach "a=blob" action to know the blob/file mime type
Now action "blob" knows the file type: if the file type is
not "text/*" then action "blob" defaults to "blob_plain",
i.e. the file is downloaded raw for the browser to interpret.
If the file type is "text/*", then "blob" defaults to the
current "cat -n"-like output, from which you can click
"plain", to get the "blob_plain" output.
Signed-off-by: Luben Tuikov <ltuikov@yahoo.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* ew/diff:
templates/hooks--update: replace diffstat calls with git diff --stat
diff: do not use configuration magic at the core-level
Update diff-options and config documentation.
diff.c: --no-color to defeat diff.color configuration.
diff.c: respect diff.renames config option
* ew/svn:
Fix some doubled word typos
Typofix in Makefile comment.
Makefile: export NO_SVN_TESTS
git-svn: migrate out of contrib (follow-up)
git-svn: migrate out of contrib
This removes the "contaminate the well even more" approach
taken in the current merge-base postprosessing code. Instead,
when there are more than one merge-base results, we compute the
merge-base between them and see if one is a fast-forward of the
other, in which case the ancestor is removed from the result.
This actually removes the objects to be pruned, unless you specify "-n"
(at which point it will just tell you which files it would prune).
This doesn't do the pack-file pruning that the shell-script used to do,
but if somebody really wants to, they could add it easily enough. I wonder
how useful it is, though, considering that "git repack -a -d" is just a
lot more efficient and generates a better end result.
Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
Add "raw" output option to blobs in "tree" view format
Add a "raw" output option to blobs in "tree" view format, so that the
user doesn't have to click on "blob", wait for the (binary) file to be
uploaded and shown in "blob" mode, and then click on "plain" to
download the (binary) file.
This is useful when the file is clearly binary and we don't want the
browser to upload and display it in "blob" mode, but we just want to
download it. Case in point: pdf files, wlg.
Note: the "raw" format is equivalent to the blob->plain view, not
blob->head view. I.e. the view has the hash of the file as listed
by git-ls-tree, not just "HEAD".
Signed-off-by: Luben Tuikov <ltuikov@yahoo.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
diff: do not use configuration magic at the core-level
The Porcelainish has become so much usable as the UI that there
is not much reason people should be using the core programs by
hand anymore. At this point we are better off making the
behaviour of the core programs predictable by keeping them
unaffected by the configuration variables. Otherwise they will
become very hard to use as reliable building blocks.
For example, "git-commit -a" internally uses git-diff-files to
figure out the set of paths that need to be updated in the
index, and we should never allow diff.renames that happens to be
in the configuration to interfere (or slow down the process).
The UI level configuration such as showing renamed diff and
coloring are still honored by the Porcelainish ("git log" family
and "git diff"), but not by the core anymore.
Even if the standard output is connected to a tty, do not
colorize the diff if we are talking to a dumb terminal when
diff.color configuration variable is set to "auto".
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>
* ew/instaweb:
instaweb: fix unportable ';' usage in sed
Makefile: replace ugly and unportable sed invocation
Add git-instaweb, instantly browse the working repo with gitweb
gitweb: Declare global variables with "our"
gitweb: Enable tree (directory) history display
gitweb: optimize per-file history generation
mailinfo: assume input is latin-1 on the header as we do for the body
When the input mbox does not identify what encoding it is in,
and already have RFC2047 stripped away, we cannot tell what
encoding the header text is in. For body text, when the message
does not say what charset it is in, we fall back to assume
latin-1 input when converting to utf8. This should be done
consistently to the header as well.
git-reset: complain and exit upon seeing an unknown parameter.
The check to use "rev-parse --verify" was defeated by the use of
"--default HEAD". "git reset --hard bogus-committish" just
defaulted to reset to the HEAD without complaining.
This extends the behaviour of git-grep when multiple -e options
are given. So far, we allowed multiple -e to behave just like
regular grep with multiple -e, i.e. the patterns are OR'ed
together.
With this change, you can also have multiple patterns AND'ed
together, or form boolean expressions, like this (the
parentheses are quoted from the shell in this example):
* jc/sha1:
A better-scheduled PPC SHA-1 implementation.
test-sha1: test hashing large buffer
Makefile: add framework to verify and bench sha1 implementations.
* 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 '--'
git-svn: avoid fetching files outside of the URL we're tracking
Thanks to Santi <sbejar@gmail.com> for the bug report and explanation:
> /path/to/repository/project/file
> /path/to/repository/project-2/file
<...>
> you end up with a project with the following files:
>
> file
> -2/file
This makes git-peek-remote able to basically do everything that
git-ls-remote does (but obviously just for the native protocol, so no
http[s]: or rsync: support).
The default behaviour is the same, but you can now give a mixture of
"--refs", "--tags" and "--heads" flags, where "--refs" forces
git-peek-remote to only show real refs (ie none of the fakey tag lookups,
but also not the special pseudo-refs like HEAD and MERGE_HEAD).
The "--tags" and "--heads" flags respectively limit the output to just
regular tags and heads, of course.
You can still also ask to limit them by name too.
You can combine the flags, so
git peek-remote --refs --tags .
will show all local _true_ tags, without the generated tag lookups
(compare the output without the "--refs" flag).
And "--tags --heads" will show both tags and heads, but will avoid (for
example) any special refs outside of the standard locations.
I'm also planning on adding a "--ignore-local" flag that allows us to ask
it to ignore any refs that we already have in the local tree, but that's
an independent thing.
All this is obviously gearing up to making "git fetch" cheaper.
Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>