gitweb: Fix utf8 encoding for blob_plain, blobdiff_plain, commitdiff_plain, and patch

Fixes the encoding for several _plain actions and for text/* and */*+xml blobs.

Signed-off-by: Jürgen Kreileder <jk@blackdown.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
gitweb: Make feed title valid utf8

Properly encode site and project names for RSS and Atom feeds.

Signed-off-by: Jürgen Kreileder <jk@blackdown.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
gitweb: Don't append ';js=(0|1)' to external links

Don't add js parameters to links outside of gitweb itself.

Signed-off-by: Jürgen Kreileder <jk@blackdown.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
gitweb: Fix broken blob action parameters on blob/commitdiff pages

Fix broken blob action parameters on blobdiff and commitdiff pages by
explicitly passing variables instead of relying on global ones.

(The broken parameters on blob links lead to blob pages which show the
blob but with a hash instead of a commit message and have broken
blob_plain (404 - Cannot find file) and tree links (404 - Reading tree
failed))

Signed-off-by: Jürgen Kreileder <jk@blackdown.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
format-patch: rename "no_inline" field

The name of the field invites a misunderstanding that setting it to
false, saying "No, I will not to tell you not to inline", may make
the patch inlined in the body of the message, but that is not what
it does.  The result is still added to the resulting message as a
MIME attachment as long as mime_boundary is set.  This field only
controls if the content disposition of the MIME attachment is set to
"attachment" or "inline".

Rename it to clarify what it is used for.  Besides, a toggle whose
name is "no_frotz" is asking for a double-negation.  Calling it
"disposition-attachment" allows us to naturally read that setting
the field to true to mean "Yes, I want to set content-disposition to
be 'attachment'".

Signed-off-by: Junio C Hamano <gitster@pobox.com>
format-patch: --inline-single

Some people may find it convenient to append a simple patch at the
bottom of a discussion e-mail separated by a "scissors" mark, ready
to be applied with "git am -c".  Introduce "--inline-single" option
to format-patch to do so.  A typical usage example might be to start
'f'ollow-up to a discussion, write your message, conclude with "a
patch to do so may look like this.", and then

    \C-u M-! git format-patch --inline-single -1 HEAD <ENTER>

if you are an Emacs user.  Users of other MUA's may want to consult
their manuals to find an equivalent command to append output from an
external command to the message being composed.

It does not make any sense to use this mode when formatting multiple
patches, or to combine this with options such as --attach, --inline,
and --cover-letter, so some of such uses are forbidden.  There may
be more insane combination the check in this patch may not even
bother to reject.  Caveat emptor.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
show-branch.c: update comment style

Signed-off-by: Junio C Hamano <gitster@pobox.com>
show-branch.c: lift all_mask/all_revs to a global static

Also make them and other flags unsigned.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
show-branch.c: abstract out "flags" operation

The current code knows how "flags" are used to record reachability
from each "rev" too much.  Move as much knowledge as possible out of
the main traversal logic about commit->object.flags by introducing
wrapper functions.  We still use the higher bits of flags word for
reachability from revs, but eventually we would want to only use the
UNINTERESTING bit to mark common ancestors we do not need to dig
further, and move per-rev bits into commit slabs.
show-branch.c: remove "all_mask"

It is only used at one place, to mask flags that is further masked
with all_revs, which is a proper subset of all_mask, so the use is a
no-op.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
show-branch: use commit slab to represent bitflags of arbitrary width

We still haven't lifted the total number of revs limit that is
hardcoded, but the underlying data structure can now represent
arbitrary number of refs.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
show-ref.c: Add missing call to git_config()

At present, 'git show-ref' ignores any attempt to set config
variables (e.g. core.checkstat) from the command line using
the -c option to git. In order to enable such usage, add the
missing call to git_config() from cmd_show_ref().

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
pack-refs.c: Add missing call to git_config()

At present, 'git pack-refs' ignores any attempt to set config
variables (e.g. core.checkstat) from the command line using
the -c option to git. In order to enable such usage, add the
missing call to git_config() from cmd_pack_refs().

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
### DONTMERGE: needs better explanation on what config they need
merge-recursive: remove dead conditional in update_stages()

650467c (merge-recursive: Consolidate different update_stages
functions, 2011-08-11) changed the former argument 'clear' to always
be true.  Remove the useless conditional.

Signed-off-by: Thomas Rast <trast@inf.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-send-email: add optional 'choices' parameter to the ask sub

Make it possible for callers of ask() to provide a list of
choices. Entering an appropriate integer chooses from that list,
otherwise the input is treated as usual.

Each choice can either be a single string, which is used both for the
prompt and for the return value, or a two-element array ref, where the
zeroth element is the choice and the first is used for the prompt.

Signed-off-by: Rasmus Villemoes <rv@rasmusvillemoes.dk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-send-email: Cache generated message-ids, use them when prompting

Allow the user to specify a file (sendemail.msgidcachefile) in which
to store the message-ids generated by git-send-email, along with time
and subject information. When prompting for a Message-ID to be used in
In-Reply-To, that file can be used to generate a list of options.

When composing v2 or v3 of a patch or patch series, this avoids the
need to get one's MUA to display the Message-ID of the earlier email
(which is cumbersome in some MUAs) and then copy-paste that.

Listing all previously sent emails is useless, so currently only the
10 most "relevant" emails. "Relevant" is based on a simple scoring,
which might need to be revised: Count the words in the old subject
which also appear in the subject of the first email to be sent; add a
bonus if the old email was first in a batch (that is, [00/74] is more
likely to be relevant than [43/74]). Resort to comparing timestamps
(newer is more relevant) when the scores tie.

To limit disk usage, the oldest half of the cached entries are
expunged when the cache file exceeds sendemail.msgidcachemaxsize
(default 100kB). This also ensures that we will never have to read,
score, and sort 1000s of entries on each invocation of git-send-email.

Signed-off-by: Rasmus Villemoes <rv@rasmusvillemoes.dk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
revision: introduce --exclude=<glob> to tame wildcards

People often find "git log --branches" etc. that includes _all_
branches is cumbersome to use when they want to grab most but except
some.  The same applies to --tags, --all and --glob.

Teach the revision machinery to remember patterns, and then upon the
next such a globbing option, exclude those that match the pattern.

With this, I can view only my integration branches (e.g. maint,
master, etc.) without topic branches, which are named after two
letters from primary authors' names, slash and topic name.

    git rev-list --no-walk --exclude=??/* --branches |
    git name-rev --refs refs/heads/* --stdin

This one shows things reachable from local and remote branches that
have not been merged to the integration branches.

    git log --remotes --branches --not --exclude=??/* --branches

It may be a bit rough around the edges, in that the pattern to give
the exclude option depends on what globbing option follows.  In
these examples, the pattern "??/*" is used, not "refs/heads/??/*",
because the globbing option that follows the -"-exclude=<pattern>"
is "--branches".  As each use of globbing option resets previously
set "--exclude", this may not be such a bad thing, though.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
perf-lib: split starting the test from the execution

Separate the execution part to make future changes to the tests simpler.

Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
perf-lib: add test_perf_cleanup target

Currently there is no way to clean up the changes that have been made
with test_perf for the next run.  Add a way to reset the repository to
the state before the test for testing commands that modify the git
repository, e.g. for perf testing git add.

Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>