The lockfile API is a handy way to obtain a file that is cleaned
up if you die(). But sometimes you would need this sequence to
work:
1. hold_lock_file_for_update() to get a file descriptor for
writing;
2. write the contents out, without being able to decide if the
results should be committed or rolled back;
3. do something else that makes the decision --- and this
"something else" needs the lockfile not to have an open file
descriptor for writing (e.g. Windows do not want a open file
to be renamed);
4. call commit_lock_file() or rollback_lock_file() as
appropriately.
This adds close_lock_file() you can call between step 2 and 3 in
the above sequence.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
We have nice set of placeholders, but nobody stepped in to fill
the gap in the API documentation, so I am doing it myself.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
rerere.enabled is _not_ on by default. The command is enabled if rr-cache
exists even when rerere.enabled is missing, and enabled or disabled by
explicitly setting the rerere.enabled variable.
This documents the default values of gc.auto, gc.autopacklimit
fetch.unpacklimit, receive.unpacklimit and transfer.unpacklimit.
Signed-off-by: Michele Ballabio <barra_cuda@katamail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
56752391a8 (Make "git gc" pack all
refs by default) changed the default of gc.packrefs to true, to
pack all refs by default in any repository. IOW, the users need
to disable it explicitly if they want to by setting the config
variable, since 1.5.3.
However, we forgot to update the documentation. This fixes it.
Signed-off-by: Florian La Roche <laroche@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
There are two possible confusions with the color.interactive
description:
1. the short name "interactive" implies that it covers all
interactive commands; let's explicitly make it so, even
though there are no other interactive commands which
currently use it
2. Not all parts of "git add --interactive" are controlled
by color.interactive (specifically, the diffs require
tweaking color.diff). So let's clarify that it applies
only to displays and prompts.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Between AsciiDoc 8.2.2 and 8.2.3, the following change was made to the stock
Asciidoc configuration:
@@ -149,7 +153,10 @@
# Inline macros.
# Backslash prefix required for escape processing.
# (?s) re flag for line spanning.
-(?su)[\\]?(?P<name>\w(\w|-)*?):(?P<target>\S*?)(\[(?P<attrlist>.*?)\])=
+
+# Explicit so they can be nested.
+(?su)[\\]?(?P<name>(http|https|ftp|file|mailto|callto|image|link)):(?P<target>\S*?)(\[(?P<attrlist>.*?)\])=
+
# Anchor: [[[id]]]. Bibliographic anchor.
(?su)[\\]?\[\[\[(?P<attrlist>[\w][\w-]*?)\]\]\]=anchor3
# Anchor: [[id,xreflabel]]
This default regex now matches explicit values, and unfortunately in this
case gitlink was being matched by just 'link', causing the wrong inline
macro template to be applied. By renaming the macro, we can avoid being
matched by the wrong regex.
Signed-off-by: Dan McGee <dpmcgee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
The plumbing level can understand that the user meant
"refs/heads/master" when the user says "master" or
"heads/master", but there is no easy way for the scripts to
figure it out without duplicating the dwim_ref() logic.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
These 2 functions were missing from the manpage.
Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Although everybody was quiet during the Christmas holiday, it's been
a week since -rc1, so here is -rc2.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
* ar/commit-cleanup:
Allow selection of different cleanup modes for commit messages
builtin-commit: avoid double-negation in the code.
builtin-commit: fix amending of the initial commit
t7005: do not exit inside test.
We wanted to have a list in which one (and the sole, as it happen to
be) item in it is ".mailmap", but do not seem to be able to convince
AsciiDoc to format it correctly for manpages. Reformat it into a
paragraph that describes the said file to work around the issue.
Signed-off-by: Gustaf Hendeby <hendeby@isy.liu.se>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Although we traditionally stripped away excess blank lines, trailing
whitespaces and lines that begin with "#" from the commit log message,
sometimes the message just has to be the way user wants it.
For instance, a commit message template can contain lines that begin with
"#", the message must be kept as close to its original source as possible
if you are converting from a foreign SCM, or maybe the message has a shell
script including its comments for future reference.
The cleanup modes are default, verbatim, whitespace and strip. The
default mode depends on if the message is being edited and will either
strip whitespace and comments (if editor active) or just strip the
whitespace (for where the message is given explicitely).
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This page should hold every information about the git ways to parse command
lines, and best practices to be used for scripting.
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
In everyday tasks, "repack -a -d -f" won't be used, so there
is not much point mentioning "repack". By showing the --prune
option to "gc", we can do without mentioning "git prune", too.
Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Mostly typo and small grammatical fixes with one or two rewordings for
clarity. But note the important fix for status.relativepaths.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git shell became much more powerful for existing CVS setups.
We should not hide from those people who only read release
notes.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
With the new options "--src-prefix=<prefix>", "--dst-prefix=<prefix>"
and "--no-prefix", you can now control the path prefixes of the diff
machinery. These used to by hardwired to "a/" for the source prefix
and "b/" for the destination prefix.
Initial patch by Pascal Obry. Sane option names suggested by Linus.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
There was no documentation for the config variables diff.external
and mergetool.<tool>.path.
Noticed by Sebastian Schuberth.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Now that 'git peek-remote' is deprecated and only an alias for
'git ls-remote', it should not be referenced from other manual pages.
This also removes the description of the --exec option, which is no
longer present.
Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
The convention for helper scripts has been
git-$TOOL--$HELPER. Since this is a "browse" helper for the
"help" tool, git-help--browse is a more sensible name.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Most of them are still stubs, but the procedure to build the HTML
documentation, maintaining the index and installing the end product are
there.
I placed names of people who are likely to know the most about the topic
in the stub files, so that volunteers will know whom to ask questions as
needed.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
The command was removed from the builtin command list and there was no
way to invoke it, but the code was still there.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This config variable makes it possible to choose the default format
used to display help. This format will be used only if no option
like -a|--all|-i|--info|-m|--man|-w|--web is passed to "git-help".
The following values are possible for this variable:
- "man" --> "man" program is used
- "info" --> "info" program is used
- "web" --> "git-browse-help" is used
By default we still show help using "man".
This patch also adds -m|--man command line option to use "man"
to allow overriding the "help.format" configuration variable.
Note that this patch also revert some recent changes in
"git-browse-help" because they prevented to look for config
variables in the global configuration file.
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
* wc/diff:
Test interaction between diff --check and --exit-code
Use shorter error messages for whitespace problems
Add tests for "git diff --check" with core.whitespace options
Make "diff --check" output match "git apply"
Unify whitespace checking
diff --check: minor fixups
"diff --check" should affect exit status
Lifted from the log message of c553ca25bd
(pack-objects: learn about pack index version 2).
Acked-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
"git diff" has a --check option that can be used to check for whitespace
problems but it only reported by printing warnings to the
console.
Now when the --check option is used we give a non-zero exit status,
making "git diff --check" nicer to use in scripts and hooks.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Shawn Bohrer <shawn.bohrer@gmail.com>
Acked-by: J. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
* cc/help:
RPM spec: Adjust htmldir
git-help -w: do not require to be in git repository
git.spec.in: remove python_path
Documentation: rename git.texi to user-manual.texi
Add git-browse-help to .gitignore
git-help -i: show info documentation from matching version of git
git-help -i: invoke info with document and node name
Documentation: add gitman.info target
Documentation: describe -w/--web option to "git-help".
Use {web,instaweb,help}.browser config options.
git-help: add -w|--web option to display html man page in a browser.
Documentation: describe -i/--info option to "git-help"
git-help: add -i|--info option to display info page.
* jc/shortlog-e:
shortlog: default to HEAD when the standard input is a tty
Invert numbers and names in the git-shortlog summary mode.
shortlog: document -e option
git-shortlog -e: show e-mail address as well
The "-z" format is all about machine parsability, but showing renamed
paths as "common/{a => b}/suffix" makes it impossible. The scripts would
never have successfully parsed "--numstat -z -M" in the old format.
This fixes the output format in a (hopefully minimally) backward
incompatible way.
* The output without -z is not changed. This has given a good way for
humans to view added and deleted lines separately, and showing the
path in combined, shorter way would preserve readability.
* The output with -z is unchanged for paths that do not involve renames.
Existing scripts that do not pass -M/-C are not affected at all.
* The output with -z for a renamed path is shown in a format that can
easily be distinguished from an unrenamed path.
This is based on Jakub Narebski's patch. Bugs and documentation typos
are mine.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
For consistency, change "white space" and "whitespaces" to
"whitespace", fixing a couple of adjacent grammar problems in the
docs.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
An item in a bulletted list in AsciiDoc is followed with two colons,
not just one.
Signed-off-by: Eyvind Bernhardsen <eyvind-git@orakel.ntnu.no>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
The tip about speeding up subsequent operations is now
obsolete; since aecbf914, git-diff now squelches empty diffs
and performs an automatic refresh.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
* jc/spht:
Use gitattributes to define per-path whitespace rule
core.whitespace: documentation updates.
builtin-apply: teach whitespace_rules
builtin-apply: rename "whitespace" variables and fix styles
core.whitespace: add test for diff whitespace error highlighting
git-diff: complain about >=8 consecutive spaces in initial indent
War on whitespace: first, a bit of retreat.
Conflicts:
cache.h
config.c
diff.c
Also explain that "git instaweb" may use "web.browser" config
variable.
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Now when using "git help -w cmd", we will try to show the HTML man
page "git-cmd.html" in your prefered web browser.
To do that "help.c" code will call a new shell script
"git-browse-help".
This currently works only if the HTML versions of the man page
have been installed in $(htmldir) (typically "/usr/share/doc/git-doc"),
so new target to do that is added to "Documentation/Makefile".
The browser to use can be configured using the "web.browser"
config variable.
We try to open a new tab in an existing web browser, if possible.
The code in "git-browse-help" is heavily stolen from "git-mergetool"
by Theodore Y. Ts'o. Thanks.
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
The documentation for the --no-verify switch should mention the
commit-msg hook, not just the pre-commit hook.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This patch is the result of reading over git-status with an
editorial eye:
- fix a few typo/grammatical errors
- mention untracked output
- present output types in the order they appear from the
command
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
The output of git-status was recently changed to output relative
paths. Setting this variable to false restores the old behavior for
any old-timers that prefer it.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This teaches "git bisect visualize" to be more useful in non-windowed
environments.
(1) When no option is given, and $DISPLAY is set, it continues to
spawn gitk as before;
(2) When no option is given, and $DISPLAY is unset, "git log" is run
to show the range of commits between the bad one and the good ones;
(3) If only "-flag" options are given, "git log <options>" is run.
E.g. "git bisect visualize --stat"
(4) Otherwise, all of the given options are taken as the initial part
of the command line and the commit range expression is given to
that command. E.g. "git bisect visualize tig" will run "tig"
history viewer to show between the bad one and the good ones.
As "visualize" is a bit too long to type, we also give it a shorter
synonym "view".
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Consistently with all other diff oriented commands, we have given paths
relative to the work tree root in git-status output for a long time.
This documents the recent behaviour change, as people's eyes (and worse
yet, scripts, although scripts should not parse "git status" output) may
depend on the old behaviour.
In the longer run, giving a --full-name option to git-diff Porcelain
similar to what ls-files has, and change the default for git-diff
Porcelain to show relative paths may be a good thing to do, in order to
hide the oddballness of this git-status behaviour, but that would have a
rather large impact to established expectation by existing users.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
The `core.whitespace` configuration variable allows you to define what
`diff` and `apply` should consider whitespace errors for all paths in
the project (See gitlink:git-config[1]). This attribute gives you finer
control per path.
For example, if you have these in the .gitattributes:
frotz whitespace
nitfol -whitespace
xyzzy whitespace=-trailing
all types of whitespace problems known to git are noticed in path 'frotz'
(i.e. diff shows them in diff.whitespace color, and apply warns about
them), no whitespace problem is noticed in path 'nitfol', and the
default types of whitespace problems except "trailing whitespace" are
noticed for path 'xyzzy'. A project with mixed Python and C might want
to have:
*.c whitespace
*.py whitespace=-indent-with-non-tab
in its toplevel .gitattributes file.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This is mostly lifted from earlier series by Dan Zwell, but updated to
use "git config --get-color" and "git config --get-colorbool" to make it
simpler and more consistent with commands written in C.
A new configuration color.interactive variable is like color.diff and
color.status, and controls if "git-add -i" uses color.
A set of configuration variables, color.interactive.<slot>, are used to
define what color is used for the prompt, header, and help text.
For perl scripts, Git.pm provides $repo->get_color() method, which takes
the slot name and the default color, and returns the terminal escape
sequence to color the output text. $repo->get_colorbool() method can be
used to check if color is set to be used for a given operation.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This adds an option to help scripts find out color settings from
the configuration file.
git config --get-colorbool color.diff
inspects color.diff variable, and exits with status 0 (i.e. success) if
color is to be used. It exits with status 1 otherwise.
If a script wants "true"/"false" answer to the standard output of the
command, it can pass an additional boolean parameter to its command
line, telling if its standard output is a terminal, like this:
git config --get-colorbool color.diff true
When called like this, the command outputs "true" to its standard output
if color is to be used (i.e. "color.diff" says "always", "auto", or
"true"), and "false" otherwise.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
* wc/add-i:
git-add -i: add help text for list-and-choose UI
add -i: allow prefix highlighting for "Add untracked" as well.
Highlight keyboard shortcuts in git-add--interactive
Document all help keys in "git add -i" patch mode.
Add "--patch" option to git-add--interactive
add -i: Fix running from a subdirectory
builtin-add: fix command line building to call interactive
git-add -i: allow multiple selection in patch subcommand
Add path-limiting to git-add--interactive
Teach builtin-add to pass multiple paths to git-add--interactive
* sp/refspec-match:
refactor fetch's ref matching to use refname_match()
push: use same rules as git-rev-parse to resolve refspecs
add refname_match()
push: support pushing HEAD to real branch name
Makefile uses $(PERL_PATH) but Documentation/Makefile uses "perl"; that
means the two Makefiles can use two different Perl installations.
Teach Documentation/Makefile to use PERL_PATH that is exported from the
toplevel Makefile, and give a sane fallback for people who run "make"
from Documentation directory.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
The name 'verbatim' describes much better what this mode does with
signed tags. While at it, fix the documentation what it actually
does.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
As well as allowing a default http.proxy option, allow it to be set
per-remote.
Signed-off-by: Sam Vilain <sam.vilain@catalyst.net.nz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Option -i|--info for "git-help" is documented only in the new
"git-help.txt" man page, but this new man page is referenced
from the "--help" option documentation in the "git.txt" man page.
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>