]> git.ipfire.org Git - thirdparty/git.git/log
thirdparty/git.git
11 years agorevisions.txt: clarify the .. and ... syntax
Ramkumar Ramachandra [Mon, 22 Apr 2013 05:30:26 +0000 (11:00 +0530)] 
revisions.txt: clarify the .. and ... syntax

In <rev1>..<rev2> and <rev1>...<rev2>, if either <rev1> or <rev2> is
omitted, it defaults to 'HEAD'.  Add this detail to the document.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agogit add: rephrase the "removal will cease to be ignored" warning
Junio C Hamano [Mon, 22 Apr 2013 04:04:35 +0000 (21:04 -0700)] 
git add: rephrase the "removal will cease to be ignored" warning

Now the logic to decide when to warn has been tightened, we know the
user is in a situation where the current and future behaviours will
be different.  Spell out what happens with these two versions and
how to explicitly ask for the behaviour, and suggest "git status" as
a way to inspect the current status.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoglossary: a revision is just a commit
Jonathan Nieder [Sun, 21 Apr 2013 08:17:05 +0000 (01:17 -0700)] 
glossary: a revision is just a commit

The current definition of 'revision' sounds like it is saying that a
revision is a tree object.  In reality it is just a commit.

This should be especially useful for people used to other revision
control systems trying to see how familiar concepts translate into git
terms.

Reported-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoMerge branch 'ta/glossary'
Junio C Hamano [Mon, 22 Apr 2013 01:40:15 +0000 (18:40 -0700)] 
Merge branch 'ta/glossary'

* ta/glossary:
  glossary: improve definitions of refspec and pathspec
  The name of the hash function is "SHA-1", not "SHA1"
  glossary: improve description of SHA-1 related topics
  glossary: remove outdated/misleading/irrelevant entries

11 years agoMerge branch 'jk/doc-http-backend'
Junio C Hamano [Mon, 22 Apr 2013 01:40:09 +0000 (18:40 -0700)] 
Merge branch 'jk/doc-http-backend'

Improve documentation to illustrate "push authenticated, fetch
anonymous" configuration for smart HTTP servers.

* jk/doc-http-backend:
  doc/http-backend: match query-string in apache half-auth example
  doc/http-backend: give some lighttpd config examples
  doc/http-backend: clarify "half-auth" repo configuration

11 years agoMerge branch 'jx/i18n-branch-error-messages'
Junio C Hamano [Mon, 22 Apr 2013 01:40:02 +0000 (18:40 -0700)] 
Merge branch 'jx/i18n-branch-error-messages'

* jx/i18n-branch-error-messages:
  i18n: branch: mark strings for translation

11 years agoMerge branch 'fc/remote-hg'
Junio C Hamano [Mon, 22 Apr 2013 01:39:58 +0000 (18:39 -0700)] 
Merge branch 'fc/remote-hg'

Updates remote-hg helper (in contrib/).

* fc/remote-hg: (21 commits)
  remote-hg: activate graphlog extension for hg_log()
  remote-hg: fix bad file paths
  remote-hg: document location of stored hg repository
  remote-hg: fix bad state issue
  remote-hg: add 'insecure' option
  remote-hg: add simple mail test
  remote-hg: add basic author tests
  remote-hg: show more proper errors
  remote-hg: force remote push
  remote-hg: push to the appropriate branch
  remote-hg: update tags globally
  remote-hg: update remote bookmarks
  remote-hg: refactor export
  remote-hg: split bookmark handling
  remote-hg: redirect buggy mercurial output
  remote-hg: trivial test cleanups
  remote-hg: make sure fake bookmarks are updated
  remote-hg: fix for files with spaces
  remote-hg: properly report errors on bookmark pushes
  remote-hg: add missing config variable in doc
  ...

11 years agoMerge branch 'lf/read-blob-data-from-index'
Junio C Hamano [Mon, 22 Apr 2013 01:39:45 +0000 (18:39 -0700)] 
Merge branch 'lf/read-blob-data-from-index'

Reduce duplicated code between convert.c and attr.c.

* lf/read-blob-data-from-index:
  convert.c: remove duplicate code
  read_blob_data_from_index(): optionally return the size of blob data
  attr.c: extract read_index_data() as read_blob_data_from_index()

11 years agoprompt: fix untracked files for zsh
Felipe Contreras [Sun, 21 Apr 2013 22:00:16 +0000 (15:00 -0700)] 
prompt: fix untracked files for zsh

We signal presense of untracked files by adding a per-cent sign '%'
to the prompt.  But because '%' is used as an escape character to
introduce prompt customization in zsh (just like bash prompt uses
'\' to escape '\u', '\h', etc.), we need to say '%%' to get a
literal per-cent.

Helped-by: Andreas Schwab <schwab@linux-m68k.org>
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agogit-shortlog.txt: remove (-h|--help) from OPTIONS
Ramkumar Ramachandra [Sun, 21 Apr 2013 08:50:46 +0000 (14:20 +0530)] 
git-shortlog.txt: remove (-h|--help) from OPTIONS

To be consistent with the documentation of all the other commands,
remove (-h|--help) from the OPTIONS section.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agol10n: de.po: translate 54 new messages
Ralf Thielow [Thu, 11 Apr 2013 16:25:45 +0000 (18:25 +0200)] 
l10n: de.po: translate 54 new messages

Translate 54 new messages came from git.pot update in
c138af5 (l10n: git.pot: v1.8.3 round 1 (54 new, 15 removed)).

While at there, fix some small issues.

Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
Acked-by: Thomas Rast <trast@inf.ethz.ch>
11 years agoreceive-pack: close sideband fd on early pack errors
Jeff King [Fri, 19 Apr 2013 21:24:29 +0000 (17:24 -0400)] 
receive-pack: close sideband fd on early pack errors

Since commit a22e6f8 (receive-pack: send pack-processing
stderr over sideband, 2012-09-21), receive-pack will start
an async sideband thread to copy the stderr from our
index-pack or unpack-objects child to the client. We hand
the thread's input descriptor to unpack(), which puts it in
the "err" member of the "struct child_process".

After unpack() returns, we use finish_async() to reap the
sideband thread. The thread is only ready to die when it
gets EOF on its pipe, which is connected to the err
descriptor. So we expect all of the write ends of that pipe
to be closed as part of unpack().

Normally, this works fine. After start_command forks, it
closes the parent copy of the descriptor. Then once the
child exits (whether it was successful or not), that closes
the only remaining writer.

However, there is one code-path in unpack() that does not
handle this. Before we decide which of unpack-objects or
index-pack to use, we read the pack header ourselves to see
how many objects it contains. If there is an error here, we
exit without running either sub-command, the pipe descriptor
remains open, and we are in a deadlock, waiting for the
sideband thread to die (which is in turn waiting for us to
close the pipe).

We can fix this by making sure that unpack() always closes
the pipe before returning.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoUpdate draft release notes to 1.8.3
Junio C Hamano [Fri, 19 Apr 2013 20:53:44 +0000 (13:53 -0700)] 
Update draft release notes to 1.8.3

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoMerge branch 'jk/a-thread-only-dies-once'
Junio C Hamano [Fri, 19 Apr 2013 20:45:04 +0000 (13:45 -0700)] 
Merge branch 'jk/a-thread-only-dies-once'

A regression fix for the logic to detect die() handler triggering
itself recursively.

* jk/a-thread-only-dies-once:
  run-command: use thread-aware die_is_recursing routine
  usage: allow pluggable die-recursion checks

11 years agoMerge branch 'rt/commentchar-fmt-merge-msg'
Junio C Hamano [Fri, 19 Apr 2013 20:45:01 +0000 (13:45 -0700)] 
Merge branch 'rt/commentchar-fmt-merge-msg'

A test fix for recent update.

* rt/commentchar-fmt-merge-msg:
  t6200: avoid path mangling issue on Windows

11 years agoMerge branch 'mv/sequencer-pick-error-diag'
Junio C Hamano [Fri, 19 Apr 2013 20:40:22 +0000 (13:40 -0700)] 
Merge branch 'mv/sequencer-pick-error-diag'

"git cherry-pick $blob $tree" is diagnosed as a nonsense.

* mv/sequencer-pick-error-diag:
  cherry-pick: make sure all input objects are commits

11 years agoMerge branch 'tr/copy-revisions-from-stdin'
Junio C Hamano [Fri, 19 Apr 2013 20:40:13 +0000 (13:40 -0700)] 
Merge branch 'tr/copy-revisions-from-stdin'

A fix to a long-standing issue in the command line parser for
revisions, which was triggered by mv/sequence-pick-error-diag topic.

* tr/copy-revisions-from-stdin:
  read_revisions_from_stdin: make copies for handle_revision_arg

11 years agoMerge branch 'jn/add-2.0-u-A-sans-pathspec' (early part)
Junio C Hamano [Fri, 19 Apr 2013 20:37:36 +0000 (13:37 -0700)] 
Merge branch 'jn/add-2.0-u-A-sans-pathspec' (early part)

In Git 2.0, "git add -u" and "git add -A" without any pathspec will
update the index for all paths, including those outside the current
directory, making it more consistent with "commit -a".  To help the
migration pain, a warning is issued when the differences between the
current behaviour and the upcoming behaviour matters, i.e. when the
user has local changes outside the current directory.

* 'jn/add-2.0-u-A-sans-pathspec' (early part):
  add -A: only show pathless 'add -A' warning when changes exist outside cwd
  add -u: only show pathless 'add -u' warning when changes exist outside cwd
  add: make warn_pathless_add() a no-op after first call
  add: add a blank line at the end of pathless 'add [-u|-A]' warning
  add: make pathless 'add [-u|-A]' warning a file-global function

11 years agoMerge branch 'ap/strbuf-humanize'
Junio C Hamano [Fri, 19 Apr 2013 20:31:26 +0000 (13:31 -0700)] 
Merge branch 'ap/strbuf-humanize'

Teach "--human-readable" aka "-H" option to "git count-objects" to
show various large numbers in Ki/Mi/GiB scaled as necessary.

* ap/strbuf-humanize:
  count-objects: add -H option to humanize sizes
  strbuf: create strbuf_humanise_bytes() to show byte sizes

11 years agoMerge branch 'fc/branch-upstream-color'
Junio C Hamano [Fri, 19 Apr 2013 20:31:24 +0000 (13:31 -0700)] 
Merge branch 'fc/branch-upstream-color'

Add more colors to "git branch -vv" output.

* fc/branch-upstream-color:
  branch: colour upstream branches

11 years agoMerge branch 'mv/ssl-ftp-curl'
Junio C Hamano [Fri, 19 Apr 2013 20:31:08 +0000 (13:31 -0700)] 
Merge branch 'mv/ssl-ftp-curl'

Does anybody really use commit walkers over (s)ftp?

* mv/ssl-ftp-curl:
  Support FTP-over-SSL/TLS for regular FTP

11 years agopretty: support %>> that steal trailing spaces
Nguyễn Thái Ngọc Duy [Thu, 18 Apr 2013 23:08:52 +0000 (09:08 +1000)] 
pretty: support %>> that steal trailing spaces

This is pretty useful in `%<(100)%s%Cred%>(20)% an' where %s does not
use up all 100 columns and %an needs more than 20 columns. By
replacing %>(20) with %>>(20), %an can steal spaces from %s.

%>> understands escape sequences, so %Cred does not stop it from
stealing spaces in %<(100).

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agopretty: support truncating in %>, %< and %><
Nguyễn Thái Ngọc Duy [Thu, 18 Apr 2013 23:08:51 +0000 (09:08 +1000)] 
pretty: support truncating in %>, %< and %><

%>(N,trunc) truncates the right part after N columns and replace the
last two letters with "..". ltrunc does the same on the left. mtrunc
cuts the middle out.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agopretty: support padding placeholders, %< %> and %><
Nguyễn Thái Ngọc Duy [Thu, 18 Apr 2013 23:08:50 +0000 (09:08 +1000)] 
pretty: support padding placeholders, %< %> and %><

Either %<, %> or %>< standing before a placeholder specifies how many
columns (at least as the placeholder can exceed it) it takes. Each
differs on how spaces are padded:

  %< pads on the right (aka left alignment)
  %> pads on the left (aka right alignment)
  %>< pads both ways equally (aka centered)

The (<N>) follows them, e.g. `%<(100)', to specify the number of
columns the next placeholder takes.

However, if '|' stands before (<N>), e.g. `%>|(100)', then the number
of columns is calculated so that it reaches the Nth column on screen.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agopretty: add %C(auto) for auto-coloring
Nguyễn Thái Ngọc Duy [Thu, 18 Apr 2013 23:08:49 +0000 (09:08 +1000)] 
pretty: add %C(auto) for auto-coloring

This is not simply convenient over %C(auto,xxx). Some placeholders
(actually only one, %d) do multi coloring and we can't emit a multiple
colors with %C(auto,xxx).

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agopretty: split color parsing into a separate function
Nguyễn Thái Ngọc Duy [Thu, 18 Apr 2013 23:08:48 +0000 (09:08 +1000)] 
pretty: split color parsing into a separate function

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agopretty: two phase conversion for non utf-8 commits
Nguyễn Thái Ngọc Duy [Thu, 18 Apr 2013 23:08:47 +0000 (09:08 +1000)] 
pretty: two phase conversion for non utf-8 commits

Always assume format_commit_item() takes an utf-8 string for string
handling simplicity (we can handle utf-8 strings, but can't with other
encodings).

If commit message is in non-utf8, or output encoding is not, then the
commit is first converted to utf-8, processed, then output converted
to output encoding. This of course only works with encodings that are
compatible with Unicode.

This also fixes the iso8859-1 test in t6006. It's supposed to create
an iso8859-1 commit, but the commit content in t6006 is in UTF-8.
t6006 is now converted back in UTF-8 (the downside is we can't put
utf-8 strings there anymore).

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoutf8.c: add reencode_string_len() that can handle NULs in string
Nguyễn Thái Ngọc Duy [Thu, 18 Apr 2013 23:08:46 +0000 (09:08 +1000)] 
utf8.c: add reencode_string_len() that can handle NULs in string

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoutf8.c: add utf8_strnwidth() with the ability to skip ansi sequences
Nguyễn Thái Ngọc Duy [Thu, 18 Apr 2013 23:08:45 +0000 (09:08 +1000)] 
utf8.c: add utf8_strnwidth() with the ability to skip ansi sequences

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoutf8.c: move display_mode_esc_sequence_len() for use by other functions
Nguyễn Thái Ngọc Duy [Thu, 18 Apr 2013 23:08:44 +0000 (09:08 +1000)] 
utf8.c: move display_mode_esc_sequence_len() for use by other functions

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agopretty: share code between format_decoration and show_decorations
Nguyễn Thái Ngọc Duy [Thu, 18 Apr 2013 23:08:43 +0000 (09:08 +1000)] 
pretty: share code between format_decoration and show_decorations

This also adds color support to format_decorations()

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agopretty-formats.txt: wrap long lines
Nguyễn Thái Ngọc Duy [Thu, 18 Apr 2013 23:08:42 +0000 (09:08 +1000)] 
pretty-formats.txt: wrap long lines

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agopretty: get the correct encoding for --pretty:format=%e
Nguyễn Thái Ngọc Duy [Thu, 18 Apr 2013 23:08:41 +0000 (09:08 +1000)] 
pretty: get the correct encoding for --pretty:format=%e

parse_commit_header() provides the commit encoding for '%e' and it
reads it from the re-encoded message, which contains the new encoding,
not the original one in the commit object. This never happens because
--pretty=format:xxx never respects i18n.logoutputencoding. But that's
a different story.

Get the commit encoding from logmsg_reencode() instead.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agopretty: save commit encoding from logmsg_reencode if the caller needs it
Nguyễn Thái Ngọc Duy [Thu, 18 Apr 2013 23:08:40 +0000 (09:08 +1000)] 
pretty: save commit encoding from logmsg_reencode if the caller needs it

The commit encoding is parsed by logmsg_reencode, there's no need for
the caller to re-parse it again. The reencoded message now has the new
encoding, not the original one. The caller would need to read commit
object again before parsing.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoUpdate draft release notes to 1.8.3
Junio C Hamano [Thu, 18 Apr 2013 19:02:42 +0000 (12:02 -0700)] 
Update draft release notes to 1.8.3

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoMerge branch 'maint'
Junio C Hamano [Thu, 18 Apr 2013 19:03:01 +0000 (12:03 -0700)] 
Merge branch 'maint'

* maint:
  remote-hg: fix commit messages

11 years agoMerge branch 'jk/test-trash'
Junio C Hamano [Thu, 18 Apr 2013 18:49:45 +0000 (11:49 -0700)] 
Merge branch 'jk/test-trash'

Fix longstanding issues with the test harness when used with --root=<there>
option.

* jk/test-trash:
  t/test-lib.sh: drop "$test" variable
  t/test-lib.sh: fix TRASH_DIRECTORY handling

11 years agoMerge branch 'th/t9903-symlinked-workdir'
Junio C Hamano [Thu, 18 Apr 2013 18:49:41 +0000 (11:49 -0700)] 
Merge branch 'th/t9903-symlinked-workdir'

* th/t9903-symlinked-workdir:
  t9903: Don't fail when run from path accessed through symlink

11 years agoMerge branch 'jk/merge-tree-added-identically'
Junio C Hamano [Thu, 18 Apr 2013 18:49:31 +0000 (11:49 -0700)] 
Merge branch 'jk/merge-tree-added-identically'

The resolution of some corner cases by "git merge-tree" were
inconsistent between top-of-the-tree and in a subdirectory.

* jk/merge-tree-added-identically:
  merge-tree: don't print entries that match "local"

11 years agoMerge branch 'jk/http-dumb-namespaces'
Junio C Hamano [Thu, 18 Apr 2013 18:49:21 +0000 (11:49 -0700)] 
Merge branch 'jk/http-dumb-namespaces'

Allow smart-capable HTTP servers to be restricted via the
GIT_NAMESPACE mechanism when talking with commit-walker clients
(they already do so when talking with smart HTTP clients).

* jk/http-dumb-namespaces:
  http-backend: respect GIT_NAMESPACE with dumb clients

11 years agoMerge branch 'rs/empty-archive'
Junio C Hamano [Thu, 18 Apr 2013 18:49:17 +0000 (11:49 -0700)] 
Merge branch 'rs/empty-archive'

Implementations of "tar" of BSD descend have found to have trouble
with reading an otherwise empty tar archive with pax headers and
causes an unnecessary test failure.

* rs/empty-archive:
  t5004: fix issue with empty archive test and bsdtar

11 years agoMerge branch 'fc/send-email-annotate'
Junio C Hamano [Thu, 18 Apr 2013 18:49:11 +0000 (11:49 -0700)] 
Merge branch 'fc/send-email-annotate'

Allows format-patch --cover-letter to be configurable; the most
notable is the "auto" mode to create cover-letter only for multi
patch series.

* fc/send-email-annotate:
  rebase-am: explicitly disable cover-letter
  format-patch: trivial cleanups
  format-patch: add format.coverLetter configuration variable
  log: update to OPT_BOOL
  format-patch: refactor branch name calculation
  format-patch: improve head calculation for cover-letter
  send-email: make annotate configurable

11 years agoMerge branch 'jc/push-2.0-default-to-simple' (early part)
Junio C Hamano [Thu, 18 Apr 2013 18:47:59 +0000 (11:47 -0700)] 
Merge branch 'jc/push-2.0-default-to-simple' (early part)

Adjust our tests for upcoming migration of the default value for the
"push.default" configuration variable to "simple" from "mixed".

* 'jc/push-2.0-default-to-simple' (early part):
  t5570: do not assume the "matching" push is the default
  t5551: do not assume the "matching" push is the default
  t5550: do not assume the "matching" push is the default
  t9401: do not assume the "matching" push is the default
  t9400: do not assume the "matching" push is the default
  t7406: do not assume the "matching" push is the default
  t5531: do not assume the "matching" push is the default
  t5519: do not assume the "matching" push is the default
  t5517: do not assume the "matching" push is the default
  t5516: do not assume the "matching" push is the default
  t5505: do not assume the "matching" push is the default
  t5404: do not assume the "matching" push is the default

11 years agoMerge branch 'jk/daemon-user-doc'
Junio C Hamano [Thu, 18 Apr 2013 18:47:23 +0000 (11:47 -0700)] 
Merge branch 'jk/daemon-user-doc'

Document where the configuration is read by the git-daemon when its --user
option is used.

* jk/daemon-user-doc:
  doc: clarify that "git daemon --user=<user>" option does not export HOME=~user

11 years agoMerge branch 'fc/completion'
Junio C Hamano [Thu, 18 Apr 2013 18:46:41 +0000 (11:46 -0700)] 
Merge branch 'fc/completion'

In addition to a user visible change to offer more options to cherry-pick,
generally cleans up and simplifies the code.

* fc/completion:
  completion: small optimization
  completion: inline __gitcomp_1 to its sole callsite
  completion: get rid of compgen
  completion: add __gitcomp_nl tests
  completion: add new __gitcompadd helper
  completion: get rid of empty COMPREPLY assignments
  completion: trivial test improvement
  completion: add more cherry-pick options

11 years agoMerge branch 'kb/co-orphan-suggestion-short-sha1'
Junio C Hamano [Thu, 18 Apr 2013 18:46:33 +0000 (11:46 -0700)] 
Merge branch 'kb/co-orphan-suggestion-short-sha1'

Update the informational message when "git checkout" leaves the
detached head state.

* kb/co-orphan-suggestion-short-sha1:
  checkout: abbreviate hash in suggest_reattach

11 years agoMerge branch 'jc/detached-head-doc'
Junio C Hamano [Thu, 18 Apr 2013 18:46:29 +0000 (11:46 -0700)] 
Merge branch 'jc/detached-head-doc'

* jc/detached-head-doc:
  glossary: extend "detached HEAD" description

11 years agoMerge branch 'tr/packed-object-info-wo-recursion'
Junio C Hamano [Thu, 18 Apr 2013 18:46:23 +0000 (11:46 -0700)] 
Merge branch 'tr/packed-object-info-wo-recursion'

Attempts to reduce the stack footprint of sha1_object_info()
and unpack_entry() codepaths.

* tr/packed-object-info-wo-recursion:
  sha1_file: remove recursion in unpack_entry
  Refactor parts of in_delta_base_cache/cache_or_unpack_entry
  sha1_file: remove recursion in packed_object_info

11 years agoMerge branch 'jk/http-error-messages'
Junio C Hamano [Thu, 18 Apr 2013 18:42:08 +0000 (11:42 -0700)] 
Merge branch 'jk/http-error-messages'

A regression fix for the recently graduated topic.

* jk/http-error-messages:
  http: set curl FAILONERROR each time we select a handle

11 years agot6200: avoid path mangling issue on Windows
Johannes Sixt [Thu, 18 Apr 2013 06:42:25 +0000 (08:42 +0200)] 
t6200: avoid path mangling issue on Windows

MSYS bash interprets the slash in the argument core.commentchar="/"
as root directory and mangles it into a Windows style path. Use a
different core.commentchar to dodge the issue.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoremote-hg: fix commit messages
Felipe Contreras [Thu, 18 Apr 2013 06:06:31 +0000 (01:06 -0500)] 
remote-hg: fix commit messages

git fast-import expects an extra newline after the commit message data,
but we are adding it only on hg-git compat mode, which is why the
bidirectionality tests pass.

We should add it unconditionally.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agogit add: rework the logic to warn "git add <pathspec>..." default change
Junio C Hamano [Wed, 17 Apr 2013 19:32:21 +0000 (12:32 -0700)] 
git add: rework the logic to warn "git add <pathspec>..." default change

The earlier logic to warn against "git add subdir" that is run
without "-A" or "--no-all" was only to check any <pathspec> given
exactly spells a directory name that (still) exists on the
filesystem.  This had number of problems:

 * "git add '*dir'" (note that the wildcard is hidden from the
   shell) would not trigger the warning.

 * "git add '*.py'" would behave differently between the current
   version of Git and Git 2.0 for the same reason as "subdir", but
   would not trigger the warning.

 * "git add dir" for a submodule "dir" would just update the index
   entry for the submodule "dir" without ever recursing into it, and
   use of "-A" or "--no-all" would matter.  But the logic only
   checks the directory-ness of "dir" and gives an unnecessary
   warning.

Rework the logic to detect the case where the behaviour will be
different in Git 2.0, and issue a warning only when it matters.
Even with the code before this warning, "git add subdir" will have
to traverse the directory in order to find _new_ files the index
does not know about _anyway_, so we can do this check without adding
an extra pass to find if <pathspec> matches any removed file.

This essentially updates the "add_files_to_cache()" public API to
"update_files_in_cache()" API that is internal to "git add", because
with the "--all" option, the function is no longer about "adding"
paths to the cache, but is also used to remove them.

There are other callers of the former from "checkout" (used when
"checkout -m" prepares the temporary tree that represents the local
modifications to be merged) and "commit" ("commit --include" that
picks up local changes in addition to what is in the index).  Since
ADD_CACHE_IGNORE_ERRORS (aka "--no-all") is not used by either of
them, once dust settles after Git 2.0 and the warning becomes
unnecessary, we may want to unify these two functions again.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agogitweb/INSTALL: GITWEB_CONFIG_SYSTEM is for backward compatibility
Jonathan Nieder [Tue, 16 Apr 2013 22:26:00 +0000 (15:26 -0700)] 
gitweb/INSTALL: GITWEB_CONFIG_SYSTEM is for backward compatibility

Highlight that CONFIG_SYSTEM and /etc/gitweb.conf are meant to be
the fallback configuration file in BUGS section of gitweb.conf
documentation.  This will hopefully help people who expect them to
be a common default, which unfortunately came later in the history.

11 years agoblame: handle broken commit headers gracefully
René Scharfe [Wed, 17 Apr 2013 18:33:54 +0000 (20:33 +0200)] 
blame: handle broken commit headers gracefully

split_ident_line() can leave us with the pointers date_begin, date_end,
tz_begin and tz_end all set to NULL.  Check them before use and supply
the same fallback values as in the case of a negative return code from
split_ident_line().

The "(unknown)" is not actually shown in the output, though, because it
will be converted to a number (zero) eventually.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agopretty: handle broken commit headers gracefully
René Scharfe [Wed, 17 Apr 2013 18:33:35 +0000 (20:33 +0200)] 
pretty: handle broken commit headers gracefully

Centralize the parsing of the date and time zone strings in the new
helper function show_ident_date() and make sure it checks the pointers
provided by split_ident_line() for NULL before use.

Reported-by: Ivan Lyapunov <dront78@gmail.com>
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agocat-file: print tags raw for "cat-file -p"
Jeff King [Wed, 17 Apr 2013 21:00:48 +0000 (17:00 -0400)] 
cat-file: print tags raw for "cat-file -p"

When "cat-file -p" prints commits, it shows them in their
raw format, since git's format is already human-readable.
For tags, however, we print the whole thing raw except for
one thing: we convert the timestamp on the tagger line into a
human-readable date.

This dates all the way back to a0f15fa (Pretty-print tagger
dates, 2006-03-01). At that time there was no other way to
pretty-print a tag.  These days, however, neither of those
matters much. The normal way to pretty-print a tag is with
"git show", which is much more flexible than "cat-file -p".

Commit a0f15fa also built "verify-tag --verbose" (and
subsequently "tag -v") around the "cat-file -p" output.
However, that behavior was lost in commit 62e09ce (Make git
tag a builtin, 2007-07-20), and we went back to printing
the raw tag contents. Nobody seems to have noticed the bug
since then (and it is arguably a saner behavior anyway, as
it shows the actual bytes for which we verified the
signature).

Let's drop the tagger-date formatting for "cat-file -p". It
makes us more consistent with cat-file's commit
pretty-printer, and as a bonus, we can drop the hand-rolled
tag parsing code in cat-file (which happened to behave
inconsistently with the tag pretty-printing code elsewhere).

This is a change of output format, so it's possible that
some callers could considered this a regression. However,
the original behavior was arguably a bug (due to the
inconsistency with commits), likely nobody was relying on it
(even we do not use it ourselves these days), and anyone
relying on the "-p" pretty-printer should be able to expect
a change in the output format (i.e., while "cat-file" is
plumbing, the output format of "-p" was never guaranteed to
be stable).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoconvert.c: remove duplicate code
Lukas Fleischer [Sat, 13 Apr 2013 13:28:32 +0000 (15:28 +0200)] 
convert.c: remove duplicate code

The has_cr_in_index() function is an almost 1:1 copy of
read_blob_data_from_index() with some additions.  Use the
latter instead of using copy-pasted code.

Signed-off-by: Lukas Fleischer <git@cryptocrack.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoread_blob_data_from_index(): optionally return the size of blob data
Lukas Fleischer [Sat, 13 Apr 2013 13:28:31 +0000 (15:28 +0200)] 
read_blob_data_from_index(): optionally return the size of blob data

This allows for optionally getting the size of the returned data and
will be used in a follow-up patch.

Signed-off-by: Lukas Fleischer <git@cryptocrack.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoattr.c: extract read_index_data() as read_blob_data_from_index()
Lukas Fleischer [Sat, 13 Apr 2013 13:28:30 +0000 (15:28 +0200)] 
attr.c: extract read_index_data() as read_blob_data_from_index()

Extract the read_index_data() function from attr.c and move it to
read-cache.c; rename it to read_blob_data_from_index() and update
the function signature of it to align better with index/cache API
functions.

This allows for reusing the function in convert.c later.

Signed-off-by: Lukas Fleischer <git@cryptocrack.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoMerge branch 'maint'
Junio C Hamano [Tue, 16 Apr 2013 22:14:44 +0000 (15:14 -0700)] 
Merge branch 'maint'

* maint:
  help.c: add a compatibility comment to cmd_version()

11 years agorun-command: use thread-aware die_is_recursing routine
Jeff King [Tue, 16 Apr 2013 19:50:07 +0000 (15:50 -0400)] 
run-command: use thread-aware die_is_recursing routine

If we die from an async thread, we do not actually exit the
program, but just kill the thread. This confuses the static
counter in usage.c's default die_is_recursing function; it
updates the counter once for the thread death, and then when
the main program calls die() itself, it erroneously thinks
we are recursing. The end result is that we print "recursion
detected in die handler" instead of the real error in such a
case (the easiest way to trigger this is having a remote
connection hang up while running a sideband demultiplexer).

This patch solves it by using a per-thread counter when the
async_die function is installed; we detect recursion in each
thread (including the main one), but they do not step on
each other's toes.

Other threaded code does not need to worry about this, as
they do not install specialized die handlers; they just let
a die() from a sub-thread take down the whole program.

Since we are overriding the default recursion-check
function, there is an interesting corner case that is not a
problem, but bears some explanation. Imagine the main thread
calls die(), and then in the die_routine starts an async
call. We will switch to using thread-local storage, which
starts at 0, for the main thread's counter, even though
the original counter was actually at 1. That's OK, though,
for two reasons:

  1. It would miss only the first level of recursion, and
     would still find recursive failures inside the async
     helper.

  2. We do not currently and are not likely to start doing
     anything as heavyweight as starting an async routine
     from within a die routine or helper function.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agousage: allow pluggable die-recursion checks
Jeff King [Tue, 16 Apr 2013 19:46:22 +0000 (15:46 -0400)] 
usage: allow pluggable die-recursion checks

When any git code calls die or die_errno, we use a counter
to detect recursion into the die functions from any of the
helper functions. However, such a simple counter is not good
enough for threaded programs, which may call die from a
sub-thread, killing only the sub-thread (but incrementing
the counter for everyone).

Rather than try to deal with threads ourselves here, let's
just allow callers to plug in their own recursion-detection
function. This is similar to how we handle the die routine
(the caller plugs in a die routine which may kill only the
sub-thread).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agohelp.c: add a compatibility comment to cmd_version()
David Aguilar [Tue, 16 Apr 2013 20:33:25 +0000 (13:33 -0700)] 
help.c: add a compatibility comment to cmd_version()

External projects have been known to parse the output of
"git version".  Help prevent future authors from changing
its format by adding a comment to its implementation.

Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoconvert: The native line-ending is \r\n on MinGW
Jonathan Nieder [Sat, 4 Sep 2010 08:25:09 +0000 (03:25 -0500)] 
convert: The native line-ending is \r\n on MinGW

If you try this:

 1. Install Git for Windows (from the msysgit project)

 2. Put

[core]
autocrlf = false
eol = native

    in your .gitconfig.

 3. Clone a project with

*.txt text

    in its .gitattributes.

Then with current git, any text files checked out have LF line
endings, instead of the expected CRLF.

Cc: Johannes Schindelin <johannes.schindelin@gmx.de>
Cc: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoread_revisions_from_stdin: make copies for handle_revision_arg
Thomas Rast [Tue, 16 Apr 2013 09:57:45 +0000 (11:57 +0200)] 
read_revisions_from_stdin: make copies for handle_revision_arg

read_revisions_from_stdin() has passed pointers to its read buffer
down to handle_revision_arg() since its inception way back in 42cabc3
(Teach rev-list an option to read revs from the standard input.,
2006-09-05).  Even back then, this was a bug: through
add_pending_object, the argument was recorded in the object_array's
'name' field.

Fix it by making a copy whenever read_revisions_from_stdin() passes an
argument down the callchain.  The other caller runs handle_revision_arg()
on argv[], where it would be redundant to make a copy.

Signed-off-by: Thomas Rast <trast@inf.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agohttp: set curl FAILONERROR each time we select a handle
Jeff King [Tue, 16 Apr 2013 00:30:38 +0000 (20:30 -0400)] 
http: set curl FAILONERROR each time we select a handle

Because we reuse curl handles for multiple requests, the
setup of a handle happens in two stages: stable, global
setup and per-request setup. The lifecycle of a handle is
something like:

  1. get_curl_handle; do basic global setup that will last
     through the whole program (e.g., setting the user
     agent, ssl options, etc)

  2. get_active_slot; set up a per-request baseline (e.g.,
     clearing the read/write functions, making it a GET
     request, etc)

  3. perform the request with curl_*_perform functions

  4. goto step 2 to perform another request

Breaking it down this way means we can avoid doing global
setup from step (1) repeatedly, but we still finish step (2)
with a predictable baseline setup that callers can rely on.

Until commit 6d052d7 (http: add HTTP_KEEP_ERROR option,
2013-04-05), setting curl's FAILONERROR option was a global
setup; we never changed it. However, 6d052d7 introduced an
option where some requests might turn off FAILONERROR. Later
requests using the same handle would have the option
unexpectedly turned off, which meant they would not notice
http failures at all.

This could easily be seen in the test-suite for the
"half-auth" cases of t5541 and t5551. The initial requests
turned off FAILONERROR, which meant it was erroneously off
for the rpc POST. That worked fine for a successful request,
but meant that we failed to react properly to the HTTP 401
(instead, we treated whatever the server handed us as a
successful message body).

The solution is simple: now that FAILONERROR is a
per-request setting, we move it to get_active_slot to make
sure it is reset for each request.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoi18n: branch: mark strings for translation
Jiang Xin [Tue, 16 Apr 2013 03:37:50 +0000 (11:37 +0800)] 
i18n: branch: mark strings for translation

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
Reviewed-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoremote-bzr: fix prefix of tags
Felipe Contreras [Mon, 15 Apr 2013 21:47:28 +0000 (16:47 -0500)] 
remote-bzr: fix prefix of tags

In the current transport-helper code, refs without namespaced refspecs don't
work correctly, so let's always use them.

Some people reported issues with 'git clone --mirror', and this fixes them, as
well as possibly others.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoUpdate draft release notes to 1.8.3
Junio C Hamano [Mon, 15 Apr 2013 19:45:15 +0000 (12:45 -0700)] 
Update draft release notes to 1.8.3

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoMerge branch 'jk/diff-graph-submodule-summary'
Junio C Hamano [Mon, 15 Apr 2013 19:41:01 +0000 (12:41 -0700)] 
Merge branch 'jk/diff-graph-submodule-summary'

Make "git diff --graph" work better with submodule log output.

* jk/diff-graph-submodule-summary:
  submodule: print graph output next to submodule log

11 years agoMerge branch 'jk/diff-algo-finishing-touches'
Junio C Hamano [Mon, 15 Apr 2013 19:40:58 +0000 (12:40 -0700)] 
Merge branch 'jk/diff-algo-finishing-touches'

"git diff --diff-algorithm algo" is also understood as "git diff
--diff-algorithm=algo".

* jk/diff-algo-finishing-touches:
  diff: allow unstuck arguments with --diff-algorithm
  git-merge(1): document diff-algorithm option to merge-recursive

11 years agoMerge branch 'rt/commentchar-fmt-merge-msg'
Junio C Hamano [Mon, 15 Apr 2013 19:40:56 +0000 (12:40 -0700)] 
Merge branch 'rt/commentchar-fmt-merge-msg'

The new core.commentchar configuration was not applied to a few
places.

* rt/commentchar-fmt-merge-msg:
  fmt-merge-msg: use core.commentchar in tag signatures completely
  fmt-merge-msg: respect core.commentchar in people credits

11 years agoMerge branch 'lf/bundle-with-tip-wo-message'
Junio C Hamano [Mon, 15 Apr 2013 19:40:51 +0000 (12:40 -0700)] 
Merge branch 'lf/bundle-with-tip-wo-message'

"git bundle" did not like a bundle created using a commit without
any message as its one of the prerequistes.

* lf/bundle-with-tip-wo-message:
  bundle: Accept prerequisites without commit messages

11 years agoMerge branch 'jk/show-branch-strbuf'
Junio C Hamano [Mon, 15 Apr 2013 19:40:49 +0000 (12:40 -0700)] 
Merge branch 'jk/show-branch-strbuf'

"git show-branch" was not prepared to show a very long run of
ancestor operators e.g. foobar^2~2^2^2^2...^2~4 correctly.

* jk/show-branch-strbuf:
  show-branch: use strbuf instead of static buffer

11 years agoMerge branch 'jk/http-error-messages'
Junio C Hamano [Mon, 15 Apr 2013 19:40:46 +0000 (12:40 -0700)] 
Merge branch 'jk/http-error-messages'

Improve error reporting from the http transfer clients.

* jk/http-error-messages:
  http: drop http_error function
  remote-curl: die directly with http error messages
  http: re-word http error message
  http: simplify http_error helper function
  remote-curl: consistently report repo url for http errors
  remote-curl: always show friendlier 404 message
  remote-curl: let servers override http 404 advice
  remote-curl: show server content on http errors
  http: add HTTP_KEEP_ERROR option

11 years agoMerge branch 'tr/perl-keep-stderr-open'
Junio C Hamano [Mon, 15 Apr 2013 19:40:41 +0000 (12:40 -0700)] 
Merge branch 'tr/perl-keep-stderr-open'

Closing (not redirecting to /dev/null) the standard error stream is
not a very smart thing to do.  Later open may return file
descriptor #2 for unrelated purpose, and error reporting code may
write into them.

* tr/perl-keep-stderr-open:
  t9700: do not close STDERR
  perl: redirect stderr to /dev/null instead of closing

11 years agodir.c: git-status --ignored: don't scan the work tree twice
Karsten Blees [Mon, 15 Apr 2013 19:15:03 +0000 (21:15 +0200)] 
dir.c: git-status --ignored: don't scan the work tree twice

'git-status --ignored' still scans the work tree twice to collect
untracked and ignored files, respectively.

fill_directory / read_directory already supports collecting untracked and
ignored files in a single directory scan. However, the DIR_COLLECT_IGNORED
flag to enable this has some git-add specific side-effects (e.g. it
doesn't recurse into ignored directories, so listing ignored files with
--untracked=all doesn't work).

The DIR_SHOW_IGNORED flag doesn't list untracked files and returns ignored
files in dir_struct.entries[] (instead of dir_struct.ignored[] as
DIR_COLLECT_IGNORED). DIR_SHOW_IGNORED is used all throughout git.

We don't want to break the existing API, so lets introduce a new flag
DIR_SHOW_IGNORED_TOO that lists untracked as well as ignored files similar
to DIR_COLLECT_FILES, but will recurse into sub-directories based on the
other flags as DIR_SHOW_IGNORED does.

In dir.c::read_directory_recursive, add ignored files to either
dir_struct.entries[] or dir_struct.ignored[] based on the flags. Also move
the DIR_COLLECT_IGNORED case here so that filling result lists is in a
common place.

In wt-status.c::wt_status_collect_untracked, use the new flag and read
results from dir_struct.ignored[]. Remove the extra fill_directory call.

builtin/check-ignore.c doesn't call fill_directory, setting the git-add
specific DIR_COLLECT_IGNORED flag has no effect here. Remove for clarity.

Update API documentation to reflect the changes.

Performance: with this patch, 'git-status --ignored' is typically as fast
as 'git-status'.

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agodir.c: git-status --ignored: don't scan the work tree three times
Karsten Blees [Mon, 15 Apr 2013 19:14:22 +0000 (21:14 +0200)] 
dir.c: git-status --ignored: don't scan the work tree three times

'git-status --ignored' recursively scans directories up to three times:

 1. To collect untracked files.

 2. To collect ignored files.

 3. When collecting ignored files, to check that an untracked directory
    that potentially contains ignored files doesn't also contain untracked
    files (i.e. isn't already listed as untracked).

Let's get rid of case 3 first.

Currently, read_directory_recursive returns a boolean whether a directory
contains the requested files or not (actually, it returns the number of
files, but no caller actually needs that), and DIR_SHOW_IGNORED specifies
what we're looking for.

To be able to test for both untracked and ignored files in a single scan,
we need to return a bit more info, and the result must be independent of
the DIR_SHOW_IGNORED flag.

Reuse the path_treatment enum as return value of read_directory_recursive.
Split path_handled in two separate values path_excluded and path_untracked
that don't change their meaning with the DIR_SHOW_IGNORED flag. We don't
need an extra value path_untracked_and_excluded, as directories with both
untracked and ignored files should be listed as untracked.

Rename path_ignored to path_none for clarity (i.e. "don't treat that path"
in contrast to "the path is ignored and should be treated according to
DIR_SHOW_IGNORED").

Replace enum directory_treatment with path_treatment. That's just another
enum with the same meaning, no need to translate back and forth.

In treat_directory, get rid of the extra read_directory_recursive call and
all the DIR_SHOW_IGNORED-specific code.

In read_directory_recursive, decide whether to dir_add_name path_excluded
or path_untracked paths based on the DIR_SHOW_IGNORED flag.

The return value of read_directory_recursive is the maximum path_treatment
of all files and sub-directories. In the check_only case, abort when we've
reached the most significant value (path_untracked).

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agodir.c: git-status: avoid is_excluded checks for tracked files
Karsten Blees [Mon, 15 Apr 2013 19:13:35 +0000 (21:13 +0200)] 
dir.c: git-status: avoid is_excluded checks for tracked files

Checking if a file is in the index is much faster (hashtable lookup) than
checking if the file is excluded (linear search over exclude patterns).

Skip is_excluded checks for files: move the cache_name_exists check from
treat_file to treat_one_path and return early if the file is tracked.

This can safely be done as all other code paths also return path_ignored
for tracked files, and dir_add_ignored skips tracked files as well.

There's just one line left in treat_file, so move this to treat_one_path
as well.

Here's some performance data for git-status from the linux and WebKit
repos (best of 10 runs on a Debian Linux on SSD, core.preloadIndex=true):

       |    status      | status --ignored
       | linux | WebKit | linux | WebKit
-------+-------+--------+-------+---------
before | 0.218 |  1.583 | 0.321 |  2.579
after  | 0.156 |  0.988 | 0.202 |  1.279
gain   | 1.397 |  1.602 | 1.589 |  2.016

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agodir.c: replace is_path_excluded with now equivalent is_excluded API
Karsten Blees [Mon, 15 Apr 2013 19:12:57 +0000 (21:12 +0200)] 
dir.c: replace is_path_excluded with now equivalent is_excluded API

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agodir.c: unify is_excluded and is_path_excluded APIs
Karsten Blees [Mon, 15 Apr 2013 19:12:14 +0000 (21:12 +0200)] 
dir.c: unify is_excluded and is_path_excluded APIs

The is_excluded and is_path_excluded APIs are very similar, except for a
few noteworthy differences:

is_excluded doesn't handle ignored directories, results for paths within
ignored directories are incorrect. This is probably based on the premise
that recursive directory scans should stop at ignored directories, which
is no longer true (in certain cases, read_directory_recursive currently
calls is_excluded *and* is_path_excluded to get correct ignored state).

is_excluded caches parsed .gitignore files of the last directory in struct
dir_struct. If the directory changes, it finds a common parent directory
and is very careful to drop only as much state as necessary. On the other
hand, is_excluded will also read and parse .gitignore files in already
ignored directories, which are completely irrelevant.

is_path_excluded correctly handles ignored directories by checking if any
component in the path is excluded. As it uses is_excluded internally, this
unfortunately forces is_excluded to drop and re-read all .gitignore files,
as there is no common parent directory for the root dir.

is_path_excluded tracks state in a separate struct path_exclude_check,
which is essentially a wrapper of dir_struct with two more fields. However,
as is_path_excluded also modifies dir_struct, it is not possible to e.g.
use multiple path_exclude_check structures with the same dir_struct in
parallel. The additional structure just unnecessarily complicates the API.

Teach is_excluded / prep_exclude about ignored directories: whenever
entering a new directory, first check if the entire directory is excluded.
Remember the excluded state in dir_struct. Don't traverse into already
ignored directories (i.e. don't read irrelevant .gitignore files).

Directories could also be excluded by exclude patterns specified on the
command line or .git/info/exclude, so we cannot simply skip prep_exclude
entirely if there's no .gitignore file name (dir_struct.exclude_per_dir).
Move this check to just before actually reading the file.

is_path_excluded is now equivalent to is_excluded, so we can simply
redirect to it (the public API is cleaned up in the next patch).

The performance impact of the additional ignored check per directory is
hardly noticeable when reading directories recursively (e.g. 'git status').
However, performance of git commands using the is_path_excluded API (e.g.
'git ls-files --cached --ignored --exclude-standard') is greatly improved
as this no longer re-reads .gitignore files on each call.

Here's some performance data from the linux and WebKit repos (best of 10
runs on a Debian Linux on SSD, core.preloadIndex=true):

       | ls-files -ci   |    status      | status --ignored
       | linux | WebKit | linux | WebKit | linux | WebKit
-------+-------+--------+-------+--------+-------+---------
before | 0.506 |  6.539 | 0.212 |  1.555 | 0.323 |  2.541
after  | 0.080 |  1.191 | 0.218 |  1.583 | 0.321 |  2.579
gain   | 6.325 |  5.490 | 0.972 |  0.982 | 1.006 |  0.985

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agodir.c: move prep_exclude
Karsten Blees [Mon, 15 Apr 2013 19:11:37 +0000 (21:11 +0200)] 
dir.c: move prep_exclude

Move prep_exclude in preparation for the next patch.

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agodir.c: factor out parts of last_exclude_matching for later reuse
Karsten Blees [Mon, 15 Apr 2013 19:11:02 +0000 (21:11 +0200)] 
dir.c: factor out parts of last_exclude_matching for later reuse

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agodir.c: git-clean -d -X: don't delete tracked directories
Karsten Blees [Mon, 15 Apr 2013 19:10:05 +0000 (21:10 +0200)] 
dir.c: git-clean -d -X: don't delete tracked directories

The notion of "ignored tracked" directories introduced in 721ac4ed "dir.c:
Make git-status --ignored more consistent" has a few unwanted side effects:

 - git-clean -d -X: deletes ignored tracked directories. git-clean should
   never delete tracked content.

 - git-ls-files --ignored --other --directory: lists ignored tracked
   directories instead of "other" directories.

 - git-status --ignored: lists ignored tracked directories while contained
   files may be listed as modified. Paths listed by git-status should be
   disjoint (except in long format where a path may be listed in both the
   staged and unstaged section).

Additionally, the current behaviour violates documentation in gitignore(5)
("Specifies intentionally *untracked* files to ignore") and Documentation/
technical/api-directory-listing.txt ("DIR_SHOW_OTHER_DIRECTORIES: Include
a directory that is *not tracked*.").

In dir.c::treat_directory, remove the special handling of ignored tracked
directories, so that the DIR_SHOW_OTHER_DIRECTORIES flag only affects
"other" (i.e. untracked) directories. In dir.c::dir_add_name, check that
added paths are untracked even if DIR_SHOW_IGNORED is set.

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agodir.c: make 'git-status --ignored' work within leading directories
Karsten Blees [Mon, 15 Apr 2013 19:09:25 +0000 (21:09 +0200)] 
dir.c: make 'git-status --ignored' work within leading directories

'git-status --ignored path/' doesn't list ignored files and directories
within 'path' if some component of 'path' is classified as untracked.

Disable the DIR_SHOW_OTHER_DIRECTORIES flag while traversing leading
directories. This prevents treat_leading_path() with DIR_SHOW_IGNORED flag
from aborting at the top level untracked directory.

As a side effect, this also eliminates a recursive directory scan per
leading directory level, as treat_directory() can no longer call
read_directory_recursive() when called from treat_leading_path().

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agodir.c: git-status --ignored: don't list empty directories as ignored
Karsten Blees [Mon, 15 Apr 2013 19:08:42 +0000 (21:08 +0200)] 
dir.c: git-status --ignored: don't list empty directories as ignored

'git-status --ignored' lists empty untracked directories as ignored, even
though they don't have any ignored files.

When checking if a directory is already listed as untracked (i.e. shouldn't
be listed as ignored as well), don't assume that the directory has only
ignored files if it doesn't have untracked files, as the directory may be
empty.

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agodir.c: git-ls-files --directories: don't hide empty directories
Karsten Blees [Mon, 15 Apr 2013 19:08:02 +0000 (21:08 +0200)] 
dir.c: git-ls-files --directories: don't hide empty directories

'git-ls-files --ignored --directories' hides empty directories even though
--no-empty-directory was not specified.

Treat the DIR_HIDE_EMPTY_DIRECTORIES flag independently from
DIR_SHOW_IGNORED to make all git-ls-files options work as expected.

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agodir.c: git-status --ignored: don't list empty ignored directories
Karsten Blees [Mon, 15 Apr 2013 19:07:16 +0000 (21:07 +0200)] 
dir.c: git-status --ignored: don't list empty ignored directories

'git-status --ignored' lists ignored tracked directories without any
ignored files if a tracked file happens to match an exclude pattern.

Always exclude tracked files.

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agodir.c: git-status --ignored: don't list files in ignored directories
Karsten Blees [Mon, 15 Apr 2013 19:06:30 +0000 (21:06 +0200)] 
dir.c: git-status --ignored: don't list files in ignored directories

'git-status --ignored' lists both the ignored directory and the ignored
files if the files are in a tracked sub directory.

When recursing into sub directories in read_directory_recursive, pass on
the check_only parameter so that we don't accidentally add the files.

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agodir.c: git-status --ignored: don't drop ignored directories
Karsten Blees [Mon, 15 Apr 2013 19:05:19 +0000 (21:05 +0200)] 
dir.c: git-status --ignored: don't drop ignored directories

'git-status --ignored' drops ignored directories if they contain untracked
files in an untracked sub directory.

Fix it by getting exact (recursive) excluded status in treat_directory.

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoglossary: improve definitions of refspec and pathspec
Thomas Ackermann [Mon, 15 Apr 2013 17:50:07 +0000 (19:50 +0200)] 
glossary: improve definitions of refspec and pathspec

The exact definition of "refspec" can be found in git-fetch and
git-push manpages. So don't duplicate this here in the glossary.

Actually the definition of "pathspec" should be moved to a separate
file akin to the way it's done with "refspec". But this will only be
wortwhile when there's more to say about it. So for the time being
just improve the first sentence a little bit; fix the indentation of
the first paragraph after the bullet list and remove the one-item
list of magic signatures with its - for the user - unnecessary
introduction of "magic word 'top'".

Signed-off-by: Thomas Ackermann <th.acker@arcor.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoThe name of the hash function is "SHA-1", not "SHA1"
Thomas Ackermann [Mon, 15 Apr 2013 17:49:04 +0000 (19:49 +0200)] 
The name of the hash function is "SHA-1", not "SHA1"

Use "SHA-1" instead of "SHA1" whenever we talk about the hash function.
When used as a programming symbol, we keep "SHA1".

Signed-off-by: Thomas Ackermann <th.acker@arcor.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoglossary: improve description of SHA-1 related topics
Thomas Ackermann [Mon, 15 Apr 2013 17:47:50 +0000 (19:47 +0200)] 
glossary: improve description of SHA-1 related topics

The name of the hash function is "SHA-1", not "SHA1".

Also to people who look up "object name" in the glossary,
the details of which hash function is applied on what to
compute "object name" is not important but the fact that the
name is meant to be an unique identifier for the contents
stored in the object is.

Signed-off-by: Thomas Ackermann <th.acker@arcor.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoglossary: remove outdated/misleading/irrelevant entries
Thomas Ackermann [Mon, 15 Apr 2013 17:46:56 +0000 (19:46 +0200)] 
glossary: remove outdated/misleading/irrelevant entries

Signed-off-by: Thomas Ackermann <th.acker@arcor.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agobranch: colour upstream branches
Felipe Contreras [Mon, 15 Apr 2013 02:37:49 +0000 (21:37 -0500)] 
branch: colour upstream branches

Otherwise when using 'git branch -vv' it's hard to see them among so
much output.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agobisect: Store first bad commit as comment in log file
Torstein Hegge [Sat, 13 Apr 2013 15:22:57 +0000 (17:22 +0200)] 
bisect: Store first bad commit as comment in log file

When bisect successfully finds a single revision, the first bad commit
should be shown to human readers of 'git bisect log'.

This resolves the apparent disconnect between the bisection result and
the log when a bug reporter says "I know that the first bad commit is
$rev, as you can see from $(git bisect log)".

Signed-off-by: Torstein Hegge <hegge@resisty.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agotransport-helper: add 'signed-tags' capability
John Keeping [Sun, 14 Apr 2013 10:57:08 +0000 (11:57 +0100)] 
transport-helper: add 'signed-tags' capability

This allows a remote helper using the 'export' protocol to specify that
it supports signed tags, changing the handing from 'warn-strip' to
'verbatim'.

Signed-off-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agotransport-helper: pass --signed-tags=warn-strip to fast-export
John Keeping [Sun, 14 Apr 2013 10:57:07 +0000 (11:57 +0100)] 
transport-helper: pass --signed-tags=warn-strip to fast-export

Currently, attempting to push a signed tag to a remote helper which uses
fast-export results in the remote helper failing because the default
fast-export action for signed tags is "abort".  This is not helpful for
users because there is no way to pass additional arguments to
fast-export here, either from the remote helper or from the command
line.

In general, the signature will be invalidated by whatever transformation
a remote helper performs on a tag to push it to a repository in a
different format so the correct behaviour is to strip the tag.  Doing
this silently may surprise people, so use "warn-strip" to issue a
warning when a signed tag is encountered.

Signed-off-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agofast-export: add --signed-tags=warn-strip mode
John Keeping [Sun, 14 Apr 2013 10:57:06 +0000 (11:57 +0100)] 
fast-export: add --signed-tags=warn-strip mode

This issues a warning while stripping signatures from signed tags, which
allows us to use it as default behaviour for remote helpers which cannot
specify how to handle signed tags.

Signed-off-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agocheckout: add --ignore-skip-worktree-bits in sparse checkout mode
Nguyễn Thái Ngọc Duy [Fri, 12 Apr 2013 23:12:08 +0000 (09:12 +1000)] 
checkout: add --ignore-skip-worktree-bits in sparse checkout mode

"git checkout -- <paths>" is usually used to restore all modified
files in <paths>. In sparse checkout mode, this command is overloaded
with another meaning: to add back all files in <paths> that are
excluded by sparse patterns.

As the former makes more sense for day-to-day use. Switch it to the
default and the latter enabled with --ignore-skip-worktree-bits.

While at there, add info/sparse-checkout to gitrepository-layout.txt

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>