When git clean is run from a subdirectory it should follow the normal
policy and only remove directories if they are passed in as a pathspec,
or -d is specified.
The fix is to send len which could be shorter than ent->len because we
have stripped the trailing '/' that read_directory adds. Additionaly
match_one() was modified to allow a name[] that is not NUL terminated.
This allows us to check if the name matched the pathspec exactly
instead of recursively.
Signed-off-by: Shawn Bohrer <shawn.bohrer@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This changes the search logic for describing a submodule from:
- annotated tag
- any tag
- tag on a subsequent commit
- commit id
to
- annotated tag
- any tag
- tag on a subsequent commit
- local or remote branch
- commit id
The change is describing with respect to a branch before falling
back to the commit id. By itself, git-submodule will maintain submodules
as headless checkouts without ever making a local branch. In
general, such heads can always be described relative to the remote branch
regardless of existence of tags, and so provides a better fallback
summary than just the commit id.
This requires inserting an extra describe step as --contains is
incompatible with --all, but the latter can be used with --always
to fall back to a commit ID. Also, --contains implies --tags, so the
latter is not needed.
Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
On startup, git-gui warns if there are many loose objects. It does so by
saying, e.g., that there are "approximately 768 loose objects". But isn't
"768" a very accurate number? Lets say "750", which (while still being a
very precise number) sounds much more like an estimation.
Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
The earlier one botched the return value logic between config_bool and
config_bool_and_int. The former should normalize between 0 and 1 while
the latter should give back full range of integer values.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit teaches 'git commit/status' show a new 'Modified submodules'
section, which is an output from:
git submodule summary --cached --for-status --summary-limit <limit>
just before the 'Untracked files' section.
The <limit> is given by the config variable status.submodulesummary
to limit the submodule summary size. status.submodulesummary is a
bool/int variable with value:
- false or 0 by default to disable the summary, or
- positive number to limit the summary size, or
- true or negative number to unlimit the summary size.
Also mention status.submodulesummary in the documentation.
Signed-off-by: Ping Yin <pkufranky@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
The --for-status option is mainly used by builtin-status/commit.
It adds 'Modified submodules:' line at top and '# ' prefix to all
following lines.
Signed-off-by: Ping Yin <pkufranky@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This does not make any difference when running diff-files alone, but if
you internally run run_diff_files() and then run other operations further
on the index, we do not have to run lstat(2) again on entries we already
have checked.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
When writing the index out, we need to check the work tree again to see if
an entry whose timestamp indicates that it could be "racily clean", in
order to smudge it if it is stat-clean but with modified contents.
However, we can skip this step for entries marked with CE_UPTODATE,
which are known to be the really clean (i.e. the one we already have
checked when we prepared the index). This will reduce lstat(2) calls
necessary in git-status.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
These are the command line option equivalents of the 'merge.log' config
variable.
The patch also updates documentation and bash completion accordingly, and
adds a test.
Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
These are new synonyms to the '--(no-)summary' option and the
'merge.summary' config variable, but are consistent with the soon to be
added 'merge --(no-)log' options. The 'merge.summary' config variable and
'--(no-)summary' options are still accepted, but are advertised to be
removed in the future.
'merge.log' takes precedence over 'merge.summary' if they are both set
inconsistently.
Update documentation and tests accordingly.
Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This variable has the same effect, as 'merge.diffstat'.
Also mention it in the documentation.
Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This option has the same effect as '--(no-)summary' (i.e. whether to
show a diffsat at the end of the merge or not), and it is consistent
with the '--stat' option of other git commands.
Documentation, tests, and bash completion are updaed accordingly, and the
old --summary option is marked as being deprected.
Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Include the new file from config.txt and git-merge.txt.
Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
The script had an unconditional output done outside of test_expect_*
construct, which leaked out and contaminated the output without -v.
Squelch it.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This new function can be used by config parsers to tell if a variable
is simply set, set to 1, or set to "true".
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Also tighten test to require it to be correct.
Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
The previous one overwrote the variable used to report the bad input
when the input is actually bad, and we did not give a useful enough
information. This corrects it.
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
* maint:
bisect: fix bad rev checking in "git bisect good"
revision.c: make --date-order overriddable
git-submodule: Avoid 'fatal: cannot describe' message
Force the medium pretty format on calls to git log
Fix section about backdating tags in the git-tag docs
Document option --only of git commit
Documentation/git-request-pull: Fixed a typo ("send" -> "end")
* maint-1.5.4:
bisect: fix bad rev checking in "git bisect good"
revision.c: make --date-order overriddable
Fix section about backdating tags in the git-tag docs
Document option --only of git commit
Documentation/git-request-pull: Fixed a typo ("send" -> "end")
It seems that "git bisect good" and "git bisect skip" have never
properly checked arguments that have been passed to them. As soon
as one of them can be parsed as a SHA1, no error or warning would
be given.
This is because 'git rev-parse --revs-only --no-flags "$@"' always
"exit 0" and outputs all the SHA1 it can found from parsing "$@".
This patch fix this by using, for each "bisect good" argument, the
same logic as for the "bisect bad" argument.
While at it, this patch teaches "bisect bad" to give a meaningfull
error message when it is passed more than one argument.
Note that if "git bisect good" or "git bisect skip" is given some
proper revs and then something that is not a proper rev, then the
first proper revs will still have been marked as "good" or "skip".
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Users are not often aware of the fact that "git bisect -h" can give
them a long usage description, as "git bisect" seems to accept only
dashless subcommands like "start", "good", ...
That's why this patch adds a "git bisect help" subcommand that just
calls "git bisect -h". This new subcommand is also fully documented
in the short usage string (that "git bisect" gives), in the long
usage string and in the man page (that "git help bisect" gives).
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jan Engelhardt noticed that while --topo-order can be overridden by a
subsequent --date-order, the reverse was not possible. That's because
setup_revisions() failed to set revs->lifo properly.
Signed-off-by: Michele Ballabio <barra_cuda@katamail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
When "git submodule status" command tries to show the name of the
submodule HEAD revision more descriptively, but the submodule
repository lacked a suitable tag to do so, it leaked "fatal: cannot
describe" message to the UI. Squelch it by using '--always'.
Signed-off-by: Ping Yin <pkufranky@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
If a user has customized format.pretty in config, git-svn rebase fails with:
Unable to determine upstream SVN information from working tree history
because the command expects to read the commit log in the default format.
This fixes the command to explicitly ask for the format it wants to read
from.
Signed-off-by: Pedro Melo <melo@simplicidade.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
The tagger is equal to the committer, not the author, so
GIT_COMMITTER_DATE is the right environment variable to use, not
GIT_AUTHOR_DATE.
Signed-off-by: Björn Steinbrink <B.Steinbrink@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Its documentation was removed by 6c96753 (Documentation/git-commit: rewrite
to make it more end-user friendly, 2006-12-08), even though it is referenced
from a few places, including builtin-commit.c (as part of the commentary in
the commit message template).
Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This attached patch introduces a single bit "use_terminator" in "struct
rev_info", which is normally false (i.e. most formats use separator
semantics) but by flipping it to true, you can ask for terminator
semantics just like oneline format does.
The function get_commit_format(), which is what parses "--pretty=" option,
now takes a pointer to "struct rev_info" and updates its commit_format and
use_terminator fields. It used to return the value of type "enum
cmit_fmt", but all the callers assigned it to rev->commit_format.
There are only two cases the code turns use_terminator on. Obviously, the
traditional oneline format (--pretty=oneline) is one of them, and the new
case is --pretty=tformat:... that acts like --pretty=format:... but flips
the bit on.
With this, "--pretty=tformat:%H %s" acts like --pretty=oneline.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Many other commands use the "no arguments" form to show a
list (e.g., git-branch, git-tag). While we did show all
remotes for just "git remote", we displayed a usage error
for "git remote show" with no arguments. This is
counterintuitive, since by giving it _more_ information, we
get _less_ result.
The usage model can now be thought of as:
- "git remote show <remote>": show a remote
- "git remote show": show all remotes
- "git remote": assume "show"; i.e., shorthand for "git remote show"
Signed-off-by: Jeff King <peff@peff.net>
Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Previously, a fetch like:
git fetch git://some/url
would show no ref status output (just the object downloading
status, if there was any), leading to some confusion.
With this patch, we now show the usual ref table, with
remote refs going into FETCH_HEAD. Previously this output
was shown only if "-v"erbose was specified.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
* maint:
git-fetch: fix status output when not storing tracking ref
core-tutorial.txt: Fix showing the current behaviour.
git-archive: ignore prefix when checking file attribute
Fix documentation syntax of optional arguments in short options.
There was code in update_local_ref for handling this case,
but it never actually got called. It assumed that storing in
FETCH_HEAD meant a blank peer_ref name, but we actually have
a NULL peer_ref in this case, so we never even made it to
the update_local_ref function.
On top of that, the display formatting was different from
all of the other cases, probably owing to the fact that
nobody had ever actually seen the output.
This patch harmonizes the output with the other cases and
moves the detection of this case into store_updated_refs,
where we can actually trigger it.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
* maint-1.5.4:
core-tutorial.txt: Fix showing the current behaviour.
git-archive: ignore prefix when checking file attribute
Fix documentation syntax of optional arguments in short options.
The --root option from "git diff-tree" won't do nothing
when is given to commands like git-whatchanged or git-log,
because those always print the initial commit by default.
This fixes the tutorial explaining the function of the
log.showroot configuration variable.
Signed-off-by: Carlos Rica <jasampler@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Ulrik Sverdrup noticed that git-archive doesn't correctly apply the attribute
export-subst when the option --prefix is given, too.
When it checked if a file has the attribute turned on, git-archive would try
to look up the full path -- including the prefix -- in .gitattributes. That's
wrong, as the prefix doesn't need to have any relation to any existing
directories, tracked or not.
This patch makes git-archive ignore the prefix when looking up if value of the
attribute export-subst for a file.
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
When an argument for an option is optional, like in -n from git-tag,
puting a space between the option and the argument is interpreted
as a missing argument for the option plus an isolated argument.
Documentation now reflects the need to write the parameter following
the option -n, as in "git tag -nARG", for instance.
Signed-off-by: Carlos Rica <jasampler@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
It disables git-gc --auto when you are running Linux and you are
not on AC.
Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
If such a hook is available and exits with a non-zero status, then
git-gc --auto won't run.
Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
If we pick 'mi' between 'lo' and 'hi' at 50%, which was what the
simple binary search did, we are halving the search space
whether the entry at 'mi' is lower or higher than the target.
The previous patch was about picking not the middle but closer
to 'hi', when we know the target is a lot closer to 'hi' than it
is to 'lo'. However, if it turns out that the entry at 'mi' is
higher than the target, we would end up reducing the search
space only by the difference between 'mi' and 'hi' (which by
definition is less than 50% --- that was the whole point of not
using the simple binary search), which made the search less
efficient. And the risk of overshooting becomes very high, if
we try to be too precise.
This tweaks the selection of 'mi' to be a bit closer to the
middle than we would otherwise pick to avoid the problem.
Signed-off-by: Junio C Hamano <gitster@pobox.com>