Commit graph

21390 commits

Author SHA1 Message Date
Jeff King 003c6abdb2 dwim_ref: fix dangling symref warning
If we encounter a symref that is dangling, in most cases we will warn
about it. The one exception is a dangling HEAD, as that indicates a
branch yet to be born.

However, the check in dwim_ref was not quite right. If we were fed
something like "HEAD^0" we would try to resolve "HEAD", see that it is
dangling, and then check whether the _original_ string we got was
"HEAD" (which it wasn't in this case). And that makes no sense; the
dangling thing we found was not "HEAD^0" but rather "HEAD".

Fixing this squelches a scary warning from "submodule summary HEAD" (and
consequently "git status" with status.submodulesummary set) in an empty
repo, as the submodule script calls "git rev-parse -q --verify HEAD^0".

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-16 09:03:58 -08:00
Larry D'Anna 6977c250ac git diff --quiet -w: check and report the status
The option -w tells the diff machinery to inspect the contents to set the
exit status, instead of checking the blob object level difference alone.
However, --quiet tells the diff machinery not to look at the contents, which
means DIFF_FROM_CONTENTS has no chance to inspect the change.

Work it around by calling diff_flush_patch() with output sent to /dev/null.

Signed-off-by: Larry D'Anna <larry@elder-gods.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-15 23:04:34 -08:00
Thomas Rast 460ccd0e19 stash pop: remove 'apply' options during 'drop' invocation
The 'git stash pop' option parsing used to remove the first argument
in --index mode.  At the time this was implemented, this first
argument was always --index.  However, since the invention of the -q
option in fcdd0e9 (stash: teach quiet option, 2009-06-17) you can
cause an internal invocation of

  git stash drop --index

by running

  git stash pop -q --index

which then of course fails because drop doesn't know --index.

To handle this, instead let 'git stash apply' decide what the future
argument to 'drop' should be.

Warning: this means that 'git stash apply' must parse all options that
'drop' can take, and deal with them in the same way.  This is
currently true for its only option -q.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Acked-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-15 21:46:27 -08:00
Larry D'Anna 8324b977ae diff: make sure --output=/bad/path is caught
The return value from fopen wasn't being checked.

Signed-off-by: Larry D'Anna <larry@elder-gods.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-15 21:46:01 -08:00
Pete Harlan 7283bbc70a Remove hyphen from "git-command" in two error messages
Signed-off-by: Pete Harlan <pgit@pcharlan.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-15 18:20:54 -08:00
Jonathan Nieder f6dff119d5 am: Fix launching of pager
The pagination functionality in git am has some problems:

 - It does not check if stdout is a tty, so it always paginates.

 - If $GIT_PAGER uses any environment variables, they are being
   ignored, since it does not run $GIT_PAGER through eval.

 - If $GIT_PAGER is set to the empty string, instead of passing
   output through to stdout, it tries to run $dotest/patch.

Fix them.  While at it, move the definition of git_pager() to
git-sh-setup so authors of other commands are not tempted to
reimplement it with the same mistakes.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-14 22:05:17 -08:00
Junio C Hamano b599672316 Merge branch 'maint-1.6.6' into maint
* maint-1.6.6:
  fix minor memory leak in get_tree_entry()
2010-02-14 18:59:14 -08:00
Jakub Narebski e6e592db4c gitweb: Die if there are parsing errors in config file
Otherwise the errors can propagate, and show in damnest places, and
you would spend your time chasing ghosts instead of debugging real
problem (yes, it is from personal experience).

This follows (parts of) advice in `perldoc -f do` documentation.

This required restructoring code a bit, so we die only if we are reading
(executing) config file.  As a side effect $GITWEB_CONFIG_SYSTEM is always
available, even when we use $GITWEB_CONFIG.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-14 18:50:22 -08:00
Jonathan Nieder 190c1cda7e git svn: Fix launching of pager
In commit dec543e (am -i, git-svn: use "git var GIT_PAGER"), I tried
to teach git svn to defer to git var on what pager to use. In the
process, I introduced two bugs:

 - The value set for $pager in config_pager has local scope, so
   run_pager never sees it;

 - git var cannot tell whether git svn’s output is going to a
   terminal, so the value chosen for $pager does not reflect that
   information.

Fix them.

Reported-by: Sebastian Celis <sebastian@sebastiancelis.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-14 18:23:17 -08:00
Jonathan Nieder 06300d9753 git.1: Clarify the behavior of the --paginate option
The --paginate option is meant to negate the effect of an explicit or
implicit pager.<cmd> = false setting.  Thus it turns the pager on if
output is going to a terminal rather than unconditionally.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-14 18:23:17 -08:00
Jonathan Nieder 64778d24a9 Make 'git var GIT_PAGER' always print the configured pager
Scripted commands that want to use git’s configured pager know better
than ‘git var’ does whether stdout is going to be a tty at the
appropriate time.  Checking isatty(1) as git_pager() does now won’t
cut it, since the output of git var itself is almost never a terminal.
The symptom is that when used by humans, ‘git var GIT_PAGER’ behaves
as it should, but when used by scripts, it always returns ‘cat’!

So avoid tricks with isatty() and just always print the configured
pager.

This does not fix the callers to check isatty(1) themselves yet.
Nevertheless, this patch alone is enough to fix 'am --interactive'.

Thanks to Sebastian Celis for the report and Jeff King for the
analysis.

Reported-by: Sebastian Celis <sebastian@sebastiancelis.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-14 18:23:17 -08:00
Jonathan Nieder 9fabb6d751 Fix 'git var' usage synopsis
The parameter to 'git var' is not optional.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-14 18:23:16 -08:00
René Scharfe ef0065034a fix minor memory leak in get_tree_entry()
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-14 03:04:20 -08:00
Junio C Hamano 9b25048318 Start 1.7.0 maintenance track
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-13 15:04:00 -08:00
Junio C Hamano e923eaeb90 Git 1.7.0
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-12 15:45:05 -08:00
Junio C Hamano ca5812d2e3 Merge branch 'maint'
* maint:
  Fix typo in 1.6.6.2 release notes
  Re-fix check-ref-format documentation mark-up
2010-02-12 15:40:59 -08:00
Junio C Hamano 341d9a48cc Fix typo in 1.6.6.2 release notes
Of course, these are changes since 1.6.6.1; changes since 1.6.6.2
would have been nil.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-12 15:40:01 -08:00
Junio C Hamano 8222153d84 Re-fix check-ref-format documentation mark-up
It is not double-backslash we forbid; backslashes are forbidden since
a4c2e699 (Disallow '\' in ref names, 2009-05-08)

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-12 15:39:03 -08:00
Hitoshi Mitake 67d176300c git-imap-send: Convert LF to CRLF before storing patch to draft box
When storing a message over IMAP (RFC 3501 6.3.11), the message should be
in the format of an RFC 2822 message; most notably, CRLF must be used as
a line terminator.

Convert "\n" line endings in the payload to CRLF before feeding it to
IMAP APPEND command.

Signed-off-by: Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-12 11:21:28 -08:00
Junio C Hamano 9b4c8b0ae8 archive documentation: attributes are taken from the tree by default
By default, git-archive takes attributes from the tree being archived.
People however often wonder why their attempts to affect the way how the
command archives their tree by changing .gitattributes in their work tree
fail.

Add a bit of explanatory note to tell them how to achieve what they want
to do.

Noticed-by: Francois Marier
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-12 09:38:20 -08:00
Michael J Gruber f937421702 Documentation: minor fixes to RelNotes-1.7.0
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-12 09:38:02 -08:00
SZEDER Gábor 85f6b439f2 bash: support 'git am's new '--continue' option
Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-12 09:08:17 -08:00
Junio C Hamano 618d18b5aa Merge branch 'maint'
* maint:
  filter-branch: Fix error message for --prune-empty --commit-filter
2010-02-11 23:06:32 -08:00
Jacob Helwig 5da8171370 filter-branch: Fix error message for --prune-empty --commit-filter
Running filter-branch with --prune-empty and --commit-filter reports:

  "Cannot set --prune-empty and --filter-commit at the same time".

Change it to use the correct option name: --commit-filter

Signed-off-by: Jacob Helwig <jacob.helwig@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-11 22:12:36 -08:00
Jeff King 4d128884fb cherry-pick: prettify the advice message
It's hard to see the "how to commit" part of this message,
which users may want to cut and paste. On top of that,
having it in paragraph form means that a really long commit
name may cause ugly wrapping. Let's make it prettier, like:

  Automatic cherry-pick failed.  After resolving the conflicts,
  mark the corrected paths with 'git add <paths>' or 'git rm <paths>'
  and commit the result with:

          git commit -c HEAD~23

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-11 22:11:12 -08:00
Jeff King 97915544f8 cherry-pick: show commit name instead of sha1
When we have a conflict, we advise the user to do:

  git commit -c $sha1

This works fine, but is unnecessarily confusing and annoying
for the user to type, when:

  git commit -c $the_thing_you_called_cherry_pick_with

works just as well.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-11 22:11:04 -08:00
Jeff King 08565bdb4b cherry-pick: format help message as strbuf
This gets rid of the fixed-size buffer and an unchecked
sprintf. That sprintf is actually OK as the only
variable-sized thing put in it is an abbreviated sha1, which
is bounded at 40 characters. However, the next patch will
change that to something unbounded.

Note that this function now returns an allocated buffer
instead of a static one; however, it doesn't matter as the
only caller exits immediately.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-11 22:11:03 -08:00
Jeff King dd9314cc2a cherry-pick: refactor commit parsing code
These lines are really just lookup_commit_reference
re-implemented.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-11 22:11:01 -08:00
Jeff King 6e359978e9 cherry-pick: rewrap advice message
The current message overflows on an 80-character terminal.
While we're at it, fix the spelling of 'committing'.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-11 22:10:57 -08:00
Jeff King c8089af6c6 am: switch --resolved to --continue
Rebase calls this same function "--continue", which means
users may be trained to type it. There is no reason to
deprecate --resolved (or -r), so we will keep it as a
synonym.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-11 22:10:00 -08:00
Junio C Hamano f476c0b7b3 Update draft release notes to 1.7.0 one more time
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-10 13:47:46 -08:00
Junio C Hamano d1672d90ba Sync with 1.6.6.2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-10 13:46:15 -08:00
Junio C Hamano 4133fd2552 Git 1.6.6.2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-10 13:44:11 -08:00
Junio C Hamano 216d2e0f3f Merge branch 'maint-1.6.5' into maint
* maint-1.6.5:
  t8003: check exit code of command and error message separately
2010-02-10 13:42:48 -08:00
Junio C Hamano 33f0ea42e1 t8003: check exit code of command and error message separately
Shell reports exit status only from the most downstream command
in a pipeline.  In these tests, we want to make sure that the
command fails in a controlled way, and produces a correct error
message.

This issue was known by Jay who submitted the patch, and also was
pointed out by Hannes during the review process, but I forgot to
fix it up before applying.  Sorry about that.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-10 13:42:29 -08:00
Junio C Hamano 57ffc0e775 Merge branch 'sp/maint-fast-import-large-blob' into maint
* sp/maint-fast-import-large-blob:
  fast-import: Stream very large blobs directly to pack
2010-02-10 13:32:20 -08:00
Junio C Hamano 800d1fb0ab Merge branch 'gp/maint-cvsserver' into maint
* gp/maint-cvsserver:
  git-cvsserver: allow regex metacharacters in CVSROOT
2010-02-10 13:02:52 -08:00
Junio C Hamano 410e99fadf Merge branch 'jc/maint-reflog-bad-timestamp' into maint
* jc/maint-reflog-bad-timestamp:
  t0101: use a fixed timestamp when searching in the reflog
  Update @{bogus.timestamp} fix not to die()
  approxidate_careful() reports errorneous date string
2010-02-10 13:02:43 -08:00
Junio C Hamano c329898abb Merge branch 'il/maint-xmallocz' into maint
* il/maint-xmallocz:
  Fix integer overflow in unpack_compressed_entry()
  Fix integer overflow in unpack_sha1_rest()
  Fix integer overflow in patch_delta()
  Add xmallocz()
2010-02-10 13:02:16 -08:00
Junio C Hamano b0e67fffb4 Merge branch 'jh/maint-config-file-prefix' into maint
* jh/maint-config-file-prefix:
  builtin-config: Fix crash when using "-f <relative path>" from non-root dir
2010-02-10 13:02:05 -08:00
Junio C Hamano 2e9d7330aa Merge branch 'nd/include-termios-for-osol' into maint
* nd/include-termios-for-osol:
  Add missing #include to support TIOCGWINSZ on Solaris
2010-02-10 13:01:55 -08:00
Junio C Hamano a42332c217 Merge branch 'jc/maint-1.6.1-checkout-m-custom-merge' into maint
* jc/maint-1.6.1-checkout-m-custom-merge:
  checkout -m path: fix recreating conflicts

Conflicts:
	t/t7201-co.sh
2010-02-10 12:54:15 -08:00
Junio C Hamano c6eba1d5b2 Merge branch 'rs/maint-archive-match-pathspec' into maint
* rs/maint-archive-match-pathspec:
  archive: complain about path specs that don't match anything
2010-02-10 12:52:39 -08:00
Junio C Hamano 8ff883029a check-ref-format documentation: fix enumeration mark-up
The last item in the enumerated refname rule was mistakenly made into
a sub-item of the 7th one.  It should be the 8th one in the list on its
own.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-10 10:19:13 -08:00
Thomas Rast 3c651491f2 Documentation: quote braces in {upstream} notation
The lack of quoting made the entire line disappear.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-10 10:01:43 -08:00
Shawn O. Pearce 466dbc42f5 receive-pack: Send internal errors over side-band #2
If the client has requested side-band-64k capability, send any
of the internal error or warning messages in the muxed side-band
stream using the same band as our hook output, band #2.  By putting
everything in one stream we ensure all messages are processed by
the side-band demuxer, avoiding interleaving between our own stderr
and the side-band demuxer's stderr buffers.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-10 09:51:07 -08:00
Shawn O. Pearce 6b3fa7e7d1 t5401: Use a bare repository for the remote peer
We want to avoid the warnings (or later, test failures) about
updating the current branch.  It was never my intention to have
this test deal with a repository with a working directory, and it
is a very old bug that the test even used a non-bare repository
for the remote side of the push operations.

This fixes the interleaved output error we were seeing as a test
failure by avoiding the giant warning message we were getting back
about updating the current branch being risky.

Its not a real fix, but is something we should do no matter what,
because the behavior will change in the future to reject, and the
test would break at that time.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-09 19:25:36 -08:00
Brian Gernhardt 8b2337a589 t3902: Protect against OS X normalization
8424981: "Fix invalid read in quote_c_style_counted" introduced a test
that used "caractère spécial" as a directory name.

Git creates it as "caract\303\250re sp\303\251cial"
OS X stores it as "caracte\314\200re spe\314\201cial"

To work around this problem, use the already introduced $FN as the
directory name.

Signed-off-by: Brian Gernhardt <brian@gernhardtsoftware.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-08 23:06:08 -08:00
Junio C Hamano 105a6339d8 Merge branch 'maint'
* maint:
  blame: prevent a segv when -L given start > EOF
  git-push: document all the status flags used in the output
  Fix parsing of imap.preformattedHTML and imap.sslverify
  git-add documentation: Fix shell quoting example
2010-02-08 21:54:10 -08:00
Junio C Hamano e33cc592de Merge branch 'maint-1.6.5' into maint
* maint-1.6.5:
  blame: prevent a segv when -L given start > EOF
2010-02-08 21:53:54 -08:00