Commit graph

9808 commits

Author SHA1 Message Date
Junio C Hamano f8f7adce9f Sync with maint
* maint:
  Some fixes for 2.9.3
2016-07-28 14:21:18 -07:00
Junio C Hamano 8213178c86 Eighth batch of topics for 2.10
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-07-28 14:20:48 -07:00
Junio C Hamano 0f3d855efc Merge branch 'master' of git://git.bogomips.org/git-svn
* 'master' of git://git.bogomips.org/git-svn:
  git-svn: allow --version to work anywhere
  git-svn: document svn.authorsProg in config
2016-07-28 13:13:53 -07:00
Junio C Hamano 08df31eecc Some fixes for 2.9.3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-07-28 11:28:32 -07:00
Junio C Hamano dcfb9d7d30 Merge branch 'nd/doc-new-command' into maint
Typofix in a doc.

* nd/doc-new-command:
  new-command.txt: correct the command description file
2016-07-28 11:25:57 -07:00
Junio C Hamano 1032eb9c2a Merge branch 'mm/doc-tt' into maint
More mark-up updates to typeset strings that are expected to
literally typed by the end user in fixed-width font.

* mm/doc-tt:
  doc: typeset HEAD and variants as literal
  CodingGuidelines: formatting HEAD in documentation
  doc: typeset long options with argument as literal
  doc: typeset '--' as literal
  doc: typeset long command-line options as literal
  doc: typeset short command-line options as literal
  Documentation/git-mv.txt: fix whitespace indentation
2016-07-28 11:25:54 -07:00
Junio C Hamano 2c608e0f7c Merge branch 'nd/worktree-lock'
"git worktree prune" protected worktrees that are marked as
"locked" by creating a file in a known location.  "git worktree"
command learned a dedicated command pair to create and remove such
a file, so that the users do not have to do this with editor.

* nd/worktree-lock:
  worktree.c: find_worktree() search by path suffix
  worktree: add "unlock" command
  worktree: add "lock" command
  worktree.c: add is_worktree_locked()
  worktree.c: add is_main_worktree()
  worktree.c: add find_worktree()
2016-07-28 10:34:42 -07:00
Junio C Hamano 442f6fd3d6 date: clarify --date=raw description
"... in the internal raw Git format `%s %z` format." was clunky in
repeating "format" twice, and would not have helped those who do not
immediately get that these are strftime(3) conversion specifiers.

Explain them with words, and demote the mention of `%s %z` to a
hint to help those who know them.

Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-07-27 14:15:51 -07:00
Jeff King 642833db78 date: add "unix" format
We already have "--date=raw", which is a Unix epoch
timestamp plus a contextual timezone (either the author's or
the local). But one may not care about the timezone and just
want the epoch timestamp by itself. It's not hard to parse
the two apart, but if you are using a pretty-print format,
you may want git to show the "finished" form that the user
will see.

We can accomodate this by adding a new date format, "unix",
which is basically "raw" without the timezone.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-07-27 14:15:51 -07:00
Jeff King 1a2a1e8eb9 date: document and test "raw-local" mode
The "raw" format shows a Unix epoch timestamp, but with a
timezone tacked on. The timestamp is not _in_ that zone, but
it is extra information about the time (by default, the zone
the author was in).

The documentation claims that "raw-local" does not work. It
does, but the end result is rather subtle. Let's describe it
in better detail, and test to make sure it works (namely,
the epoch time doesn't change, but the zone does).

While we are rewording the documentation in this area, let's
not use the phrase "does not work" for the remaining option,
"--date=relative". It's vague; do we accept it or not? We do
accept it, but it has no effect (which is a reasonable
outcome). We should also refer to the option not as
"--relative" (which is the historical synonym, and does not
take "-local" at all), but as "--date=relative".

Helped-by: Jakub Narębski <jnareb@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-07-27 14:15:50 -07:00
John Keeping eee98e74f9 push: add shorthand for --force-with-lease branch creation
Allow the empty string to stand in for the null SHA-1 when pushing a new
branch, like we do when deleting branches.

This means that the following command ensures that `new-branch` is
created on the remote (that is, is must not already exist):

	git push --force-with-lease=new-branch: origin new-branch

Signed-off-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-07-26 13:48:09 -07:00
John Keeping d132b32b4e Documentation/git-push: fix placeholder formatting
Format the placeholder as monospace to match other occurrences in this
file and obey CodingGuidelines.

Signed-off-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-07-25 15:21:32 -07:00
Junio C Hamano 8c6d1f9807 Seventh batch of topics for 2.10
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-07-25 14:17:28 -07:00
Junio C Hamano 9db3979784 Merge branch 'js/fsck-name-object'
When "git fsck" reports a broken link (e.g. a tree object contains
a blob that does not exist), both containing object and the object
that is referred to were reported with their 40-hex object names.
The command learned the "--name-objects" option to show the path to
the containing object from existing refs (e.g. "HEAD~24^2:file.txt").

* js/fsck-name-object:
  fsck: optionally show more helpful info for broken links
  fsck: give the error function a chance to see the fsck_options
  fsck_walk(): optionally name objects on the go
  fsck: refactor how to describe objects
2016-07-25 14:13:44 -07:00
Junio C Hamano c3531e0385 Merge branch 'jc/doc-diff-filter-exclude'
Belated doc update for a feature added in v1.8.5.

* jc/doc-diff-filter-exclude:
  diff: document diff-filter exclusion
2016-07-25 14:13:41 -07:00
Junio C Hamano 21bed620cd Merge branch 'jc/renormalize-merge-kill-safer-crlf'
"git merge" with renormalization did not work well with
merge-recursive, due to "safer crlf" conversion kicking in when it
shouldn't.

* jc/renormalize-merge-kill-safer-crlf:
  merge: avoid "safer crlf" during recording of merge results
  convert: unify the "auto" handling of CRLF
2016-07-25 14:13:39 -07:00
Jeff King d38c7b2c2c doc/pretty-formats: explain shortening of %gd
The actual shortening rules aren't that interesting and
probably not worth getting into (I gloss over them here as
"shortened for human readability"). But the fact that %gD
shows whatever you gave on the command line is subtle and
worth mentioning. Since most people will feed a shortened
refname in the first place, it otherwise makes it hard to
understand the difference between the two.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-07-22 13:47:33 -07:00
Jeff King 522259dc3a doc/pretty-formats: describe index/time formats for %gd
The "reflog selector" format changes based on a series of
heuristics, and that applies equally to both stock "log -g"
output, as well as "--format=%gd". The documentation for
"%gd" doesn't cover this. Let's mention the multiple formats
and refer the user back to the "-g" section for the complete
rules.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-07-22 13:47:33 -07:00
Jeff King 83c9f95cce doc/rev-list-options: explain "-g" output formats
We document that asking for HEAD@{now} will switch the
output to show HEAD@{timestamp}, but not that specifying
`--date` has a similar effect, or that it can be overridden
with HEAD@{0}. Let's do so.

These rules come from 794151e (reflog-walk: always make
HEAD@{0} show indexed selectors, 2012-05-04), though that is
simply the culmination of years of these heuristics growing
organically.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-07-22 13:47:33 -07:00
Jeff King 2b68222d72 doc/rev-list-options: clarify "commit@{Nth}" for "-g" option
When "log -g" shows "HEAD@{1}", "HEAD@{2}", etc, calling
that "commit@{Nth}" is not really accurate. The "HEAD" part
is really the refname. By saying "commit", a reader may
misunderstand that to mean something related to the specific
commit we are showing, not the ref whose reflog we are
traversing.

While we're here, let's also switch these instances to use
literal backticks, as our style guide recommends. As a
bonus, that lets us drop some asciidoc quoting.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-07-22 13:47:33 -07:00
Stefan Beller 280abfd4f5 Documentation: pack-protocol correct NAK response
In the transport protocol we use NAK to signal the non existence of a
common base, so fix the documentation. This helps readers of the document,
as they don't have to wonder about the difference between NAK and NACK.
As NACK is used in git archive and upload-archive, this is easy to get
wrong.

Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-07-22 13:31:55 -07:00
Philip Oakley c6eff44d0d doc: show the actual left, right, and boundary marks
Signed-off-by: Philip Oakley <philipoakley@iee.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-07-20 15:15:16 -07:00
Philip Oakley b3d3ea0672 doc: revisions - name the left and right sides
The terms left and right side originate from the symmetric
difference. Name them there.

Signed-off-by: Philip Oakley <philipoakley@iee.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-07-20 15:15:16 -07:00
Philip Oakley 27ac83718c doc: use 'symmetric difference' consistently
Signed-off-by: Philip Oakley <philipoakley@iee.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-07-20 15:15:16 -07:00
Jeff King 83558686ce receive-pack: send keepalives during quiet periods
After a client has sent us the complete pack, we may spend
some time processing the data and running hooks. If the
client asked us to be quiet, receive-pack won't send any
progress data during the index-pack or connectivity-check
steps. And hooks may or may not produce their own progress
output. In these cases, the network connection is totally
silent from both ends.

Git itself doesn't care about this (it will wait forever),
but other parts of the system (e.g., firewalls,
load-balancers, etc) might hang up the connection. So we'd
like to send some sort of keepalive to let the network and
the client side know that we're still alive and processing.

We can use the same trick we did in 05e9515 (upload-pack:
send keepalive packets during pack computation, 2013-09-08).
Namely, we will send an empty sideband data packet every `N`
seconds that we do not relay any stderr data over the
sideband channel. As with 05e9515, this means that we won't
bother sending keepalives when there's actual progress data,
but will kick in when it has been disabled (or if there is a
lull in the progress data).

The concept is simple, but the details are subtle enough
that they need discussing here.

Before the client sends us the pack, we don't want to do any
keepalives. We'll have sent our ref advertisement, and we're
waiting for them to send us the pack (and tell us that they
support sidebands at all).

While we're receiving the pack from the client (or waiting
for it to start), there's no need for keepalives; it's up to
them to keep the connection active by sending data.
Moreover, it would be wrong for us to do so. When we are the
server in the smart-http protocol, we must treat our
connection as half-duplex. So any keepalives we send while
receiving the pack would potentially be buffered by the
webserver. Not only does this make them useless (since they
would not be delivered in a timely manner), but it could
actually cause a deadlock if we fill up the buffer with
keepalives. (It wouldn't be wrong to send keepalives in this
phase for a full-duplex connection like ssh; it's simply
pointless, as it is the client's responsibility to speak).

As soon as we've gotten all of the pack data, then the
client is waiting for us to speak, and we should start
keepalives immediately. From here until the end of the
connection, we send one any time we are not otherwise
sending data.

But there's a catch. Receive-pack doesn't know the moment
we've gotten all the data. It passes the descriptor to
index-pack, who reads all of the data, and then starts
resolving the deltas. We have to communicate that back.

To make this work, we instruct the sideband muxer to enable
keepalives in three phases:

  1. In the beginning, not at all.

  2. While reading from index-pack, wait for a signal
     indicating end-of-input, and then start them.

  3. Afterwards, always.

The signal from index-pack in phase 2 has to come over the
stderr channel which the muxer is reading. We can't use an
extra pipe because the portable run-command interface only
gives us stderr and stdout.

Stdout is already used to pass the .keep filename back to
receive-pack. We could also send a signal there, but then we
would find out about it in the main thread. And the
keepalive needs to be done by the async muxer thread (since
it's the one writing sideband data back to the client). And
we can't reliably signal the async thread from the main
thread, because the async code sometimes uses threads and
sometimes uses forked processes.

Therefore the signal must come over the stderr channel,
where it may be interspersed with other random
human-readable messages from index-pack. This patch makes
the signal a single NUL byte.  This is easy to parse, should
not appear in any normal stderr output, and we don't have to
worry about any timing issues (like seeing half the signal
bytes in one read(), and half in a subsequent one).

This is a bit ugly, but it's simple to code and should work
reliably.

Another option would be to stop using an async thread for
muxing entirely, and just poll() both stderr and stdout of
index-pack from the main thread. This would work for
index-pack (because we aren't doing anything useful in the
main thread while it runs anyway). But it would make the
connectivity check and the hook muxers much more
complicated, as they need to simultaneously feed the
sub-programs while reading their stderr.

The index-pack phase is the only one that needs this
signaling, so it could simply behave differently than the
other two. That would mean having two separate
implementations of copy_to_sideband (and the keepalive
code), though. And it still doesn't get rid of the
signaling; it just means we can write a nicer message like
"END_OF_INPUT" or something on stdout, since we don't have
to worry about separating it from the stderr cruft.

One final note: this signaling trick is only done with
index-pack, not with unpack-objects. There's no point in
doing it for the latter, because by definition it only kicks
in for a small number of objects, where keepalives are not
as useful (and this conveniently lets us avoid duplicating
the implementation).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-07-20 12:11:11 -07:00
Jeff King 434ea3cdad rev-list: add optional progress reporting
It's easy to ask rev-list to do a traversal that may takes
many seconds (e.g., by calling "--objects --all"). In theory
you can monitor its progress by the output you get to
stdout, but this isn't always easy.

Some operations, like "--count", don't make any output until
the end.

And some callers, like check_everything_connected(), are
using it just for the error-checking of the traversal, and
throw away stdout entirely.

This patch adds a "--progress" option which can be used to
give some eye-candy for a user waiting for a long traversal.
This is just a rev-list option and not a regular traversal
option, because it needs cooperation from the callbacks in
builtin/rev-list.c to do the actual count.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-07-20 12:10:44 -07:00
Junio C Hamano 08bb3500a2 Sixth batch of topics for 2.10
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-07-19 13:26:16 -07:00
Junio C Hamano 566fdaf611 Merge branch 'nd/fetch-ref-summary'
Improve the look of the way "git fetch" reports what happened to
each ref that was fetched.

* nd/fetch-ref-summary:
  fetch: reduce duplicate in ref update status lines with placeholder
  fetch: align all "remote -> local" output
  fetch: change flag code for displaying tag update and deleted ref
  fetch: refactor ref update status formatting code
  git-fetch.txt: document fetch output
2016-07-19 13:22:21 -07:00
Junio C Hamano dc21164e66 Merge branch 'nd/connect-ssh-command-config'
A new configuration variable core.sshCommand has been added to
specify what value for GIT_SSH_COMMAND to use per repository.

* nd/connect-ssh-command-config:
  connect: read $GIT_SSH_COMMAND from config file
2016-07-19 13:22:12 -07:00
Eric Wong cec9264f17 git-svn: document svn.authorsProg in config
This has always been supported since we read config variables
based on the command-line option parser.  Document it explicitly
since users usually want to maintain the same program across
invocations.

Signed-off-by: Eric Wong <e@80x24.org>
2016-07-19 10:07:19 +00:00
Johannes Schindelin 90cf590f53 fsck: optionally show more helpful info for broken links
When reporting broken links between commits/trees/blobs, it would be
quite helpful at times if the user would be told how the object is
supposed to be reachable.

With the new --name-objects option, git-fsck will try to do exactly
that: name the objects in a way that shows how they are reachable.

For example, when some reflog got corrupted and a blob is missing that
should not be, the user might want to remove the corresponding reflog
entry. This option helps them find that entry: `git fsck` will now
report something like this:

	broken link from    tree b5eb6ff...  (refs/stash@{<date>}~37:)
	              to    blob ec5cf80...

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-07-18 15:15:59 -07:00
Junio C Hamano 82246e075e Sync with 2.9.2
* maint:
  Git 2.9.2
  t0006: skip "far in the future" test when unsigned long is not long enough
2016-07-15 10:49:23 -07:00
Junio C Hamano e634160bf4 Git 2.9.2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-07-15 10:48:16 -07:00
Stefan Beller f6a4e61fbb push: accept push options
This implements everything that is required on the client side to make use
of push options from the porcelain push command.

Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-07-14 15:50:41 -07:00
Stefan Beller c714e45f87 receive-pack: implement advertising and receiving push options
The pre/post receive hook may be interested in more information from the
user. This information can be transmitted when both client and server
support the "push-options" capability, which when used is a phase directly
after update commands ended by a flush pkt.

Similar to the atomic option, the server capability can be disabled via
the `receive.advertisePushOptions` config variable. While documenting
this, fix a nit in the `receive.advertiseAtomic` wording.

Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-07-14 15:50:40 -07:00
Stefan Beller 77a9745d19 push options: {pre,post}-receive hook learns about push options
The environment variable GIT_PUSH_OPTION_COUNT is set to the number of
push options sent, and GIT_PUSH_OPTION_{0,1,..} is set to the transmitted
option.

The code is not executed as the push options are set to NULL, nor is the
new capability advertised.

There was some discussion back and forth how to present these push options
to the user as there are some ways to do it:

Keep all options in one environment variable
============================================
+ easiest way to implement in Git
- This would make things hard to parse correctly in the hook.

Put the options in files instead,
filenames are in GIT_PUSH_OPTION_FILES
======================================
+ After a discussion about environment variables and shells, we may not
  want to put user data into an environment variable (see [1] for example).
+ We could transmit binaries, i.e. we're not bound to C strings as
  we are when using environment variables to the user.
+ Maybe easier to parse than constructing environment variable names
  GIT_PUSH_OPTION_{0,1,..} yourself
- cleanup of the temporary files is hard to do reliably
- we have race conditions with multiple clients pushing, hence we'd need
  to use mkstemp. That's not too bad, but still.

Use environment variables, but restrict to key/value pairs
==========================================================
(When the user pushes a push option `foo=bar`, we'd
GIT_PUSH_OPTION_foo=bar)
+ very easy to parse for a simple model of push options
- it's not sufficient for more elaborate models, e.g.
  it doesn't allow doubles (e.g. cc=reviewer@email)

Present the options in different environment variables
======================================================
(This is implemented)
* harder to parse as a user, but we have a sample hook for that.
- doesn't allow binary files
+ allows the same option twice, i.e. is not restrictive about
  options, except for binary files.
+ doesn't clutter a remote directory with (possibly stale)
  temporary files

As we first want to focus on getting simple strings to work
reliably, we go with the last option for now. If we want to
do transmission of binaries later, we can just attach a
'side-channel', e.g. "any push option that contains a '\0' is
put into a file instead of the environment variable and we'd
have new GIT_PUSH_OPTION_FILES, GIT_PUSH_OPTION_FILENAME_{0,1,..}
environment variables".

[1] 'Shellshock' https://lwn.net/Articles/614218/

Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-07-14 15:50:17 -07:00
Junio C Hamano 16726cfa0c diff: document diff-filter exclusion
In v1.8.5 days, 7f2ea5f0 (diff: allow lowercase letter to specify
what change class to exclude, 2013-07-17) taught the "--diff-filter"
mechanism to take lowercase letters as exclusion, but we forgot to
document it.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-07-14 12:17:47 -07:00
Junio C Hamano 79ed43c28f Fifth batch of topics for 2.10
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-07-13 11:30:25 -07:00
Junio C Hamano ce18123cec Merge branch 'mm/doc-tt'
More mark-up updates to typeset strings that are expected to
literally typed by the end user in fixed-width font.

* mm/doc-tt:
  doc: typeset HEAD and variants as literal
  CodingGuidelines: formatting HEAD in documentation
  doc: typeset long options with argument as literal
  doc: typeset '--' as literal
  doc: typeset long command-line options as literal
  doc: typeset short command-line options as literal
  Documentation/git-mv.txt: fix whitespace indentation
2016-07-13 11:24:14 -07:00
Junio C Hamano 7aa46d2bc8 Merge branch 'nd/doc-new-command'
Typofix in a doc.

* nd/doc-new-command:
  new-command.txt: correct the command description file
2016-07-13 11:24:12 -07:00
Junio C Hamano b1ec08fda8 Sync with v2.9.1
* maint:
  Git 2.9.1
2016-07-11 10:46:39 -07:00
Junio C Hamano 5c9159de87 Git 2.9.1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-07-11 10:45:50 -07:00
Junio C Hamano 9f0aa036e9 Merge branch 'jn/preformatted-doc-url' into maint
The top level documentation "git help git" still pointed at the
documentation set hosted at now-defunct google-code repository.
Update it to point to https://git.github.io/htmldocs/git.html
instead.

* jn/preformatted-doc-url:
  doc: git-htmldocs.googlecode.com is no more
2016-07-11 10:44:16 -07:00
Junio C Hamano 1a88ca99db Merge branch 'sb/clone-shallow-passthru' into maint
Fix an unintended regression in v2.9 that breaks "clone --depth"
that recurses down to submodules by forcing the submodules to also
be cloned shallowly, which many server instances that host upstream
of the submodules are not prepared for.

* sb/clone-shallow-passthru:
  clone: do not let --depth imply --shallow-submodules
2016-07-11 10:44:12 -07:00
Junio C Hamano 4212e483a9 Merge branch 'mg/signature-doc' into maint
Formats of the various data (and how to validate them) where we use
GPG signature have been documented.

* mg/signature-doc:
  Documentation/technical: signed merge tag format
  Documentation/technical: signed commit format
  Documentation/technical: signed tag format
  Documentation/technical: describe signature formats
2016-07-11 10:44:11 -07:00
Junio C Hamano d0ccc82ad8 Fourth batch of topics for 2.10
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-07-11 10:36:29 -07:00
Junio C Hamano 369dc4081c Merge branch 'mj/log-show-signature-conf'
"git log" learns log.showSignature configuration variable, and a
command line option "--no-show-signature" to countermand it.

* mj/log-show-signature-conf:
  log: add log.showSignature configuration variable
  log: add "--no-show-signature" command line option
  t4202: refactor test
2016-07-11 10:31:08 -07:00
Junio C Hamano 493ddea54d Merge branch 'jn/preformatted-doc-url'
The top level documentation "git help git" still pointed at the
documentation set hosted at now-defunct google-code repository.
Update it to point to https://git.github.io/htmldocs/git.html
instead.

* jn/preformatted-doc-url:
  doc: git-htmldocs.googlecode.com is no more
2016-07-11 10:31:07 -07:00
Junio C Hamano 3c5de5c77b Merge branch 'jk/ansi-color'
The output coloring scheme learned two new attributes, italic and
strike, in addition to existing bold, reverse, etc.

* jk/ansi-color:
  color: support strike-through attribute
  color: support "italic" attribute
  color: allow "no-" for negating attributes
  color: refactor parse_attr
  add skip_prefix_mem helper
  doc: refactor description of color format
  color: fix max-size comment
2016-07-11 10:31:05 -07:00
Nguyễn Thái Ngọc Duy 080739ba1d worktree.c: find_worktree() search by path suffix
This allows the user to do something like "worktree lock foo" or
"worktree lock to/foo" instead of "worktree lock /long/path/to/foo" if
it's unambiguous.

With completion support it could be quite convenient. While this base
name search can be done in the same worktree iteration loop, the code is
split into a separate function for clarity.

Suggested-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-07-08 15:31:04 -07:00
Nguyễn Thái Ngọc Duy 6d308627ca worktree: add "unlock" command
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-07-08 15:31:04 -07:00
Nguyễn Thái Ngọc Duy 58142c09a4 worktree: add "lock" command
Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-07-08 15:31:04 -07:00
Nguyễn Thái Ngọc Duy 3c8ede3ff3 connect: read $GIT_SSH_COMMAND from config file
Similar to $GIT_ASKPASS or $GIT_PROXY_COMMAND, we also read from
config file first then fall back to $GIT_SSH_COMMAND.

This is useful for selecting different private keys targetting the
same host (e.g. github)

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-07-06 14:04:09 -07:00
Junio C Hamano 5c589a73de Third batch of topics for 2.10
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-07-06 13:42:58 -07:00
Junio C Hamano 789808fe48 Sync with maint
* maint:
  More fixes for 2.9.1
  mailmap: use main email address for dturner
2016-07-06 13:42:37 -07:00
Junio C Hamano 9f1027d18a Merge branch 'sb/clone-shallow-passthru'
Fix an unintended regression in v2.9 that breaks "clone --depth"
that recurses down to submodules by forcing the submodules to also
be cloned shallowly, which many server instances that host upstream
of the submodules are not prepared for.

* sb/clone-shallow-passthru:
  clone: do not let --depth imply --shallow-submodules
2016-07-06 13:38:13 -07:00
Junio C Hamano 1d77bed8b0 Merge branch 'mg/signature-doc'
Formats of the various data (and how to validate them) where we use
GPG signature have been documented.

* mg/signature-doc:
  Documentation/technical: signed merge tag format
  Documentation/technical: signed commit format
  Documentation/technical: signed tag format
  Documentation/technical: describe signature formats
2016-07-06 13:38:12 -07:00
Junio C Hamano 979f030359 Merge branch 'jk/repack-keep-unreachable'
"git repack" learned the "--keep-unreachable" option, which sends
loose unreachable objects to a pack instead of leaving them loose.
This helps heuristics based on the number of loose objects
(e.g. "gc --auto").

* jk/repack-keep-unreachable:
  repack: extend --keep-unreachable to loose objects
  repack: add --keep-unreachable option
  repack: document --unpack-unreachable option
2016-07-06 13:38:11 -07:00
Junio C Hamano e25a4ded8a Merge branch 'ew/mboxrd-format-am'
Teach format-patch and mailsplit (hence "am") how a line that
happens to begin with "From " in the e-mail message is quoted with
">", so that these lines can be restored to their original shape.

* ew/mboxrd-format-am:
  am: support --patch-format=mboxrd
  mailsplit: support unescaping mboxrd messages
  pretty: support "mboxrd" output format
2016-07-06 13:38:11 -07:00
Junio C Hamano 1e4bf90789 Merge branch 'jk/upload-pack-hook'
"upload-pack" allows a custom "git pack-objects" replacement when
responding to "fetch/clone" via the uploadpack.packObjectsHook.

* jk/upload-pack-hook:
  upload-pack: provide a hook for running pack-objects
  t1308: do not get fooled by symbolic links to the source tree
  config: add a notion of "scope"
  config: return configset value for current_config_ functions
  config: set up config_source for command-line config
  git_config_parse_parameter: refactor cleanup code
  git_config_with_options: drop "found" counting
2016-07-06 13:38:11 -07:00
Junio C Hamano 7a738b40f6 Merge branch 'nd/worktree-cleanup-post-head-protection'
Further preparatory clean-up for "worktree" feature continues.

* nd/worktree-cleanup-post-head-protection:
  worktree: simplify prefixing paths
  worktree: avoid 0{40}, too many zeroes, hard to read
  worktree.c: use is_dot_or_dotdot()
  git-worktree.txt: keep subcommand listing in alphabetical order
  worktree.c: rewrite mark_current_worktree() to avoid strbuf
  completion: support git-worktree
2016-07-06 13:38:11 -07:00
Junio C Hamano 2f84df2ca0 Merge branch 'ep/http-curl-trace'
HTTP transport gained an option to produce more detailed debugging
trace.

* ep/http-curl-trace:
  imap-send.c: introduce the GIT_TRACE_CURL enviroment variable
  http.c: implement the GIT_TRACE_CURL environment variable
2016-07-06 13:38:06 -07:00
Junio C Hamano 674d38f55b More fixes for 2.9.1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-07-06 13:08:02 -07:00
Junio C Hamano 1c22105f2c Merge branch 'jk/fetch-prune-doc' into maint
Minor doc update.

* jk/fetch-prune-doc:
  fetch: document that pruning happens before fetching
2016-07-06 13:06:44 -07:00
Junio C Hamano 17eb7a7858 Merge branch 'dn/gpg-doc' into maint
The documentation tries to consistently spell "GPG"; when
referring to the specific program name, "gpg" is used.

* dn/gpg-doc:
  Documentation: GPG capitalization
2016-07-06 13:06:36 -07:00
Junio C Hamano 7f223b108d Merge branch 'ap/git-svn-propset-doc' into maint
"git svn propset" subcommand that was added in 2.3 days is
documented now.

* ap/git-svn-propset-doc:
  git-svn: document the 'git svn propset' command
2016-07-06 13:06:35 -07:00
Junio C Hamano 073d0b0914 Merge branch 'tr/doc-tt' into maint
The documentation set has been updated so that literal commands,
configuration variables and environment variables are consistently
typeset in fixed-width font and bold in manpages.

* tr/doc-tt:
  doc: change configuration variables format
  doc: more consistency in environment variables format
  doc: change environment variables format
  doc: clearer rule about formatting literals
2016-07-06 13:06:34 -07:00
Torsten Bögershausen 6523728499 convert: unify the "auto" handling of CRLF
Before this change,
$ echo "* text=auto" >.gitattributes
$ echo "* eol=crlf" >>.gitattributes

would have the same effect as
$ echo "* text" >.gitattributes
$ git config core.eol crlf

Since the 'eol' attribute had higher priority than 'text=auto', this may
corrupt binary files and is not what most users expect to happen.

Make the 'eol' attribute to obey 'text=auto' and now
$ echo "* text=auto" >.gitattributes
$ echo "* eol=crlf" >>.gitattributes
behaves the same as
$ echo "* text=auto" >.gitattributes
$ git config core.eol crlf

In other words,
$ echo "* text=auto eol=crlf" >.gitattributes
has the same effect as
$ git config core.autocrlf true

and
$ echo "* text=auto eol=lf" >.gitattributes
has the same effect as
$ git config core.autocrlf input

Signed-off-by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-07-06 11:53:51 -07:00
Nguyễn Thái Ngọc Duy bc437d1020 fetch: reduce duplicate in ref update status lines with placeholder
In the "remote -> local" line, if either ref is a substring of the
other, the common part in the other string is replaced with "*". For
example

    abc                -> origin/abc
    refs/pull/123/head -> pull/123

become

    abc         -> origin/*
    refs/*/head -> pull/123

Activated with fetch.output=compact.

For the record, this output is not perfect. A single giant ref can
push all refs very far to the right and likely be wrapped around. We
may have a few options:

 - exclude these long lines smarter

 - break the line after "->", exclude it from column width calculation

 - implement a new format, { -> origin/}foo, which makes the problem
   go away at the cost of a bit harder to read

 - reverse all the arrows so we have "* <- looong-ref", again still
   hard to read.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-07-06 11:48:25 -07:00
Matthieu Moy 661c3e9bc0 doc: typeset HEAD and variants as literal
This is an application of the newly added CodingGuidelines to HEAD and
variants like FETCH_HEAD. It was obtained with:

  perl -pi -e "s/'([A-Z_]*HEAD)'/\`\$1\`/g" *.txt

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-28 08:36:45 -07:00
Matthieu Moy 57103dbf70 CodingGuidelines: formatting HEAD in documentation
The current practice is:

git/Documentation$ git grep "'HEAD'" | wc -l
24
git/Documentation$ git grep "\`HEAD\`" | wc -l
66

Let's adopt the majority as a guideline.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-28 08:36:45 -07:00
Matthieu Moy bb72e10a41 doc: typeset long options with argument as literal
We previously reformatted '--option' to `--option`. This patch reformats
'--option <arg>' to `--option <arg>`. Obtained with:

  perl -pi -e "s/'(--[a-z][a-z=<>-]* <[^>]*>)'/\`\$1\`/g" *.txt

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-28 08:36:45 -07:00
Matthieu Moy 04b125de7e doc: typeset '--' as literal
This was obtained with:

  perl -pi -e "s/'--'/\`--\`/g" *.txt

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-28 08:36:45 -07:00
Matthieu Moy bcf9626a71 doc: typeset long command-line options as literal
Similarly to the previous commit, use backquotes instead of
forward-quotes, for long options.

This was obtained with:

  perl -pi -e "s/'(--[a-z][a-z=<>-]*)'/\`\$1\`/g" *.txt

and manual tweak to remove false positive in ascii-art (o'--o'--o' to
describe rewritten history).

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-28 08:36:45 -07:00
Matthieu Moy 23f8239bbe doc: typeset short command-line options as literal
It was common in our documentation to surround short option names with
forward quotes, which renders as italic in HTML. Instead, use backquotes
which renders as monospace. This is one more step toward conformance to
Documentation/CodingGuidelines.

This was obtained with:

  perl -pi -e "s/'(-[a-z])'/\`\$1\`/g" *.txt

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-28 08:20:52 -07:00
Matthieu Moy 46e22b70df Documentation/git-mv.txt: fix whitespace indentation
Replace spaces with tabs to avoid a warning when further patches change
these lines.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-28 08:20:52 -07:00
Nguyễn Thái Ngọc Duy 2cb040baa6 fetch: change flag code for displaying tag update and deleted ref
This makes the fetch flag code consistent with push, where '-' means
deleted ref.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-27 10:58:02 -07:00
Nguyễn Thái Ngọc Duy a52397cce6 git-fetch.txt: document fetch output
This documents the ref update status of fetch. The structure of this
output is defined in [1]. The ouput content is refined a bit in [2]
[3] [4].

This patch is a copy from git-push.txt, modified a bit because the
flag '-' means different things in push (delete) and fetch (tag
update).

PS. For code archaeologists, the discussion mentioned in [1] is
probably [5].

[1] 165f390 (git-fetch: more terse fetch output - 2007-11-03)
[2] 6315472 (fetch: report local storage errors ... - 2008-06-26)
[3] f360d84 (builtin-fetch: add --prune option - 2009-11-10)
[4] 0997ada (fetch: describe new refs based on where... - 2012-04-16)
[5] http://thread.gmane.org/gmane.comp.version-control.git/61657

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-27 10:58:02 -07:00
Junio C Hamano cf4c2cfe52 Second batch of topics for 2.10
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-27 10:07:08 -07:00
Junio C Hamano e1658495be Sync with maint
* maint:
  Start preparing for 2.9.1
2016-06-27 10:00:15 -07:00
Junio C Hamano 2ff7dff01e Start preparing for 2.9.1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-27 09:59:51 -07:00
Junio C Hamano 3a76459922 Merge branch 'dn/gpg-doc'
The documentation tries to consistently spell "GPG"; when
referring to the specific program name, "gpg" is used.

* dn/gpg-doc:
  Documentation: GPG capitalization
2016-06-27 09:56:45 -07:00
Junio C Hamano 4764053815 Merge branch 'jk/fetch-prune-doc'
* jk/fetch-prune-doc:
  fetch: document that pruning happens before fetching
2016-06-27 09:56:44 -07:00
Junio C Hamano 0c068afd8c Merge branch 'ap/git-svn-propset-doc'
"git svn propset" subcommand that was added in 2.3 days is
documented now.

* ap/git-svn-propset-doc:
  git-svn: document the 'git svn propset' command
2016-06-27 09:56:43 -07:00
Junio C Hamano 94c61d25da Merge branch 'tr/doc-tt'
The documentation set has been updated so that literal commands,
configuration variables and environment variables are consistently
typeset in fixed-width font and bold in manpages.

* tr/doc-tt:
  doc: change configuration variables format
  doc: more consistency in environment variables format
  doc: change environment variables format
  doc: clearer rule about formatting literals
2016-06-27 09:56:42 -07:00
Nguyễn Thái Ngọc Duy 82f6178af6 new-command.txt: correct the command description file
It has always been command-list.txt even at the time this
new-command.txt document is added.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-27 06:11:57 -07:00
Mehul Jain fce04c3ca6 log: add log.showSignature configuration variable
Users may want to always use "--show-signature" while using git-log and
related commands.

When log.showSignature is set to true, git-log and related commands will
behave as if "--show-signature" was given to them.

Note that this config variable is meant to affect git-log, git-show,
git-whatchanged and git-reflog. Other commands like git-format-patch,
git-rev-list are not to be affected by this config variable.

Signed-off-by: Mehul Jain <mehul.jain2029@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-24 13:01:13 -07:00
Jeff King 9dc3515cf0 color: support strike-through attribute
This is the only remaining attribute that is commonly
supported (at least by xterm) that we don't support. Let's
add it for completeness.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-23 11:32:51 -07:00
Jeff King 54590a0eda color: support "italic" attribute
We already support bold, underline, and similar attributes.
Let's add italic to the mix.  According to the Wikipedia
page on ANSI colors, this attribute is "not widely
supported", but it does seem to work on my xterm.

We don't have to bump the maximum color size because we were
already over-allocating it (but we do adjust the comment
appropriately).

Requested-by: Simon Courtois <scourtois@cubyx.fr>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-23 11:32:51 -07:00
Jeff King 5621068f3d color: allow "no-" for negating attributes
Using "no-bold" rather than "nobold" is easier to read and
more natural to type (to me, anyway, even though I was the
person who introduced "nobold" in the first place). It's
easy to allow both.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-23 11:32:51 -07:00
Jeff King adb3356664 doc: refactor description of color format
This is a general cleanup of the description of colors in
git-config, mostly to address inaccuracies and confusion
that had grown over time:

  - you can have many attributes, not just one

  - the discussion flip-flopped between colors and
    attributes; now we discuss everything about colors, then
    everything about attributes

  - many concepts were lumped into the first paragraph,
    making it hard to read, and especially to find the
    actual lists of colors and attributes. I stopped short
    of breaking those out into their own lists, as it seemed
    like an excessive use of vertical screen real estate.

  - we introduced negated attributes, but then the next
    paragraph basically explains how each item starts off
    with no attributes. So why would one need negated
    attributes? We now explain.

  - minor typo, language, and typography fixes

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-23 11:32:51 -07:00
Jonathan Nieder f79358279c doc: git-htmldocs.googlecode.com is no more
http://git-htmldocs.googlecode.com/git/git.html says

 There was no service found for the uri requested.

Link to the rendered documentation on Jekyll instead.

Reported-by: Andrea Stacchiotti <andreastacchiotti@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-22 12:37:33 -07:00
Junio C Hamano 18a74a092b clone: do not let --depth imply --shallow-submodules
In v2.9.0, we prematurely flipped the default to force cloning
submodules shallowly, when the superproject is getting cloned
shallowly.  This is likely to fail when the upstream repositories
submodules are cloned from a repository that is not prepared to
serve histories that ends at a commit that is not at the tip of a
branch, and we know the world is not yet ready.

Use a safer default to clone the submodules fully, unless the user
tells us that she knows that the upstream repository of the
submodules are willing to cooperate with "--shallow-submodules"
option.

Noticed-by: Vadim Eisenberg <VADIME@il.ibm.com>
Helped-by: Jeff King <peff@peff.net>
Helped-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-20 11:35:28 -07:00
Junio C Hamano ab7797dbe9 Start the post-2.9 cycle
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-20 11:06:49 -07:00
Junio C Hamano 8699b74ae1 Merge branch 'wd/userdiff-css'
Update the funcname definition to support css files.

* wd/userdiff-css:
  userdiff: add built-in pattern for CSS
2016-06-20 11:01:02 -07:00
Junio C Hamano 0196c75e14 Merge branch 'aq/upload-pack-use-parse-options'
"git upload-pack" command has been updated to use the parse-options
API.

* aq/upload-pack-use-parse-options:
  upload-pack.c: use parse-options API
2016-06-20 11:01:02 -07:00
Junio C Hamano 6d41eb685a Merge branch 'jg/dash-is-last-branch-in-worktree-add'
"git worktree add" learned that '-' can be used as a short-hand for
"@{-1}", the previous branch.

* jg/dash-is-last-branch-in-worktree-add:
  worktree: allow "-" short-hand for @{-1} in add command
2016-06-20 11:01:02 -07:00
Junio C Hamano 3807098cd6 Merge branch 'sb/submodule-recommend-shallowness'
An upstream project can make a recommendation to shallowly clone
some submodules in the .gitmodules file it ships.

* sb/submodule-recommend-shallowness:
  submodule update: learn `--[no-]recommend-shallow` option
  submodule-config: keep shallow recommendation around
2016-06-20 11:01:01 -07:00
Junio C Hamano 8d6a7e9a19 Merge branch 'ew/fast-import-unpack-limit'
"git fast-import" learned the same performance trick to avoid
creating too small a packfile as "git fetch" and "git push" have,
using *.unpackLimit configuration.

* ew/fast-import-unpack-limit:
  fast-import: invalidate pack_id references after loosening
  fast-import: implement unpack limit
2016-06-20 11:01:00 -07:00
Michael J Gruber cc6ee97cb3 Documentation/technical: signed merge tag format
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-17 12:10:48 -07:00
Michael J Gruber eda2f11ee3 Documentation/technical: signed commit format
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-17 12:10:30 -07:00
Michael J Gruber 5f1abfeb69 Documentation/technical: signed tag format
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-17 11:40:58 -07:00
Michael J Gruber 76f9d8bac8 Documentation/technical: describe signature formats
We use different types of signature formats in different places.
Set up the infrastructure and overview to describe them systematically
in our technical documentation.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-17 11:39:05 -07:00
Dave Nicolson bc91316781 Documentation: GPG capitalization
When "GPG" is used in a sentence it is now consistently capitalized.
When referring to the binary it is left as "gpg".

Signed-off-by: David Nicolson <david.nicolson@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-16 17:32:28 -07:00
Alfred Perlstein 19a7f24b6f git-svn: document the 'git svn propset' command
Add example usage to the git-svn documentation.

Reported-by: Joseph Pecoraro <pecoraro@apple.com>
Signed-off-by: Alfred Perlstein <alfred@freebsd.org>
Reviewed-by: Eric Wong <e@80x24.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-15 13:21:11 -07:00
Jeff King e26a8c4721 repack: extend --keep-unreachable to loose objects
If you use "repack -adk" currently, we will pack all objects
that are already packed into the new pack, and then drop the
old packs. However, loose unreachable objects will be left
as-is. In theory these are meant to expire eventually with
"git prune". But if you are using "repack -k", you probably
want to keep things forever and therefore do not run "git
prune" at all. Meaning those loose objects may build up over
time and end up fooling any object-count heuristics (such as
the one done by "gc --auto", though since git-gc does not
support "repack -k", this really applies to whatever custom
scripts people might have driving "repack -k").

With this patch, we instead stuff any loose unreachable
objects into the pack along with the already-packed
unreachable objects. This may seem wasteful, but it is
really no more so than using "repack -k" in the first place.
We are at a slight disadvantage, in that we have no useful
ordering for the result, or names to hand to the delta code.
However, this is again no worse than what "repack -k" is
already doing for the packed objects. The packing of these
objects doesn't matter much because they should not be
accessed frequently (unless they actually _do_ become
referenced, but then they would get moved to a different
part of the packfile during the next repack).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-14 13:57:45 -07:00
Jeff King 905f27b86a repack: add --keep-unreachable option
The usual way to do a full repack (and what is done by
git-gc) is to run "repack -Ad --unpack-unreachable=<when>",
which will loosen any unreachable objects newer than
"<when>", and drop any older ones.

This is a safer alternative to "repack -ad", because
"<when>" becomes a grace period during which we will not
drop any new objects that are about to be referenced.
However, it isn't perfectly safe. It's always possible that
a process is about to reference an old object. Even if that
process were to take care to update the timestamp on the
object, there is no atomicity with a simultaneously running
"repack" process.

So while unlikely, there is a small race wherein we may drop
an object that is in the process of being referenced. If you
do automated repacking on a large number of active
repositories, you may hit it eventually, and the result is a
corrupted repository.

It would be nice to fix that race in the long run, but it's
complicated.  In the meantime, there is a much simpler
strategy for automated repository maintenance: do not drop
objects at all. We already have a "--keep-unreachable"
option in pack-objects; we just need to plumb it through
from git-repack.

Note that this _isn't_ plumbed through from git-gc, so at
this point it's strictly a tool for people doing their own
advanced repository maintenance strategy.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-14 13:57:42 -07:00
Jeff King 6a7bcb5471 repack: document --unpack-unreachable option
This was added back in 7e52f56 (gc: do not explode objects
which will be immediately pruned, 2012-04-07), but not
documented at the time, since it was an internal detail
between git-gc and git-repack. However, as people with
complicated setups may want to effectively reimplement the
steps of git-gc themselves, it is nice for us to document
these interfaces.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-14 13:57:38 -07:00
Junio C Hamano e1d09701a4 blame: dwim "blame --reverse OLD" as "blame --reverse OLD.."
Instead of always requiring both ends of a range, we could DWIM
"OLD", which could be a misspelt "OLD..", to be a range that ends at
the current commit.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-14 12:13:07 -07:00
Junio C Hamano d993ce1ed2 blame: improve diagnosis for "--reverse NEW"
"git blame --reverse OLD..NEW -- PATH" tells us to start from the
contents in PATH at OLD and observe how each line is changed while
the history develops up to NEW, and report for each line the latest
commit up to which the line survives in the original form.

If you say "git blame --reverse NEW -- PATH" by mistake, we complain
about the missing OLD, but we phrased it as "No commit to dig down
to?"  In this case, however, we are digging up from OLD, so say so.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-14 12:12:15 -07:00
Jeff King 9e70233a17 fetch: document that pruning happens before fetching
This was changed in 10a6cc8 (fetch --prune: Run prune before
fetching, 2014-01-02), but it seems that nobody in that
discussion realized we were advertising the "after"
explicitly.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-14 10:56:27 -07:00
Nguyễn Thái Ngọc Duy cccf74e2da fetch, upload-pack: --deepen=N extends shallow boundary by N commits
In git-fetch, --depth argument is always relative with the latest
remote refs. This makes it a bit difficult to cover this use case,
where the user wants to make the shallow history, say 3 levels
deeper. It would work if remote refs have not moved yet, but nobody
can guarantee that, especially when that use case is performed a
couple months after the last clone or "git fetch --depth". Also,
modifying shallow boundary using --depth does not work well with
clones created by --since or --not.

This patch fixes that. A new argument --deepen=<N> will add <N> more (*)
parent commits to the current history regardless of where remote refs
are.

Have/Want negotiation is still respected. So if remote refs move, the
server will send two chunks: one between "have" and "want" and another
to extend shallow history. In theory, the client could send no "want"s
in order to get the second chunk only. But the protocol does not allow
that. Either you send no want lines, which means ls-remote; or you
have to send at least one want line that carries deep-relative to the
server..

The main work was done by Dongcan Jiang. I fixed it up here and there.
And of course all the bugs belong to me.

(*) We could even support --deepen=<N> where <N> is negative. In that
case we can cut some history from the shallow clone. This operation
(and --depth=<shorter depth>) does not require interaction with remote
side (and more complicated to implement as a result).

Helped-by: Duy Nguyen <pclouds@gmail.com>
Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Dongcan Jiang <dongcan.jiang@gmail.com>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-13 14:38:16 -07:00
Nguyễn Thái Ngọc Duy 859e5df916 clone: define shallow clone boundary with --shallow-exclude
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-13 14:38:16 -07:00
Nguyễn Thái Ngọc Duy a45a260086 fetch: define shallow boundary with --shallow-exclude
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-13 14:38:16 -07:00
Nguyễn Thái Ngọc Duy 269a7a8316 upload-pack: support define shallow boundary by excluding revisions
This should allow the user to say "create a shallow clone of this branch
after version <some-tag>".

Short refs are accepted and expanded at the server side with expand_ref()
because we cannot expand (unknown) refs from the client side.

Like deepen-since, deepen-not cannot be used with deepen. But deepen-not
can be mixed with deepen-since. The result is exactly how you do the
command "git rev-list --since=... --not ref".

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-13 14:38:16 -07:00
Nguyễn Thái Ngọc Duy 994c2aaf31 clone: define shallow clone boundary based on time with --shallow-since
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-13 14:38:16 -07:00
Nguyễn Thái Ngọc Duy 508ea88226 fetch: define shallow boundary with --shallow-since
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-13 14:38:16 -07:00
Nguyễn Thái Ngọc Duy 569e554be9 upload-pack: add deepen-since to cut shallow repos based on time
This should allow the user to say "create a shallow clone containing the
work from last year" (once the client side is fixed up, of course).

In theory deepen-since and deepen (aka --depth) can be used together to
draw the shallow boundary (whether it's intersection or union is up to
discussion, but if rev-list is used, it's likely intersection). However,
because deepen goes with a custom commit walker, we can't mix the two
yet.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-13 14:38:16 -07:00
Junio C Hamano 05219a1276 Git 2.9
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-13 10:42:13 -07:00
Junio C Hamano a28705da92 Hopefully the final last-minute update before 2.9 final
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-10 15:30:19 -07:00
Junio C Hamano e5f7675544 Merge branch 'jk/diff-compact-heuristic'
It turns out that the earlier effort to update the heuristics may
want to use a bit more time to mature.  Turn it off by default.

* jk/diff-compact-heuristic:
  diff: disable compaction heuristic for now
2016-06-10 15:26:06 -07:00
Junio C Hamano 5580b271af diff: disable compaction heuristic for now
http://lkml.kernel.org/g/20160610075043.GA13411@sigill.intra.peff.net
reports that a change to add a new "function" with common ending
with the existing one at the end of the file is shown like this:

    def foo
      do_foo_stuff()

   +  common_ending()
   +end
   +
   +def bar
   +  do_bar_stuff()
   +
      common_ending()
    end

when the new heuristic is in use.  In reality, the change is to add
the blank line before "def bar" and everything below, which is what
the code without the new heuristic shows.

Disable the heuristics by default, and resurrect the documentation
for the option and the configuration variables, while clearly
marking the feature as still experimental.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-10 13:45:23 -07:00
Tom Russello ae9f6311e9 doc: change configuration variables format
This change configuration variables that where in italic style
to monospace font according to the guideline. It was obtained with

	grep '[[:alpha:]]*\.[[:alpha:]]*::$' config.txt | \
	sed -e 's/::$//' -e 's/\./\\\\./' | \
	xargs -iP perl -pi -e "s/\'P\'/\`P\`/g" ./*.txt

Signed-off-by: Tom Russello <tom.russello@grenoble-inp.org>
Signed-off-by: Erwan Mathoniere <erwan.mathoniere@grenoble-inp.org>
Signed-off-by: Samuel Groot <samuel.groot@grenoble-inp.org>
Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-08 12:04:55 -07:00
Tom Russello 47d81b5c7a doc: more consistency in environment variables format
Wrap with backticks (monospaced font) unwrapped or single-quotes wrapped
(italic type) environment variables which are followed by the word
"environment". It was obtained with:

perl -pi -e "s/\'?(\\\$?[0-9A-Z\_]+)\'?(?= environment ?)/\`\1\`/g" *.txt

One of the main purposes is to stick to the CodingGuidelines as possible so
that people writting new documentation by mimicking the existing are more likely
to have it right (even if they didn't read the CodingGuidelines).

Signed-off-by: Tom Russello <tom.russello@grenoble-inp.org>
Signed-off-by: Erwan Mathoniere <erwan.mathoniere@grenoble-inp.org>
Signed-off-by: Samuel Groot <samuel.groot@grenoble-inp.org>
Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-08 12:04:37 -07:00
Tom Russello eee7f4a233 doc: change environment variables format
This change GIT_* variables that where in italic style to monospaced font
according to the guideline. It was obtained with

	perl -pi -e "s/\'(GIT_.*?)\'/\`\1\`/g" *.txt

One of the main purposes is to stick to the CodingGuidelines as possible so
that people writting new documentation by mimicking the existing are more likely
to have it right (even if they didn't read the CodingGuidelines).

Signed-off-by: Tom Russello <tom.russello@grenoble-inp.org>
Signed-off-by: Erwan Mathoniere <erwan.mathoniere@grenoble-inp.org>
Signed-off-by: Samuel Groot <samuel.groot@grenoble-inp.org>
Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-08 12:04:37 -07:00
Tom Russello 41f5b21f84 doc: clearer rule about formatting literals
Make the guideline text that we want for our documentation clearer.

Signed-off-by: Tom Russello <tom.russello@grenoble-inp.org>
Signed-off-by: Erwan Mathoniere <erwan.mathoniere@grenoble-inp.org>
Signed-off-by: Samuel Groot <samuel.groot@grenoble-inp.org>
Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-08 12:04:37 -07:00
Junio C Hamano 49fa3dc761 Git 2.9-rc2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-06 14:34:52 -07:00
Junio C Hamano c42b5d8e69 Sync with 2.8.4
* maint:
  Git 2.8.4
2016-06-06 14:30:49 -07:00
Junio C Hamano 0b65a8dbdb Git 2.8.4
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-06 14:29:32 -07:00
Junio C Hamano 7dcbf891d9 Merge branch 'tb/core-eol-fix' into maint
A couple of bugs around core.autocrlf have been fixed.

* tb/core-eol-fix:
  convert.c: ident + core.autocrlf didn't work
  t0027: test cases for combined attributes
  convert: allow core.autocrlf=input and core.eol=crlf
  t0027: make commit_chk_wrnNNO() reliable
2016-06-06 14:27:36 -07:00
Eric Wong d9925d1a71 am: support --patch-format=mboxrd
Combined with "git format-patch --pretty=mboxrd", this should
allow us to round-trip commit messages with embedded mbox
"From " lines without corruption.

Signed-off-by: Eric Wong <e@80x24.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-06 11:40:15 -07:00
Eric Wong c88098d7f1 mailsplit: support unescaping mboxrd messages
This will allow us to parse the output of --pretty=mboxrd
and the output of other mboxrd generators.

Signed-off-by: Eric Wong <e@80x24.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-06 11:14:43 -07:00
William Duclot 0719f3eecd userdiff: add built-in pattern for CSS
CSS is widely used, motivating it being included as a built-in pattern.

It must be noted that the word_regex for CSS (i.e. the regex defining
what is a word in the language) does not consider '.' and '#' characters
(in CSS selectors) to be part of the word. This behavior is documented
by the test t/t4018/css-rule.
The logic behind this behavior is the following: identifiers in CSS
selectors are identifiers in a HTML/XML document. Therefore, the '.'/'#'
character are not part of the identifier, but an indicator of the nature
of the identifier in HTML/XML (class or id). Diffing ".class1" and
".class2" must show that the class name is changed, but we still are
selecting a class.

Logic behind the "pattern" regex is:
    1. reject lines ending with a colon/semicolon (properties)
    2. if a line begins with a name in column 1, pick the whole line

Credits to Johannes Sixt (j6t@kdbg.org) for the pattern regex and most
of the tests.

Signed-off-by: William Duclot <william.duclot@ensimag.grenoble-inp.fr>
Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Reviewed-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-03 14:45:56 -07:00
Junio C Hamano 6326f19925 Almost ready for 2.9-rc2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-03 14:38:35 -07:00
Junio C Hamano a8398b952d Merge branch 'em/man-bold-literal'
The manpage output of our documentation did not render well in
terminal; typeset literals in bold by default to make them stand
out more.

* em/man-bold-literal:
  Documentation: bold literals in man
2016-06-03 14:38:02 -07:00
Junio C Hamano 1df2d6e8df Merge branch 'pa/cherry-pick-doc-typo'
"git cherry-pick --help" had three instances of word "behavior",
one of which was spelled "behaviour", which is updated to match the
other two.

* pa/cherry-pick-doc-typo:
  git-cherry-pick.txt: correct a small typo
2016-06-03 14:38:02 -07:00
Junio C Hamano 160ef79cec Merge branch 'mr/send-email-doc-gmail-2fa'
Typofix.

* mr/send-email-doc-gmail-2fa:
  Documentation/git-send-email: fix typo in gmail 2FA section
2016-06-03 14:38:01 -07:00
Jeff King 20b20a22f8 upload-pack: provide a hook for running pack-objects
When upload-pack serves a client request, it turns to
pack-objects to do the heavy lifting of creating a
packfile. There's no easy way to intercept the call to
pack-objects, but there are a few good reasons to want to do
so:

  1. If you're debugging a client or server issue with
     fetching, you may want to store a copy of the generated
     packfile.

  2. If you're gathering data from real-world fetches for
     performance analysis or debugging, storing a copy of
     the arguments and stdin lets you replay the pack
     generation at your leisure.

  3. You may want to insert a caching layer around
     pack-objects; it is the most CPU- and memory-intensive
     part of serving a fetch, and its output is a pure
     function[1] of its input, making it an ideal place to
     consolidate identical requests.

This patch adds a simple "hook" interface to intercept calls
to pack-objects. The new test demonstrates how it can be
used for debugging (using it for caching is a
straightforward extension; the tricky part is writing the
actual caching layer).

This hook is unlike the normal hook scripts found in the
"hooks/" directory of a repository. Because we promise that
upload-pack is safe to run in an untrusted repository, we
cannot execute arbitrary code or commands found in the
repository (neither in hooks/, nor in the config). So
instead, this hook is triggered from a config variable that
is explicitly ignored in the per-repo config.

The config variable holds the actual shell command to run as
the hook.  Another approach would be to simply treat it as a
boolean: "should I respect the upload-pack hooks in this
repo?", and then run the script from "hooks/" as we usually
do. However, that isn't as flexible; there's no way to run a
hook approved by the site administrator (e.g., in
"/etc/gitconfig") on a repository whose contents are not
trusted. The approach taken by this patch is more
fine-grained, if a little less conventional for git hooks
(it does behave similar to other configured commands like
diff.external, etc).

[1] Pack-objects isn't _actually_ a pure function. Its
    output depends on the exact packing of the object
    database, and if multi-threading is used for delta
    compression, can even differ racily. But for the
    purposes of caching, that's OK; of the many possible
    outputs for a given input, it is sufficient only that we
    output one of them.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-02 15:22:24 -07:00
SZEDER Gábor 1df036ea25 Documentation/git-send-email: fix typo in gmail 2FA section
Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-01 17:23:38 -07:00
Junio C Hamano 60bd4b1c51 Git 2.9-rc1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-05-31 14:12:15 -07:00
Junio C Hamano 257f6f404b Merge branch 'maint'
* maint:
  More topics for 2.8.4
2016-05-31 14:12:08 -07:00
Junio C Hamano 4b0891ffe4 More topics for 2.8.4
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-05-31 14:11:38 -07:00
Junio C Hamano 3296e1a93a Merge branch 'sb/submodule-deinit-all' into maint
Correct faulty recommendation to use "git submodule deinit ." when
de-initialising all submodules, which would result in a strange
error message in a pathological corner case.

* sb/submodule-deinit-all:
  submodule deinit: require '--all' instead of '.' for all submodules
2016-05-31 14:09:46 -07:00
Junio C Hamano e646a82ce2 Merge branch 'bn/http-cookiefile-config' into maint
"http.cookieFile" configuration variable clearly wants a pathname,
but we forgot to treat it as such by e.g. applying tilde expansion.

* bn/http-cookiefile-config:
  http: expand http.cookieFile as a path
  Documentation: config: improve word ordering for http.cookieFile
2016-05-31 14:08:28 -07:00
Jordan DE GEA 1a450e2fd1 worktree: allow "-" short-hand for @{-1} in add command
Since `git worktree add` uses `git checkout` when `[<branch>]` is used,
and `git checkout -` is already supported, it makes sense to allow the
same shortcut in `git worktree add`.

Signed-off-by: Jordan DE GEA <jordan.de-gea@grenoble-inp.org>
Signed-off-by: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-05-31 12:28:25 -07:00
Erwan Mathoniere 5945717009 Documentation: bold literals in man
Backticks are emphasized through monospaced styling in the HTML
version of Git documentation. But they were left unstyled in the
manual pages.

To make the man pages more comfortably read, `MAN_BOLD_LITERAL` was
added by 5121a6d (Documentation: option to render literal text as
bold for manpages, 2009-03-27).  It allowed the user to build the
manpages with literals in bold style.

For precaution it was not set by default back then.

Since 79c461d (docs: default to more modern toolset, 2010-11-19), it
is assumed ASCIIDOC 8 and at least docbook-xsl 1.73 are used, so the
need for compatibility concern is much lessor now.

Remove `MAN_BOLD_LITERAL`, and typeset literals as bold by default .
Add `NO_MAN_BOLD_LITERAL`, a new Makefile option, disabling this
feature when defined.

Signed-off-by: Erwan MATHONIERE <erwan.mathoniere@grenoble-inp.org>
Signed-off-by: Samuel GROOT <samuel.groot@grenoble-inp.org>
Signed-off-by: Tom RUSSELLO <tom.russello@grenoble-inp.org>
Signed-off-by: Matthieu MOY <matthieu.moy@grenoble-inp.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-05-31 11:42:30 -07:00
Antoine Queru 9812f2136b upload-pack.c: use parse-options API
Use the parse-options API rather than a hand-rolled option parser.

Description for --stateless-rpc and --advertise-refs come from
42526b4 (Add stateless RPC options to upload-pack,
receive-pack, 2009-10-30).

Signed-off-by: Antoine Queru <antoine.queru@grenoble-inp.org>
Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-05-31 10:17:20 -07:00
Junio C Hamano f3913c2d03 Final batch before 2.9-rc1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-05-29 18:08:26 -07:00
Junio C Hamano 5b67f9a028 Merge branch 'rj/log-decorate-auto'
We forgot to add "git log --decorate=auto" to documentation when we
added the feature back in v2.1.0 timeframe.

* rj/log-decorate-auto:
  log: document the --decorate=auto option
2016-05-29 18:06:43 -07:00
Pablo Santiago Blum de Aguiar cd82b7a0f7 git-cherry-pick.txt: correct a small typo
Most of the document mentions `behavior` instead of the British
variation, `behaviour`. This change makes it consistent.

Signed-off-by: Pablo Santiago Blum de Aguiar <scorphus@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-05-29 17:32:12 -07:00
Michael Rappazzo 6640988123 Documentation: add instructions to help setup gmail 2FA
For those who use two-factor authentication with gmail, git-send-email
will not work unless it is setup with an app-specific password. The
example for setting up git-send-email for use with gmail will now
include information on generating and storing the app-specific password.

Signed-off-by: Michael Rappazzo <rappazzo@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-05-27 14:49:02 -07:00
Ramsay Jones 462cbb415e log: document the --decorate=auto option
Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-05-27 13:16:47 -07:00
Stefan Beller abed000aca submodule update: learn --[no-]recommend-shallow option
Sometimes the history of a submodule is not considered important by
the projects upstream. To make it easier for downstream users, allow
a boolean field 'submodule.<name>.shallow' in .gitmodules, which can
be used to recommend whether upstream considers the history important.

This field is honored in the initial clone by default, it can be
ignored by giving the `--no-recommend-shallow` option.

Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-05-27 10:40:46 -07:00
Junio C Hamano 7777322816 Sync with maint
* maint:
  Start preparing for 2.8.4
  archive-tar: convert snprintf to xsnprintf
2016-05-26 13:28:24 -07:00
Junio C Hamano b051c59a00 Start preparing for 2.8.4
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-05-26 13:21:00 -07:00
Junio C Hamano 6396212d1c Merge branch 'jc/linkgit-fix' into maint
Many 'linkgit:<git documentation page>' references were broken,
which are all fixed with this.

* jc/linkgit-fix:
  Documentation: fix linkgit references
2016-05-26 13:17:26 -07:00
Junio C Hamano e29300d69f Merge branch 'js/windows-dotgit' into maint
On Windows, .git and optionally any files whose name starts with a
dot are now marked as hidden, with a core.hideDotFiles knob to
customize this behaviour.

* js/windows-dotgit:
  mingw: remove unnecessary definition
  mingw: introduce the 'core.hideDotFiles' setting
2016-05-26 13:17:23 -07:00
Junio C Hamano 968004c39c Merge branch 'kf/gpg-sig-verification-doc' into maint
Documentation for "git merge --verify-signatures" has been updated
to clarify that the signature of only the commit at the tip is
verified.  Also the phrasing used for signature and key validity is
adjusted to align with that used by OpenPGP.

* kf/gpg-sig-verification-doc:
  Documentation: clarify signature verification
2016-05-26 13:17:22 -07:00
Junio C Hamano d07211b5fa Merge branch 'lp/typofixes' into maint
Typofixes.

* lp/typofixes:
  typofix: assorted typofixes in comments, documentation and messages
2016-05-26 13:17:21 -07:00
Junio C Hamano 57b76d3379 Merge branch 'bn/config-doc-tt-varnames' into maint
Doc formatting fixes.

* bn/config-doc-tt-varnames:
  config: consistently format $variables in monospaced font
  config: describe 'pathname' value type
2016-05-26 13:17:19 -07:00
Junio C Hamano 31efe2a8a8 Merge branch 'va/mailinfo-doc-typofix' into maint
Typofix.

* va/mailinfo-doc-typofix:
  Documentation/git-mailinfo: fix typo
2016-05-26 13:17:14 -07:00
Elia Pinto 74c682d3c6 http.c: implement the GIT_TRACE_CURL environment variable
Implement the GIT_TRACE_CURL environment variable to allow a
greater degree of detail of GIT_CURL_VERBOSE, in particular
the complete transport header and all the data payload exchanged.
It might be useful if a particular situation could require a more
thorough debugging analysis. Document the new GIT_TRACE_CURL
environment variable.

Helped-by: Torsten Bögershausen <tboegi@web.de>
Helped-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
Helped-by: Junio C Hamano <gitster@pobox.com>
Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-05-24 15:48:18 -07:00
Nguyễn Thái Ngọc Duy 7b722d906b git-worktree.txt: keep subcommand listing in alphabetical order
This is probably not the best order. But it makes it no-brainer to know
where to insert new commands. At some point we might want to reorder at
least the synopsis part again, grouping commonly use subcommands together.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Reviewed-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-05-24 13:19:22 -07:00
Junio C Hamano 3a0f269e7c Git 2.9-rc0
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-05-23 15:02:48 -07:00
Junio C Hamano fa4f29b8a8 Merge branch 'jc/doc-lint'
Find common mistakes when writing gitlink: in our documentation and
drive the check from "make check-docs".

I am not entirely happy with the way the script chooses what input
file to validate, but it is not worse than not having anything, so
let's move it forward and have the logic improved later when people
care about it deeply.

* jc/doc-lint:
  ci: validate "linkgit:" in documentation
2016-05-23 14:54:34 -07:00
Junio C Hamano 5d5f1c236b Merge branch 'pb/commit-verbose-config'
"git commit" learned to pay attention to "commit.verbose"
configuration variable and act as if "--verbose" option was
given from the command line.

* pb/commit-verbose-config:
  commit: add a commit.verbose config variable
  t7507-commit-verbose: improve test coverage by testing number of diffs
  parse-options.c: make OPTION_COUNTUP respect "unspecified" values
  t/t7507: improve test coverage
  t0040-parse-options: improve test coverage
  test-parse-options: print quiet as integer
  t0040-test-parse-options.sh: fix style issues
2016-05-23 14:54:32 -07:00
Junio C Hamano 72ce3ff7b5 Merge branch 'xy/format-patch-base'
"git format-patch" learned a new "--base" option to record what
(public, well-known) commit the original series was built on in
its output.

* xy/format-patch-base:
  format-patch: introduce format.useAutoBase configuration
  format-patch: introduce --base=auto option
  format-patch: add '--base' option to record base tree info
  patch-ids: make commit_patch_id() a public helper function
2016-05-23 14:54:31 -07:00
Junio C Hamano 8e34225522 Merge branch 'tb/core-eol-fix'
A couple of bugs around core.autocrlf have been fixed.

* tb/core-eol-fix:
  convert.c: ident + core.autocrlf didn't work
  t0027: test cases for combined attributes
  convert: allow core.autocrlf=input and core.eol=crlf
  t0027: make commit_chk_wrnNNO() reliable
2016-05-23 14:54:30 -07:00
Junio C Hamano 3916adf997 Sync with 2.8.3
* maint:
  Git 2.8.3
2016-05-18 15:33:57 -07:00
Junio C Hamano 0f8e831356 Git 2.8.3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-05-18 15:32:41 -07:00
Junio C Hamano 989cbd4556 Merge branch 'ew/doc-split-pack-disables-bitmap' into HEAD
Doc update.

* ew/doc-split-pack-disables-bitmap:
  pack-objects: warn on split packs disabling bitmaps
2016-05-18 14:40:15 -07:00
Junio C Hamano 8d61f0f07d Merge branch 'rn/glossary-typofix' into HEAD
* rn/glossary-typofix:
  Documentation: fix typo 'In such these cases'
2016-05-18 14:40:14 -07:00
Junio C Hamano 258b862edb Merge branch 'sb/config-exit-status-list' into HEAD
Doc update.

* sb/config-exit-status-list:
  config doc: improve exit code listing
2016-05-18 14:40:12 -07:00
Junio C Hamano 09687585d1 Merge branch 'ls/travis-submitting-patches' into HEAD
* ls/travis-submitting-patches:
  Documentation: add setup instructions for Travis CI
2016-05-18 14:40:09 -07:00
Junio C Hamano 1f66975deb Thirteenth batch for 2.9
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-05-17 14:47:06 -07:00
Junio C Hamano be6ec17822 Merge branch 'kf/gpg-sig-verification-doc'
Documentation for "git merge --verify-signatures" has been updated
to clarify that the signature of only the commit at the tip is
verified.  Also the phrasing used for signature and key validity is
adjusted to align with that used by OpenPGP.

* kf/gpg-sig-verification-doc:
  Documentation: clarify signature verification
2016-05-17 14:38:39 -07:00
Junio C Hamano bfc99b63fe Merge branch 'js/windows-dotgit'
On Windows, .git and optionally any files whose name starts with a
dot are now marked as hidden, with a core.hideDotFiles knob to
customize this behaviour.

* js/windows-dotgit:
  mingw: remove unnecessary definition
  mingw: introduce the 'core.hideDotFiles' setting
2016-05-17 14:38:39 -07:00
Junio C Hamano 5bfc50d6fe Merge branch 'va/mailinfo-doc-typofix'
Typofix.

* va/mailinfo-doc-typofix:
  Documentation/git-mailinfo: fix typo
2016-05-17 14:38:38 -07:00
Junio C Hamano 5f232ecfdf Merge branch 'jc/linkgit-fix'
Many 'linkgit:<git documentation page>' references were broken,
which are all fixed with this.

* jc/linkgit-fix:
  Documentation: fix linkgit references
2016-05-17 14:38:31 -07:00
Junio C Hamano 34698baa5b Merge branch 'bn/config-doc-tt-varnames'
Doc formatting fixes.

* bn/config-doc-tt-varnames:
  config: consistently format $variables in monospaced font
2016-05-17 14:38:23 -07:00
Junio C Hamano 3241d4f6fb Merge branch 'lp/typofixes'
* lp/typofixes:
  typofix: assorted typofixes in comments, documentation and messages
2016-05-17 14:38:20 -07:00
Junio C Hamano 21b2e60400 Merge branch 'sb/submodule-deinit-all'
Correct faulty recommendation to use "git submodule deinit ." when
de-initialising all submodules, which would result in a strange
error message in a pathological corner case.

* sb/submodule-deinit-all:
  submodule deinit: require '--all' instead of '.' for all submodules
2016-05-17 14:38:20 -07:00
Junio C Hamano fd87e705b3 Merge branch 'jc/config-pathname-type'
Consolidate description of tilde-expansion that is done to
configuration variables that take pathname to a single place.

* jc/config-pathname-type:
  config: describe 'pathname' value type
2016-05-17 14:38:19 -07:00
Junio C Hamano 459000ef63 Merge branch 'bn/http-cookiefile-config'
"http.cookieFile" configuration variable clearly wants a pathname,
but we forgot to treat it as such by e.g. applying tilde expansion.

* bn/http-cookiefile-config:
  http: expand http.cookieFile as a path
  Documentation: config: improve word ordering for http.cookieFile
2016-05-17 14:38:18 -07:00
Junio C Hamano 6675f501f6 Merge branch 'ab/hooks'
A new configuration variable core.hooksPath allows customizing
where the hook directory is.

* ab/hooks:
  hooks: allow customizing where the hook directory is
  githooks.txt: minor improvements to the grammar & phrasing
  githooks.txt: amend dangerous advice about 'update' hook ACL
  githooks.txt: improve the intro section
2016-05-17 14:38:17 -07:00
Junio C Hamano edec3709db Twelfth batch for 2.9
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-05-13 13:23:24 -07:00
Junio C Hamano 50b26f5612 Merge branch 'jc/commit-tree-ignore-commit-gpgsign'
"git commit-tree" plumbing command required the user to always sign
its result when the user sets the commit.gpgsign configuration
variable, which was an ancient mistake.  Rework "git rebase" that
relied on this mistake so that it reads commit.gpgsign and pass (or
not pass) the -S option to "git commit-tree" to keep the end-user
expectation the same, while teaching "git commit-tree" to ignore
the configuration variable.  This will stop requiring the users to
sign commit objects used internally as an implementation detail of
"git stash".

* jc/commit-tree-ignore-commit-gpgsign:
  commit-tree: do not pay attention to commit.gpgsign
2016-05-13 13:18:27 -07:00
Keller Fuchs 05a5869a01 Documentation: clarify signature verification
Clarify that "merge --verify-signatures" checks the signature on the
tip commit of the history being merged.

Uniformise the vocabulary used wrt. key/signature validity with OpenPGP:
- a signature is valid if made by a key with a valid uid;
- in the default trust-model, a uid is valid if signed by a trusted key;
- a key is trusted if the (local) user set a trust level for it.

Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Keller Fuchs   <KellerFuchs@hashbang.sh>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-05-13 12:37:44 -07:00
Eric Wong d9545c7f46 fast-import: implement unpack limit
With many incremental imports, small packs become highly
inefficient due to the need to readdir scan and load many
indices to locate even a single object.  Frequent repacking and
consolidation may be prohibitively expensive in terms of disk
I/O, especially in large repositories where the initial packs
were aggressively optimized and marked with .keep files.

In those cases, users may be better served with loose objects
and relying on "git gc --auto".

This changes the default behavior of fast-import for small
imports found in test cases, so adjustments to t9300 were
necessary.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-05-11 14:56:00 -07:00
Vasco Almeida dee2303b1a Documentation/git-mailinfo: fix typo
Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-05-11 14:35:52 -07:00
Johannes Schindelin f30afdabbf mingw: introduce the 'core.hideDotFiles' setting
On Unix (and Linux), files and directories whose names start with a dot
are usually not shown by default. This convention is used by Git: the
.git/ directory should be left alone by regular users, and only accessed
through Git itself.

On Windows, no such convention exists. Instead, there is an explicit flag
to mark files or directories as hidden.

In the early days, Git for Windows did not mark the .git/ directory (or
for that matter, any file or directory whose name starts with a dot)
hidden. This lead to quite a bit of confusion, and even loss of data.

Consequently, Git for Windows introduced the core.hideDotFiles setting,
with three possible values: true, false, and dotGitOnly, defaulting to
marking only the .git/ directory as hidden.

The rationale: users do not need to access .git/ directly, and indeed (as
was demonstrated) should not really see that directory, either. However,
not all dot files should be hidden by default, as e.g. Eclipse does not
show them (and the user would therefore be unable to see, say, a
.gitattributes file).

In over five years since the last attempt to bring this patch into core
Git, a slightly buggy version of this patch has served Git for Windows'
users well: no single report indicated problems with the hidden .git/
directory, and the stream of problems caused by the previously non-hidden
.git/ directory simply stopped. The bugs have been fixed during the
process of getting this patch upstream.

Note that there is a funny quirk we have to pay attention to when
creating hidden files: we use Win32's _wopen() function which
transmogrifies its arguments and hands off to Win32's CreateFile()
function. That latter function errors out with ERROR_ACCESS_DENIED (the
equivalent of EACCES) when the equivalent of the O_CREAT flag was passed
and the file attributes (including the hidden flag) do not match an
existing file's. And _wopen() accepts no parameter that would be
transmogrified into said hidden flag. Therefore, we simply try again
without O_CREAT.

A slightly different method is required for our fopen()/freopen()
function as we cannot even *remove* the implicit O_CREAT flag.
Therefore, we briefly mark existing files as unhidden when opening them
via fopen()/freopen().

The ERROR_ACCESS_DENIED error can also be triggered by opening a file
that is marked as a system file (which is unlikely to be tracked in
Git), and by trying to create a file that has *just* been deleted and is
awaiting the last open handles to be released (which would be handled
better by the "Try again?" logic, a story for a different patch series,
though). In both cases, it does not matter much if we try again without
the O_CREAT flag, read: it does not hurt, either.

For details how ERROR_ACCESS_DENIED can be triggered, see
https://msdn.microsoft.com/en-us/library/windows/desktop/aa363858

Original-patch-by: Erik Faye-Lund <kusmabite@gmail.com>
Initial-Test-By: Pat Thoyts <patthoyts@users.sourceforge.net>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-05-11 13:54:53 -07:00
Junio C Hamano 5fe494c54a Eleventh batch for 2.9
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-05-10 13:46:57 -07:00
Junio C Hamano 5a2906812b Merge branch 'rn/glossary-typofix'
* rn/glossary-typofix:
  Documentation: fix typo 'In such these cases'
2016-05-10 13:40:32 -07:00
Junio C Hamano d5e0d54319 Merge branch 'ls/travis-submitting-patches'
* ls/travis-submitting-patches:
  Documentation: add setup instructions for Travis CI
2016-05-10 13:40:30 -07:00
Junio C Hamano 54c2af5aa3 Merge branch 'ew/doc-split-pack-disables-bitmap'
Doc update.

* ew/doc-split-pack-disables-bitmap:
  pack-objects: warn on split packs disabling bitmaps
2016-05-10 13:40:28 -07:00
Junio C Hamano ab81411ced ci: validate "linkgit:" in documentation
It is easy to add incorrect "linkgit:<page>[<section>]" references
to our documentation suite.  Catch these common classes of errors:

 * Referring to Documentation/<page>.txt that does not exist.

 * Referring to a <page> outside the Git suite.  In general, <page>
   must begin with "git".

 * Listing the manual <section> incorrectly.  The first line of the
   Documentation/<page>.txt must end with "(<section>)".

with a new script "ci/lint-gitlink", and drive it from "make check-docs".

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-05-10 11:15:04 -07:00
Pranit Bauva aaab84203b commit: add a commit.verbose config variable
Add commit.verbose configuration variable as a convenience for those
who always prefer --verbose.

Add tests to check the behavior introduced by this commit and also to
verify that behavior of status doesn't break because of this commit.

Helped-by: Junio C Hamano <gitster@pobox.com>
Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Pranit Bauva <pranit.bauva@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-05-10 10:25:52 -07:00
Junio C Hamano 1cca17dfff Documentation: fix linkgit references
There are a handful of incorrect "linkgit:<page>[<section>]"
instances in our documentation set.

 * Some have an extra colon after "linkgit:"; fix them by removing
   the extra colon;

 * Some refer to a page outside the Git suite, namely curl(1); fix
   them by using the `curl(1)` that already appears on the same page
   for the same purpose of referring the readers to its manual page.

 * Some spell the name of the page incorrectly, e.g. "rev-list" when
   they mean "git-rev-list"; fix them.

 * Some list the manual section incorrectly; fix them to make sure
   they match what is at the top of the target of the link.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-05-09 15:44:14 -07:00
Junio C Hamano 63a35025b1 Sync with maint
* maint:
  Almost ready for 2.8.3
2016-05-06 14:53:45 -07:00
Junio C Hamano d92347f59f Almost ready for 2.8.3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-05-06 14:53:36 -07:00
Junio C Hamano c75fb77d9a Merge branch 'kn/for-each-tag-branch' into maint
A minor documentation update.

* kn/for-each-tag-branch:
  for-each-ref: fix description of '--contains' in manpage
2016-05-06 14:53:23 -07:00
Junio C Hamano a3fe55458a Tenth batch for 2.9
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-05-06 14:51:51 -07:00
Junio C Hamano e250f495b2 Merge branch 'js/http-custom-headers'
HTTP transport clients learned to throw extra HTTP headers at the
server, specified via http.extraHeader configuration variable.

* js/http-custom-headers:
  http: support sending custom HTTP headers
2016-05-06 14:45:43 -07:00
Junio C Hamano 5f3b21c111 Merge branch 'sb/clone-shallow-passthru'
"git clone" learned "--shallow-submodules" option.

* sb/clone-shallow-passthru:
  clone: add `--shallow-submodules` flag
2016-05-06 14:45:43 -07:00
Junio C Hamano 3b577581ab Merge branch 'sb/config-exit-status-list'
Doc update.

* sb/config-exit-status-list:
  config doc: improve exit code listing
2016-05-06 14:45:42 -07:00
Li Peng 832c0e5e63 typofix: assorted typofixes in comments, documentation and messages
Many instances of duplicate words (e.g. "the the path") and
a few typoes are fixed, originally in multiple patches.

    wildmatch: fix duplicate words of "the"
    t: fix duplicate words of "output"
    transport-helper: fix duplicate words of "read"
    Git.pm: fix duplicate words of "return"
    path: fix duplicate words of "look"
    pack-protocol.txt: fix duplicate words of "the"
    precompose-utf8: fix typo of "sequences"
    split-index: fix typo
    worktree.c: fix typo
    remote-ext: fix typo
    utf8: fix duplicate words of "the"
    git-cvsserver: fix duplicate words

Signed-off-by: Li Peng <lip@dtdream.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-05-06 13:16:37 -07:00
Brian Norris f212dcc7d3 config: consistently format $variables in monospaced font
We don't consistently use `backticks` for formatting shell variables.
This patch improves the consistency on shell variables (and a few nearby
mentions of "gpg" commands), though it still doesn't straighten out the
use of "quotes."

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-05-05 15:29:06 -07:00
Stefan Beller f6a5279977 submodule deinit: require '--all' instead of '.' for all submodules
The discussion in [1] pointed out that '.' is a faulty suggestion as
there is a corner case where it fails:

> "submodule deinit ." may have "worked" in the sense that you would
> have at least one path in your tree and avoided this "nothing
> matches" most of the time.  It would have still failed with the
> exactly same error if run in an empty repository, i.e.
>
>        $ E=/var/tmp/x/empty && rm -fr "$E" && mkdir -p "$E" && cd "$E"
>        $ git init
>        $ rungit v2.6.6 submodule deinit .
>        error: pathspec '.' did not match any file(s) known to git.
>        Did you forget to 'git add'?
>        $ >file && git add file
>        $ rungit v2.6.6 submodule deinit .
>        $ echo $?
>        0

So instead of a pathspec add the '--all' option to deinit all submodules
and add a test to check for the corner case of an empty repository.

The code only needs to learn about the '--all' option and doesn't
require further changes as `git submodule--helper list "$@"` will list
all submodules when "$@" is empty.

[1] http://news.gmane.org/gmane.comp.version-control.git/289535

Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Stefan Beller <sbeller@google.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-05-05 14:51:26 -07:00
Pranit Bauva e0070e8bd5 parse-options.c: make OPTION_COUNTUP respect "unspecified" values
OPT_COUNTUP() merely increments the counter upon --option, and resets it
to 0 upon --no-option, which means that there is no "unspecified" value
with which a client can initialize the counter to determine whether or
not --[no]-option was seen at all.

Make OPT_COUNTUP() treat any negative number as an "unspecified" value
to address this shortcoming. In particular, if a client initializes the
counter to -1, then if it is still -1 after parse_options(), then
neither --option nor --no-option was seen; if it is 0, then --no-option
was seen last, and if it is 1 or greater, than --option was seen last.

This change does not affect the behavior of existing clients because
they all use the initial value of 0 (or more).

Note that builtin/clean.c initializes the variable used with
OPT__FORCE (which uses OPT_COUNTUP()) to a negative value, but it is set
to either 0 or 1 by reading the configuration before the code calls
parse_options(), i.e. as far as parse_options() is concerned, the
initial value of the variable is not negative.

To test this behavior, in test-parse-options.c, "verbose" is set to
"unspecified" while quiet is set to 0 which will test the new behavior
with all sets of values.

Helped-by: Jeff King <peff@peff.net>
Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Pranit Bauva <pranit.bauva@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-05-05 11:52:45 -07:00
Ævar Arnfjörð Bjarmason 867ad08a26 hooks: allow customizing where the hook directory is
Change the hardcoded lookup for .git/hooks/* to optionally lookup in
$(git config core.hooksPath)/* instead.

This is essentially a more intrusive version of the git-init ability to
specify hooks on init time via init templates.

The difference between that facility and this feature is that this can
be set up after the fact via e.g. ~/.gitconfig or /etc/gitconfig to
apply for all your personal repositories, or all repositories on the
system.

I plan on using this on a centralized Git server where users can create
arbitrary repositories under /gitroot, but I'd like to manage all the
hooks that should be run centrally via a unified dispatch mechanism.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-05-04 16:25:13 -07:00
Ævar Arnfjörð Bjarmason de0824ed8f githooks.txt: minor improvements to the grammar & phrasing
Change:

 * Sentences that needed "the" or "a" to either add those or change them
   so they don't need them.

 * The little tangent about "You can use this to do X (if your project
   wants to do X)" can just be shortened to "if you want to do X".

 * s/parameter/parameters/ when the plural made more sense.

Most of this goes all the way back to the initial introduction of
hooks.txt in 6d35cc76 (Document hooks., 2005-09-02).

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-05-04 16:23:36 -07:00
Ævar Arnfjörð Bjarmason bf7d977f8c githooks.txt: amend dangerous advice about 'update' hook ACL
Any ACL you implement via an 'update' hook isn't actual access control
if the user has login access to the machine running git, because they
can trivially just build their own version of Git which doesn't run the
hook.

Change the documentation to take this dangerous edge case into account,
and remove the mention of the advice originating on the mailing list,
the users reading this don't care where the idea came up.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-05-04 16:22:48 -07:00
Ævar Arnfjörð Bjarmason 49fa52fd00 githooks.txt: improve the intro section
Change the documentation so that:

 * We don't talk about "little scripts". Hooks can be as big as you
   want, and don't have to be scripts, just call them "programs".

 * We note that we change the working directory before a hook is called,
   nothing documented this explicitly, but the current behavior is
   predictable. It helps a lot to know what directory these hooks will
   be executed from.

 * We don't make claims about the example hooks which may not be true
   depending on the configuration of 'init.templateDir'. Clarify that
   we're talking about the default settings of git-init in those cases,
   and move some of this documentation into git-init's documentation
   about the default templates.

 * We briefly note in the intro that hooks can get their arguments in
   various different ways, and that how exactly is described below for
   each hook.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-05-04 16:22:23 -07:00
Brian Norris e5a39ad8e6 http: expand http.cookieFile as a path
This should handle .gitconfig files that specify things like:

[http]
	cookieFile = "~/.gitcookies"

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-05-04 15:59:26 -07:00
Brian Norris 06ea368bb1 Documentation: config: improve word ordering for http.cookieFile
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-05-04 15:59:25 -07:00
Junio C Hamano dca83abde2 config: describe 'pathname' value type
We have a dedicated section for various value-types used in the
configuration variables already, because we needed to describe how
booleans and scaled integers can be spelled, and the pathname type
would fit there.

Adjust the description of `include.path`, `core.excludesFile` and
`commit.template` variables slightly to clarify that these variables
are of this type.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-05-04 15:58:51 -07:00
Junio C Hamano 69d4380b47 Ninth batch for 2.9
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-05-03 14:15:10 -07:00
Junio C Hamano 6694856153 commit-tree: do not pay attention to commit.gpgsign
ba3c69a9 (commit: teach --gpg-sign option, 2011-10-05) introduced a
"signed commit" by teaching the --[no]-gpg-sign option and the
commit.gpgsign configuration variable to various commands that
create commits.

Teaching these to "git commit" and "git merge", both of which are
end-user facing Porcelain commands, was perfectly fine.  Allowing
the plumbing "git commit-tree" to suddenly change the behaviour to
surprise the scripts by paying attention to commit.gpgsign was not.

Among the in-tree scripts, filter-branch, quiltimport, rebase and
stash are the commands that run "commit-tree".  If any of these
wants to allow users to always sign every single commit, they should
offer their own configuration (e.g. "filterBranch.gpgsign") with an
option to disable signing (e.g. "git filter-branch --no-gpgsign").

Ignoring commit.gpgsign option _obviously_ breaks the backward
compatibility, but it is easy to follow the standard pattern in
scripts to honor whatever configuration variable they choose to
follow.  E.g.

	case $(git config --bool commit.gpgsign) in
	true) sign=-S ;;
	*) sign= ;;
	esac &&
	git commit-tree $sign ...whatever other args...

Do so to make sure that "git rebase" keeps paying attention to the
configuration variable, which unfortunately is a documented mistake.

Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-05-03 10:59:25 -07:00
Junio C Hamano ee88674f24 Sync with maint
* maint:
  Start preparing for 2.8.3
2016-05-02 15:50:34 -07:00
Junio C Hamano 5b618c1c8d Start preparing for 2.8.3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-05-02 14:24:36 -07:00
Junio C Hamano a3fa565327 Merge branch 'es/format-patch-doc-hide-no-patch' into maint
"git format-patch --help" showed `-s` and `--no-patch` as if these
are valid options to the command.  We already hide `--patch` option
from the documentation, because format-patch is about showing the
diff, and the documentation now hides these options as well.

* es/format-patch-doc-hide-no-patch:
  git-format-patch.txt: don't show -s as shorthand for multiple options
2016-05-02 14:24:06 -07:00
Junio C Hamano 8591654998 Merge branch 'jk/check-repository-format' into maint
The repository set-up sequence has been streamlined (the biggest
change is that there is no longer git_config_early()), so that we
do not attempt to look into refs/* when we know we do not have a
Git repository.

* jk/check-repository-format:
  verify_repository_format: mark messages for translation
  setup: drop repository_format_version global
  setup: unify repository version callbacks
  init: use setup.c's repo version verification
  setup: refactor repo format reading and verification
  config: drop git_config_early
  check_repository_format_gently: stop using git_config_early
  lazily load core.sharedrepository
  wrap shared_repository global in get/set accessors
  setup: document check_repository_format()
2016-05-02 14:24:04 -07:00
René Nyffenegger 2e39a24607 Documentation: fix typo 'In such these cases'
Signed-off-by: René Nyffenegger <mail@renenyffenegger.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-05-02 12:45:02 -07:00
Lars Schneider 0e5d028a7a Documentation: add setup instructions for Travis CI
Also change UK english "behaviour" to US english "behavior".

Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-05-02 11:31:44 -07:00
Junio C Hamano 77085a616b diff: undocument the compaction heuristic knobs for experimentation
It seems that people around here are all happy with the updated
heuristics used to decide where the hunks are separated.  Let's keep
that as the default.  Even though we do not expect too much trouble
from the difference between the old and the new algorithms, just in
case let's leave the implementation of the knobs to turn it off for
emergencies.  There is no longer need for documenting them, though.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-05-02 10:36:36 -07:00
Junio C Hamano bbc6168016 Eighth batch for 2.9
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-04-29 14:21:09 -07:00
Junio C Hamano cc00d9cfff Sync with 2.8.2 2016-04-29 14:20:47 -07:00
Junio C Hamano 60115f54bd Git 2.8.2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-04-29 14:19:11 -07:00
Junio C Hamano 4dda133385 Merge branch 'ep/trace-doc-sample-fix' into maint
Fix a typo in an example in the trace API documentation.

* ep/trace-doc-sample-fix:
  api-trace.txt: fix typo
2016-04-29 14:16:00 -07:00
Junio C Hamano 175008d454 Merge branch 'jc/merge-refuse-new-root'
"git pull" has been taught to pass --allow-unrelated-histories
option to underlying "git merge".

* jc/merge-refuse-new-root:
  pull: pass --allow-unrelated-histories to "git merge"
  t3033: avoid 'ambiguous refs' warning
2016-04-29 12:59:08 -07:00
Eric Wong 9cea46cdda pack-objects: warn on split packs disabling bitmaps
It can be tempting for a server admin to want a stable set of
long-lived packs for dumb clients; but also want to enable bitmaps
to serve smart clients more quickly.

Unfortunately, such a configuration is impossible; so at least warn
users of this incompatibility since commit 21134714 (pack-objects:
turn off bitmaps when we split packs, 2014-10-16).

Tested the warning by inspecting the output of:

	make -C t t5310-pack-bitmaps.sh GIT_TEST_OPTS=-v

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-04-28 09:58:14 -07:00
Johannes Schindelin 8cb01e2fd3 http: support sending custom HTTP headers
We introduce a way to send custom HTTP headers with all requests.

This allows us, for example, to send an extra token from build agents
for temporary access to private repositories. (This is the use case that
triggered this patch.)

This feature can be used like this:

	git -c http.extraheader='Secret: sssh!' fetch $URL $REF

Note that `curl_easy_setopt(..., CURLOPT_HTTPHEADER, ...)` takes only
a single list, overriding any previous call. This means we have to
collect _all_ of the headers we want to use into a single list, and
feed it to cURL in one shot. Since we already unconditionally set a
"pragma" header when initializing the curl handles, we can add our new
headers to that list.

For callers which override the default header list (like probe_rpc),
we provide `http_copy_default_headers()` so they can do the same
trick.

Big thanks to Jeff King and Junio Hamano for their outstanding help and
patient reviews.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-04-27 14:02:33 -07:00
Stefan Beller 376eb604c2 config doc: improve exit code listing
The possible reasons for exiting are now ordered by the exit code value.
While at it, rewrite the `can not write to the config file` to
`the config file cannot be written` to be grammatically correct and a
proper sentence.

Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-04-26 11:32:24 -07:00
Xiaolong Ye bb52995f3e format-patch: introduce format.useAutoBase configuration
This allows to record the base commit automatically, it is equivalent
to set --base=auto in cmdline.

The format.useAutoBase has lower priority than command line option,
so if user set format.useAutoBase and pass the command line option in
the meantime, base_commit will be the one passed to command line
option.

Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-04-26 10:52:57 -07:00
Xiaolong Ye 3de665175f format-patch: introduce --base=auto option
Introduce --base=auto to record the base commit info automatically, the
base_commit will be the merge base of tip commit of the upstream branch
and revision-range specified in cmdline.

Helped-by: Junio C Hamano <gitster@pobox.com>
Helped-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-04-26 10:51:50 -07:00
Xiaolong Ye fa2ab86d18 format-patch: add '--base' option to record base tree info
Maintainers or third party testers may want to know the exact base tree
the patch series applies to. Teach git format-patch a '--base' option
to record the base tree info and append it at the end of the first
message (either the cover letter or the first patch in the series).

The base tree info consists of the "base commit", which is a well-known
commit that is part of the stable part of the project history everybody
else works off of, and zero or more "prerequisite patches", which are
well-known patches in flight that is not yet part of the "base commit"
that need to be applied on top of "base commit" in topological order
before the patches can be applied.

The "base commit" is shown as "base-commit: " followed by the 40-hex of
the commit object name.  A "prerequisite patch" is shown as
"prerequisite-patch-id: " followed by the 40-hex "patch id", which can
be obtained by passing the patch through the "git patch-id --stable"
command.

Imagine that on top of the public commit P, you applied well-known
patches X, Y and Z from somebody else, and then built your three-patch
series A, B, C, the history would be like:

---P---X---Y---Z---A---B---C

With "git format-patch --base=P -3 C" (or variants thereof, e.g. with
"--cover-letter" of using "Z..C" instead of "-3 C" to specify the
range), the base tree information block is shown at the end of the
first message the command outputs (either the first patch, or the
cover letter), like this:

base-commit: P
prerequisite-patch-id: X
prerequisite-patch-id: Y
prerequisite-patch-id: Z

Helped-by: Junio C Hamano <gitster@pobox.com>
Helped-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-04-26 10:50:13 -07:00
Stefan Beller d22eb04475 clone: add --shallow-submodules flag
When creating a shallow clone of a repository with submodules, the depth
argument does not influence the submodules, i.e. the submodules are done
as non-shallow clones. It is unclear what the best default is for the
depth of submodules of a shallow clone, so we need to have the possibility
to do all kinds of combinations:

* shallow super project with shallow submodules
  e.g. build bots starting always from scratch. They want to transmit
  the least amount of network data as well as using the least amount
  of space on their hard drive.
* shallow super project with unshallow submodules
  e.g. The superproject is just there to track a collection of repositories
  and it is not important to have the relationship between the repositories
  intact. However the history of the individual submodules matter.
* unshallow super project with shallow submodules
  e.g. The superproject is the actual project and the submodule is a
  library which is rarely touched.

The new switch to select submodules to be shallow or unshallow supports
all of these three cases.

It is easy to transition from the first to the second case by just
unshallowing the submodules (`git submodule foreach git fetch
--unshallow`), but it is not possible to transition from the second to the
first case (as we would have already transmitted the non shallow over
the network). That is why we want to make the first case the default in
case of a shallow super project. This leads to the inconvenience in the
second case with the shallow super project and unshallow submodules,
as you need to pass `--no-shallow-submodules`.

Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-04-26 10:43:11 -07:00
Junio C Hamano e1f0df79a8 Seventh batch for post 2.8 cycle
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-04-25 15:18:35 -07:00
Torsten Bögershausen 70ad8c8d8c convert: allow core.autocrlf=input and core.eol=crlf
Even though the configuration parser errors out when core.autocrlf
is set to 'input' when core.eol is set to 'crlf', there is no need
to do so, because the core.autocrlf setting trumps core.eol.

Allow all combinations of core.crlf and core.eol and document
that core.autocrlf overrides core.eol.

Signed-off-by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-04-25 12:11:45 -07:00
Junio C Hamano a0c4ddf677 Sixth batch for post 2.8 cycle
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-04-22 15:48:03 -07:00
Junio C Hamano 09c2cb877a pull: pass --allow-unrelated-histories to "git merge"
The previous commit said:

    We could add the same option to "git pull" and have it passed
    through to underlying "git merge".  I do not have a fundamental
    opposition against such a feature, but this commit does not do
    so and instead leaves it as low-hanging fruit for others,
    because such a "two project merge" would be done after fetching
    the other project into some location in the working tree of an
    existing project and making sure how well they fit together, it
    is sufficient to allow a local merge without such an option
    pass-through from "git pull" to "git merge".

Prepare a patch to make it a reality, just in case it is needed.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-04-21 11:58:51 -07:00
Stefan Beller d634d61ed6 xdiff: implement empty line chunk heuristic
In order to produce the smallest possible diff and combine several diff
hunks together, we implement a heuristic from GNU Diff which moves diff
hunks forward as far as possible when we find common context above and
below a diff hunk. This sometimes produces less readable diffs when
writing C, Shell, or other programming languages, ie:

...
 /*
+ *
+ *
+ */
+
+/*
...

instead of the more readable equivalent of

...
+/*
+ *
+ *
+ */
+
 /*
...

Implement the following heuristic to (optionally) produce the desired
output.

  If there are diff chunks which can be shifted around, shift each hunk
  such that the last common empty line is below the chunk with the rest
  of the context above.

This heuristic appears to resolve the above example and several other
common issues without producing significantly weird results. However, as
with any heuristic it is not really known whether this will always be
more optimal. Thus, it can be disabled via diff.compactionHeuristic.

Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-04-19 10:53:34 -07:00
Junio C Hamano e6ac6e1f7d Fifth batch for post 2.8 cycle
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-04-18 10:51:09 -07:00
Junio C Hamano b8b4d93100 Merge branch 'maint'
* maint:
  Prepare for 2.8.2
  Start preparing for 2.8.2
2016-04-14 18:59:09 -07:00
Junio C Hamano 6a6636270f Prepare for 2.8.2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-04-14 18:58:11 -07:00
Junio C Hamano dc66371cdf Merge branch 'gf/fetch-pack-direct-object-fetch' into maint
Fetching of history by naming a commit object name directly didn't
work across remote-curl transport.

* gf/fetch-pack-direct-object-fetch:
  fetch-pack: update the documentation for "<refs>..." arguments
  fetch-pack: fix object_id of exact sha1
2016-04-14 18:57:44 -07:00
Junio C Hamano 0759dfdd9c Merge branch 'jk/config-get-urlmatch' into maint
"git config --get-urlmatch", unlike other variants of the "git
config --get" family, did not signal error with its exit status
when there was no matching configuration.

* jk/config-get-urlmatch:
  Documentation/git-config: fix --get-all description
  Documentation/git-config: use bulleted list for exit codes
  config: fail if --get-urlmatch finds no value
2016-04-14 18:57:43 -07:00
Junio C Hamano 2bbaad82bb Merge branch 'oa/doc-diff-check' into maint
A minor documentation update.

* oa/doc-diff-check:
  Documentation: git diff --check detects conflict markers
2016-04-14 18:37:14 -07:00
Junio C Hamano 48adfa18bc Merge branch 'pb/opt-cmdmode-doc' into maint
Minor API documentation update.

* pb/opt-cmdmode-doc:
  api-parse-options.txt: document OPT_CMDMODE()
2016-04-14 18:37:13 -07:00
Junio C Hamano f0acaa6b1c Merge branch 'nd/apply-doc' into maint
A minor documentation update.

* nd/apply-doc:
  git-apply.txt: mention the behavior inside a subdir
  git-apply.txt: remove a space
2016-04-14 18:37:13 -07:00