"unpack-file -h" could be asking to save the contents of a blob
named "-h". Strictly speaking, such a pathological ref name is
possible, but the user would have to had said something like
"tags/-h" to name such a pathological ref already. When used in
scripts, unpack-file is typically not passed a user-supplied tag
name directly.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Let "git fast-import -h" (with no other arguments) print usage
before exiting, even when run outside any repository.
Cc: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This only changes the behavior of "git check-ref-format -h"
without any other options and arguments.
This change cannot be breaking backward compatibility, since any
valid refname must contain a /. Most existing scripts use
arguments such as "heads/$foo". If some script checks the
refname "-h" alone, git check-ref-format will still exit with
nonzero status, and the only detrimental side-effect will be a
usage string sent to stderr.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
According to c6dfb39 (remote-curl: add missing initialization of
argv0_path, 2009-10-13), programs with "main" must call this to
work correctly on MinGW.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Builtins do not need to run setup_worktree() for themselves, since
the builtin machinery runs it for them.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
'git check-ref-format' has learned --branch and --print options
since the usage string was last updated.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This only changes the behavior of "git show-ref -h" without any
other options and arguments.
"show-ref -h" currently is short for "show-ref --head", which
shows all the refs/* and HEAD, as opposed to "show-ref" that
shows all the refs/* and not HEAD.
Does anybody use "show-ref -h"? It was in Linus's original, most
likely only because "it might be handy", not because "the command
should not show the HEAD by default for such and such reasons".
So I think it is okay if "show-ref -h" (but not "show-ref
--head") gives help and exits.
If a current script uses "git show-ref -h" without any other
arguments, it would have to be adapted by changing "-h" to
"--head".
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This change is strictly about 'git merge-ours -h' without
any other options and arguments.
This change cannot break compatibility since merge drivers are
always passed '--', among other arguments.
Any usage string for this command is a lie, since it ignored its
arguments until now. Still, it makes sense to let the user know
the expected usage when asked.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Treat an "-h" option as a request for help, rather than a "Not a
valid object name" error.
"commit-tree -h" could be asking to create a new commit from a
treeish named "-h". Strictly speaking, such a pathological ref
name is possible, but the user would have to had said something
like "tags/-h" to name such a pathological already. commit-tree
is usually used in scripts with raw object ids, anyway.
For consistency, the "-h" option uses its new meaning even if
followed by other arguments.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Treat an "-h" option as a request for help, rather than an
"Unknown commit -h" error.
"cherry -h" could be asking to compare histories that leads to
our HEAD and a commit that can be named as "-h". Strictly
speaking, that may be a valid refname, but the user would have to
say something like "tags/-h" to name such a pathological ref
already, so it is not such a big deal.
The "-h" option keeps its meaning even if preceded by other
options or followed by other arguments. This keeps the
command-line syntax closer to what parse_options would give and
supports shell aliases like 'alias cherry="git cherry -v"' a
little better.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Clarification: the following description only talks about "git
grep -h" without any other options and arguments.
Such a change cannot be breaking backward compatibility. "grep
-h" cannot be asking for suppressing filenames, as there is no
match pattern specified.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
When git-fetch was builtin-ized, the previous script was moved to
contrib/examples. Now, it is the sole remaining user for
'git fetch--tool'.
The fetch--tool code is still worth keeping around so people can
try out the old git-fetch.sh, for example when investigating
regressions from the builtinifaction.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Temporaries such as configure.ac+ and Documentation/*.xml+
sometimes remain after an interrupted build. Tell git not to
track them.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
"commit -s" used to add an empty line before adding S-o-b line only when
the last line of the existing log message is not another S-o-b line, but
c1e01b0 (commit: More generous accepting of RFC-2822 footer lines.,
2009-10-28) introduced logic to omit this empty line when the message ends
with a run of "footer" lines, to cover S-o-b's friends, e.g. Acked-by.
However, the logic was overzealous and missed one corner case. A message
that consists of a single line that begins with Token + colon, it can be
mistaken as a S-o-b's friend. We do want an empty line in such a case.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Let's keep thread stuff close together if possible. And in this case,
this even reduces the #ifdef noise, and allows for skipping the
autodetection altogether if delta search is not needed (like with a pure
clone).
Signed-off-by: Nicolas Pitre <nico@fluxnic.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Introduced in 492cf3f (More precise description of 'git describe --abbrev', 2009-10-29)
Signed-off-by: Gisle Aas <gisle@aas.no>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
It's okay to use the curl helper without a local repository, so long
as you don't use "fetch". There aren't any git programs that would try
to use it, and it doesn't make sense to try it (since there's nowhere
to write the results), but we may as well be clear.
Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
cmd_ls_remote() was calling transport_get() with a NULL remote and a
non-NULL url in the case where it was run outside a git
repository. This involved a bunch of ill-tested special
cases. Instead, simply get the struct remote for the URL with
remote_get(), which works fine outside a git repository, and can also
take global options into account.
This fixes a tiny and obscure bug where "git ls-remote" without a repo
didn't support global url.*.insteadOf, even though "git clone" and
"git ls-remote" in any repo did.
Also, enforce that all callers provide a struct remote to transport_get().
Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Starting with commit 51ea55190b,
git-compat-util.h includes compat/bswap.h
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This reverts commit 0cc5691a8b.
There is not enough justification for doing this. We do not update
things in .git/branches and .git/remotes anymore, but still do read
information from there and will keep doing so.
Besides, this breaks quite a lot of tests in t55?? series.
* ja/fetch-doc:
Documentation/merge-options.txt: order options in alphabetical groups
Documentation/git-pull.txt: Add subtitles above included option files
Documentation/fetch-options.txt: order options alphabetically
If git clone is given more than two non-option arguments, it
silently throws away all but the first one. Complain instead.
Discovered by comparing the new builtin clone to the old
git-clone.sh.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Fix incorrect description of --recursive, and stop listing the historical
synonym --naked that is not advertised anywhere.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Because --root can put our trash directories elsewhere,
using ".." may not always work.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
so that they can be run individually as
(cd t && ./t9150-svk-mergetickets.sh)
etc. just like all other test scripts.
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>