Commit graph

7745 commits

Author SHA1 Message Date
Junio C Hamano d26792ad69 Merge branch 'pb/stash-refuse-to-kill'
"git stash save" is not just about "saving" the local changes, but
also is to restore the working tree state to that of HEAD. If you
changed a non-directory into a directory in the local change, you
may have untracked files in that directory, which have to be killed
while doing so, unless you run it with --include-untracked.  Teach
the command to detect and error out before spreading the damage.

This needed a small fix to "ls-files --killed".

* pb/stash-refuse-to-kill:
  git stash: avoid data loss when "git stash save" kills a directory
  treat_directory(): do not declare submodules to be untracked
2013-07-11 13:05:52 -07:00
Junio C Hamano e29497d28c Merge branch 'jg/status-config'
"git status" learned status.branch and status.short configuration
variables to use --branch and --short options by default (override
with --no-branch and --no-short options from the command line).

* jg/status-config:
  status/commit: make sure --porcelain is not affected by user-facing config
  commit: make it work with status.short
  status: introduce status.branch to enable --branch by default
  status: introduce status.short to enable --short by default
2013-07-11 13:05:34 -07:00
Junio C Hamano 3b8d2765c7 Merge branch 'jc/triangle-push-fixup'
Earlier remote.pushdefault (and per-branch branch.*.pushremote)
were introduced as an additional mechanism to choose what
repository to push into when "git push" did not say it from the
command line, to help people who push to a repository that is
different from where they fetch from.  This attempts to finish that
topic by teaching the default mechanism to choose branch in the
remote repository to be updated by such a push.

The 'current', 'matching' and 'nothing' modes (specified by the
push.default configuration variable) extend to such a "triangular"
workflow naturally, but 'upstream' and 'simple' have to be updated.

. 'upstream' is about pushing back to update the branch in the
  remote repository that the current branch fetches from and
  integrates with, it errors out in a triangular workflow.

. 'simple' is meant to help new people by avoiding mistakes, and
  will be the safe default in Git 2.0.

  In a non-triangular workflow, it will continue to act as a cross
  between 'upstream' and 'current' in that it pushes to the current
  branch's @{upstream} only when it is set to the same name as the
  current branch (e.g. your 'master' forks from the 'master' from
  the central repository).

  In a triangular workflow, this series tentatively defines it as
  the same as 'current', but we may have to tighten it to avoid
  surprises in some way.

* jc/triangle-push-fixup:
  t/t5528-push-default: test pushdefault workflows
  t/t5528-push-default: generalize test_push_*
  push: change `simple` to accommodate triangular workflows
  config doc: rewrite push.default section
  t/t5528-push-default: remove redundant test_config lines
2013-07-11 13:03:21 -07:00
John Keeping 153d7265ef pull: change the description to "integrate" changes
Since git-pull learned the --rebase option it has not just been about
merging changes from a remote repository (where "merge" is in the sense
of "git merge").  Change the description to use "integrate" instead of
"merge" in order to reflect this.

Signed-off-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-08 12:44:01 -07:00
John Keeping 7da9800fff git-config(1): clarify precedence of multiple values
In order to clarify which value is used when there are multiple values
defined for a key, re-order the list of file locations so that it runs
from least specific to most specific.  Then add a paragraph which simply
says that the last value will be used.

Signed-off-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-07 13:34:31 -07:00
Ramkumar Ramachandra 3087b615ab name-rev doc: rewrite --stdin paragraph
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-07 11:17:50 -07:00
Fraser Tweedale 8240943bd7 diff-options: document default similarity index
The default similarity index of 50% is documented in gitdiffcore(7)
but it is worth also mentioning it in the description of the
-M/--find-renames option.

Signed-off-by: Fraser Tweedale <frase@frase.id.au>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-05 23:14:37 -07:00
Tony Finch ad9c2e22ca gitweb: allow extra breadcrumbs to prefix the trail
There are often parent pages logically above the gitweb projects
list, e.g. home pages of the organization and department that host
the gitweb server. This change allows you to include links to those
pages in gitweb's breadcrumb trail.

Signed-off-by: Tony Finch <dot@dotat.at>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-04 21:52:15 -07:00
Junio C Hamano 56df44a987 Merge branch 'maint'
* maint:
  Update draft release notes to 1.8.3.3
  git-config: update doc for --get with multiple values
2013-07-03 15:43:49 -07:00
Junio C Hamano 81a199bb1c Update draft release notes to 1.8.3.3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-03 15:43:41 -07:00
Junio C Hamano 4efd16543f Merge branch 'rr/diffcore-pickaxe-doc' into maint
* rr/diffcore-pickaxe-doc:
  diffcore-pickaxe doc: document -S and -G properly
  diffcore-pickaxe: make error messages more consistent
2013-07-03 15:41:17 -07:00
Junio C Hamano 213d25648a Merge branch 'cr/git-work-tree-sans-git-dir' into maint
* cr/git-work-tree-sans-git-dir:
  git.txt: remove stale comment regarding GIT_WORK_TREE
2013-07-03 15:41:05 -07:00
Junio C Hamano 15afe9596c Merge branch 'rh/merge-options-doc-fix' into maint
* rh/merge-options-doc-fix:
  Documentation/merge-options.txt: restore `-e` option
2013-07-03 15:36:30 -07:00
Junio C Hamano c9d9a2d6b6 Merge branch 'an/diff-index-doc' into maint
* an/diff-index-doc:
  Documentation/diff-index: mention two modes of operation
2013-07-03 15:35:55 -07:00
Junio C Hamano dfc6b040d0 Merge branch 'maint-1.8.2' into maint
* maint-1.8.2:
  git-config: update doc for --get with multiple values
2013-07-03 15:27:19 -07:00
Junio C Hamano f59bebb78e Merge branch 'maint-1.8.1' into maint-1.8.2
* maint-1.8.1:
  git-config: update doc for --get with multiple values
2013-07-03 15:26:53 -07:00
Michael Schubert d6ac1d2120 Change "remote tracking" to "remote-tracking"
Fix a typo ("remote remote-tracking") going back to the big cleanup
in 2010 (8b3f3f84 etc). Also, remove some more occurrences of
"tracking" and "remote tracking" in favor of "remote-tracking".

Signed-off-by: Michael Schubert <mschub@elegosoft.com>
Reviewed-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-03 13:27:15 -07:00
Jeff King a90804752f teach format-patch to place other authors into in-body "From"
Format-patch generates emails with the "From" address set to the
author of each patch. If you are going to send the emails, however,
you would want to replace the author identity with yours (if they
are not the same), and bump the author identity to an in-body
header.

Normally this is handled by git-send-email, which does the
transformation before sending out the emails. However, some
workflows may not use send-email (e.g., imap-send, or a custom
script which feeds the mbox to a non-git MUA). They could each
implement this feature themselves, but getting it right is
non-trivial (one must canonicalize the identities by reversing any
RFC2047 encoding or RFC822 quoting of the headers, which has caused
many bugs in send-email over the years).

This patch takes a different approach: it teaches format-patch a
"--from" option which handles the ident check and in-body header
while it is writing out the email.  It's much simpler to do at this
level (because we haven't done any quoting yet), and any workflow
based on format-patch can easily turn it on.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-03 12:11:04 -07:00
John Keeping 62e91efafd git-config: update doc for --get with multiple values
Since commit 00b347d (git-config: do not complain about duplicate
entries, 2012-10-23), "git config --get" does not exit with an error if
there are multiple values for the specified key but instead returns the
last value.  Update the documentation to reflect this.

Signed-off-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-03 11:48:15 -07:00
Fredrik Gustafsson 275cd184d5 Add --depth to submodule update/add
Add the --depth option to the add and update commands of "git submodule",
which is then passed on to the clone command. This is useful when the
submodule(s) are huge and you're not really interested in anything but
the latest commit.

Tests are added and some indention adjustments were made to conform to the
rest of the testfile on "submodule update can handle symbolic links in pwd".

Signed-off-by: Fredrik Gustafsson <iveqy@iveqy.com>
Acked-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-03 10:33:32 -07:00
Chris Packham 6cb5728c43 submodule update: allow custom command to update submodule working tree
Users can set submodule.$name.update to '!command' which will cause
'command' to be run instead of checkout/merge/rebase. This allows
the user finer-grained control over how the update is done.

The primary motivation for this was interoperability with stgit;
however being able to intercept the submodule update process may
prove useful for integrating with or extending other tools.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-03 10:15:15 -07:00
Petr Baudis a73653130e git stash: avoid data loss when "git stash save" kills a directory
"stash save" is about saving the local change to the working tree,
but also about restoring the state of the last commit to the working
tree.  When a local change is to turn a non-directory to a directory,
in order to restore the non-directory, everything in the directory
needs to be removed.

Which is fine when running "git stash save --include-untracked",
but without that option, untracked, newly created files in the
directory will have to be discarded, if the state you are restoring
to has a non-directory at the same path as the directory.

Introduce a safety valve to fail the operation in such case, using
the "ls-files --killed" which was designed for this exact purpose.

The "stash save" is stopped when untracked files need to be
discarded because their leading path ceased to be a directory, and
the user is required to pass --force to really have the data
removed.

Signed-off-by: Petr Baudis <pasky@ucw.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-01 14:23:24 -07:00
Junio C Hamano 51f11d69b1 Update draft release notes to 1.8.4
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-01 12:46:41 -07:00
Junio C Hamano 7e5ad06f68 Merge branch 'rr/remote-branch-config-refresh'
The original way to specify remote repository using .git/branches/
used to have a nifty feature.  The code to support the feature was
still in a function but the caller was changed not to call it 5
years ago, breaking that feature and leaving the supporting code
unreachable.

* rr/remote-branch-config-refresh:
  t/t5505-remote: test multiple push/pull in remotes-file
  ls-remote doc: don't encourage use of branches-file
  ls-remote doc: rewrite <repository> paragraph
  ls-remote doc: fix example invocation on git.git
  t/t5505-remote: test url-with-# in branches-file
  remote: remove dead code in read_branches_file()
  t/t5505-remote: use test_path_is_missing
  t/t5505-remote: test push-refspec in branches-file
  t/t5505-remote: modernize style
2013-07-01 12:41:58 -07:00
Junio C Hamano eb3a4fc149 Merge branch 'ap/rebase-multiple-fixups'
Having multiple "fixup!" on a line in the rebase instruction sheet
did not work very well with "git rebase -i --autosquash".

* ap/rebase-multiple-fixups:
  lib-rebase: style: use write_script, <<-\EOF
  rebase -i: handle fixup! fixup! in --autosquash
2013-07-01 12:41:52 -07:00
Junio C Hamano 4b9a0deddc Merge branch 'kb/am-deprecate-resolved'
Promote "git am --continue" over "git am --resolved" for UI
consistency.

* kb/am-deprecate-resolved:
  am: replace uses of --resolved with --continue
2013-07-01 12:41:48 -07:00
Junio C Hamano 66929c423a Merge branch 'rr/column-doc'
* rr/column-doc:
  column doc: rewrite documentation for column.ui
2013-07-01 12:41:46 -07:00
Junio C Hamano 43f25ae7b8 Merge branch 'ft/doc-git-transport'
* ft/doc-git-transport:
  documentation: add git:// transport security notice
2013-07-01 12:41:43 -07:00
Junio C Hamano 0d07e98e74 Merge branch 'wk/doc-in-linux-3.x-era'
Update documentation to match more recent realities.

* wk/doc-in-linux-3.x-era:
  Documentation: Update 'linux-2.6.git' -> 'linux.git'
  Documentation: Update the NFS remote examples to use the staging repo
  doc/clone: Pick more compelling paths for the --reference example
  doc/clone: Remove the '--bare -l -s' example
2013-07-01 12:41:34 -07:00
Junio C Hamano 534f0e0996 Merge branch 'jc/topo-author-date-sort'
"git log" learned the "--author-date-order" option, with which the
output is topologically sorted and commits in parallel histories
are shown intermixed together based on the author timestamp.

* jc/topo-author-date-sort:
  t6003: add --author-date-order test
  topology tests: teach a helper to set author dates as well
  t6003: add --date-order test
  topology tests: teach a helper to take abbreviated timestamps
  t/lib-t6000: style fixes
  log: --author-date-order
  sort-in-topological-order: use prio-queue
  prio-queue: priority queue of pointers to structs
  toposort: rename "lifo" field
2013-07-01 12:41:23 -07:00
Junio C Hamano 7a3187eb78 Merge branch 'maint'
* maint:
  Start preparing for 1.8.3.3
  check-ignore doc: fix broken link to ls-files page
  test: spell 'ls-files --delete' option correctly in test descriptions
2013-06-30 15:45:43 -07:00
Junio C Hamano c1182d9297 Update draft release notes to 1.8.4
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-30 15:45:26 -07:00
Junio C Hamano 08585fd48d Merge branch 'ap/diff-ignore-blank-lines'
"git diff" learned a mode that ignores hunks whose change consists
only of additions and removals of blank lines, which is the same as
"diff -B" (ignore blank lines) of GNU diff.

* ap/diff-ignore-blank-lines:
  diff: add --ignore-blank-lines option
2013-06-30 15:39:53 -07:00
Junio C Hamano 96ffd4ca93 Merge branch 'nk/name-rev-abbreviated-refs'
"git name-rev --refs=tags/v*" were forbidden, which was a bit
inconvenient (you had to give a pattern to match refs fully, like
--refs=refs/tags/v*).

* nk/name-rev-abbreviated-refs:
  name-rev: allow to specify a subpath for --refs option
2013-06-30 15:39:41 -07:00
Junio C Hamano d9857bfd4d Merge branch 'jk/submodule-subdirectory-ok'
Allow various subcommands of "git submodule" to be run not from the
top of the working tree of the superproject.

* jk/submodule-subdirectory-ok:
  submodule: drop the top-level requirement
  rev-parse: add --prefix option
  submodule: show full path in error message
  t7403: add missing && chaining
  t7403: modernize style
  t7401: make indentation consistent
2013-06-30 15:39:35 -07:00
Junio C Hamano 43d11f4492 Start preparing for 1.8.3.3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-30 15:36:03 -07:00
Ramkumar Ramachandra 5a87e92232 check-ignore doc: fix broken link to ls-files page
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-30 12:34:14 -07:00
Junio C Hamano 3c36e8a40d Sync with 1.8.3.2 2013-06-28 14:57:09 -07:00
Junio C Hamano 3a461832c5 Git 1.8.3.2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-28 14:56:30 -07:00
Junio C Hamano ebeea52870 Merge branch 'maint'
* maint:
  Start preparing for 1.8.3.2
2013-06-27 14:48:54 -07:00
Junio C Hamano e2652c0bcf Start preparing for 1.8.3.2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-27 14:48:14 -07:00
Junio C Hamano fc78791b7c Merge branch 'nd/urls-doc-no-file-hyperlink-fix' into maint
* nd/urls-doc-no-file-hyperlink-fix:
  urls.txt: avoid auto converting to hyperlink
2013-06-27 14:38:12 -07:00
Junio C Hamano 1ec379fff8 Merge branch 'tr/push-no-verify-doc' into maint
* tr/push-no-verify-doc:
  Document push --no-verify
2013-06-27 14:38:09 -07:00
Junio C Hamano 0fb2c97c20 Merge branch 'mh/fetch-into-shallow' into maint
* mh/fetch-into-shallow:
  t5500: add test for fetching with an unknown 'shallow'
  upload-pack: ignore 'shallow' lines with unknown obj-ids
2013-06-27 14:37:41 -07:00
Junio C Hamano 11fbc0b1e1 Merge branch 'jh/checkout-auto-tracking' into maint
* jh/checkout-auto-tracking:
  glossary: Update and rephrase the definition of a remote-tracking branch
  branch.c: Validate tracking branches with refspecs instead of refs/remotes/*
  t9114.2: Don't use --track option against "svn-remote"-tracking branches
  t7201.24: Add refspec to keep --track working
  t3200.39: tracking setup should fail if there is no matching refspec.
  checkout: Use remote refspecs when DWIMming tracking branches
  t2024: Show failure to use refspec when DWIMming remote branch names
  t2024: Add tests verifying current DWIM behavior of 'git checkout <branch>'
2013-06-27 14:37:21 -07:00
Junio C Hamano a75f9f053d Update draft release notes to 1.8.4
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-27 14:32:59 -07:00
Junio C Hamano fa4bf9edb9 Merge branch 'rr/rebase-stash-store'
Finishing touches for the "git rebase --autostash" feature
introduced earlier.

* rr/rebase-stash-store:
  rebase: use 'git stash store' to simplify logic
  stash: introduce 'git stash store'
  stash: simplify option parser for create
  stash doc: document short form -p in synopsis
  stash doc: add a warning about using create
2013-06-27 14:29:41 -07:00
Andrew Pimlott 22c5b13636 rebase -i: handle fixup! fixup! in --autosquash
In rebase -i --autosquash, ignore all "fixup! " or "squash! " after the
first.  This supports the case when a git commit --fixup/--squash referred
to an earlier fixup/squash instead of the original commit (whether
intentionally, as when the user expressly meant to note that the commit
fixes an earlier fixup; or inadvertently, as when the user meant to refer to
the original commit with :/msg; or out of laziness, as when the user could
remember how to refer to the fixup but not the original).

In the todo list, the full commit message is preserved, in case it provides
useful cues to the user.  A test helper set_cat_todo_editor is introduced to
check this.

Helped-by: Thomas Rast <trast@inf.ethz.ch>
Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Andrew Pimlott <andrew@pimlott.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-27 13:52:41 -07:00
Kevin Bracey 8ceb6fbd63 am: replace uses of --resolved with --continue
git am was previously modified to provide --continue for consistency
with rebase, merge etc, and the documentation changed to showing
--continue as the primary form.

Complete the work by replacing remaining uses of --resolved by
--continue, most notably in suggested command reminders.

Signed-off-by: Kevin Bracey <kevin@bracey.fi>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-27 09:37:12 -07:00
Junio C Hamano 85318f521f Update draft release notes to 1.8.4
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-26 15:10:17 -07:00
Junio C Hamano 12dd2f6933 Merge branch 'ys/cygstart'
On Cygwin, recognize "cygstart" as a possible way to start a web
browser (used in "help -w" and "instaweb" among others).

* ys/cygstart:
  web--browse: support /usr/bin/cygstart on Cygwin
2013-06-26 15:08:01 -07:00
Junio C Hamano 0784466657 Merge branch 'wk/doc-git-has-grown'
* wk/doc-git-has-grown:
  user-manual: Update download size for Git and the kernel
2013-06-26 15:07:55 -07:00
Junio C Hamano 2ddc898bc0 Merge branch 'ph/builtin-srcs-are-in-subdir-these-days'
* ph/builtin-srcs-are-in-subdir-these-days:
  fix "builtin-*" references to be "builtin/*"
2013-06-26 15:07:48 -07:00
Junio C Hamano 9a17e9ad15 Merge branch 'mm/merge-in-dirty-worktree-doc'
* mm/merge-in-dirty-worktree-doc:
  Documentation/git-merge.txt: weaken warning about uncommited changes
2013-06-26 15:07:43 -07:00
Junio C Hamano a036e4ebbf Merge branch 'kb/diff-blob-blob-doc'
* kb/diff-blob-blob-doc:
  Documentation: Move "git diff <blob> <blob>"
2013-06-26 15:07:41 -07:00
Junio C Hamano 14c6ee99ae Merge branch 'mm/push-force-is-dangerous'
* mm/push-force-is-dangerous:
  Documentation/git-push.txt: explain better cases where --force is dangerous
2013-06-26 15:07:38 -07:00
Fraser Tweedale 20618016df documentation: add git:// transport security notice
The fact that the git:// transport does no authentication is easily
overlooked.  For example, DNS poisoning may result in fetching from
somewhere that was not intended.

Add a brief security notice to the "GIT URLS" section
of the documentation stating that the git transport should be used
with caution on unsecured networks.

Signed-off-by: Fraser Tweedale <frase@frase.id.au>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-26 13:55:37 -07:00
Jiang Xin c0be6b4c8a git-clean: add documentation for interactive git-clean
Add new section "Interactive mode" for documentation of interactive
git-clean.

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-26 11:25:11 -07:00
Jiang Xin 7a9b0b802e git-clean: add colors to interactive git-clean
Show header, help, error messages, and prompt in colors for interactive
git-clean. Re-use config variables, such as "color.interactive" and
"color.interactive.<slot>" for command `git-add--interactive`.

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
Comments-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-26 11:25:11 -07:00
Jiang Xin 1b8fd46732 git-clean: show items of del_list in columns
When there are lots of items to be cleaned, it is hard to see them all
in one screen. Show them in columns will solve this problem.

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
Comments-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-26 11:25:11 -07:00
Jiang Xin 1769600208 git-clean: add support for -i/--interactive
Show what would be done and the user must confirm before actually
cleaning.

    Would remove ...
    Would remove ...
    Would remove ...

    Remove [y/n]?

Press "y" to start cleaning, and press "n" if you want to abort.

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-26 11:25:11 -07:00
Ramkumar Ramachandra 5e62cc14c3 column doc: rewrite documentation for column.ui
The configuration option column.ui is very poorly documented, and it is
unclear what the defaults are, and what option can be combined with
what.  Rewrite it by splitting up the options into three sections
clearly showing how COL_ENABLED, COL_LAYOUT_MASK, and COL_DENSE work.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-26 08:51:43 -07:00
Junio C Hamano 9832cb9d4d Update draft release notes to 1.8.4
For now, comment out the description on two "git status" UI
configuration, until the reverted topic can be resurrected.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-24 13:53:56 -07:00
Junio C Hamano 869577e5fe Merge branch 'nk/config-local-doc'
* nk/config-local-doc:
  config: Add description of --local option
2013-06-24 13:48:55 -07:00
Junio C Hamano c47d4380c7 Merge branch 'jk/doc-build-move-infordir-def'
Makefile cleanup.

* jk/doc-build-move-infordir-def:
  Documentation/Makefile: move infodir to be with other '*dir's
  Documentation/Makefile: fix spaces around assignments
2013-06-24 13:48:52 -07:00
Junio C Hamano 8d8975aca7 Merge branch 'mm/rm-coalesce-errors'
Give a single message followed by list of paths from "git rm" to
report multiple paths that cannot be removed.

* mm/rm-coalesce-errors:
  rm: introduce advice.rmHints to shorten messages
  rm: better error message on failure for multiple files
2013-06-24 13:48:35 -07:00
Jorge Juan Garcia Garcia ec85d0700f status: introduce status.branch to enable --branch by default
Some people often run 'git status -b'.
The config variable status.branch allows to set it by default.

Signed-off-by: Jorge Juan Garcia Garcia <Jorge-Juan.Garcia-Garcia@ensimag.imag.fr>
Signed-off-by: Mathieu Lienard--Mayor <Mathieu.Lienard--Mayor@ensimag.imag.fr>
Reviewed-by: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
Signed-off-by: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-24 10:25:49 -07:00
Jorge Juan Garcia Garcia 4fb5166ab5 status: introduce status.short to enable --short by default
Some people always run 'git status -s'.
The configuration variable status.short allows to set it by default.

Signed-off-by: Jorge Juan Garcia Garcia <Jorge-Juan.Garcia-Garcia@ensimag.imag.fr>
Signed-off-by: Mathieu Lienard--Mayor <Mathieu.Lienard--Mayor@ensimag.imag.fr>
Reviewed-by: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
Signed-off-by: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-24 10:25:49 -07:00
Ramkumar Ramachandra ed2b18292b push: change simple to accommodate triangular workflows
When remote.pushdefault or branch.<name>.pushremote is set to a
remote that is different from where you usually fetch from (i.e. a
triangular workflow), master@{u} != origin, and push.default is set
to `upstream` or `simple` would fail with this error:

  $ git push
  fatal: You are pushing to remote 'origin', which is not the upstream of
  your current branch 'master', without telling me what to push
  to update which remote branch.

The very name of "upstream" indicates that it is only suitable for
use in central workflows; let us not even attempt to give it a new
meaning in triangular workflows, and error out as before.

However, the `simple` does not have to share this error.  It is
poised to be the default for Git 2.0, and we would like it to do
something sensible in triangular workflows.

Redefine "simple" as "safer upstream" for centralized workflow as
before, but work as "current" for triangular workflow.

We may want to make it "safer current", but that is a separate
issue.

Reported-by: Leandro Lucarella <leandro.lucarella@sociomantic.com>
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-24 10:16:49 -07:00
Junio C Hamano 908a0e6b98 Revert "Merge branch 'jg/status-config'"
This reverts commit 1a22bd31f0, reversing
changes made to 3e7a5b489e.

It makes it impossible to "git commit" when status.short is set, and
also "git status --porcelain" output is affected by status.branch.
2013-06-24 08:18:07 -07:00
Ramkumar Ramachandra 87a70e4ce8 config doc: rewrite push.default section
4d35924e (Merge branch 'rr/triangle', 2013-04-07) introduced support
for triangular workflows, but the push.default values still assume
central workflows.

Rewrite the descriptions of `nothing`, `current`, `upstream` and
`matching` for greater clarity, and explicitly explain how they
should behave in triangular workflows.

Leave `simple` as it is for the moment, as we plan to change its
meaning to accommodate triangular workflows in a later patch.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-23 20:50:34 -07:00
Junio C Hamano 1f3a412dfa Update draft release notes to 1.8.4
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-23 14:55:45 -07:00
Junio C Hamano 1a22bd31f0 Merge branch 'jg/status-config'
"git status" learned status.branch and status.short configuration
variables to use --branch and --short options by default (override
with --no-branch and --no-short options from the command line).

* jg/status-config:
  status: introduce status.branch to enable --branch by default
  status: introduce status.short to enable --short by default
2013-06-23 14:51:59 -07:00
W. Trevor King 4b9ced278c user-manual: Update download size for Git and the kernel
They've grown since d19fbc3 (Documentation: add git user's manual,
2007-01-07) when the stats were initially added.  I've rounded
download sizes up to the nearest multiple of ten MiB to decrease the
precision and give a bit of growing room.  Exact sizes:

  $ git clone git://git.kernel.org/pub/scm/git/git.git
  Initialized empty Git repository in /tmp/git/.git/
  remote: Counting objects: 156872, done.
  remote: Compressing objects: 100% (40826/40826), done.
  remote: Total 156872 (delta 115322), reused 155492 (delta 114094)
  Receiving objects: 100% (156872/156872), 37.29 MiB | 7.54 MiB/s, done.
  Resolving deltas: 100% (115322/115322), done.

  $ git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
  Initialized empty Git repository in /tmp/linux/.git/
  remote: Counting objects: 3057404, done.
  remote: Compressing objects: 100% (474769/474769), done.
  Receiving objects: 100% (3057404/3057404), 634.33 MiB | 27.95 MiB/s, done.
  remote: Total 3057404 (delta 2570385), reused 3040910 (delta 2554408)
  Resolving deltas: 100% (2570385/2570385), done.
  Checking out files: 100% (43012/43012), done.

Signed-off-by: W. Trevor King <wking@tremily.us>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-23 00:35:50 -07:00
Ramkumar Ramachandra f0779aef8e ls-remote doc: don't encourage use of branches-file
One outdated example encourages the use of $GIT_DIR/branches files.
Replace it with an equivalent example using a remote.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-23 00:33:58 -07:00
Ramkumar Ramachandra 88e36141d0 ls-remote doc: rewrite <repository> paragraph
Replace the <repository> paragraph containing specific references to
$GIT_DIR/branches and "." with a generic urls-or-remotes paragraph
referencing the relevant sections in the git-fetch(1) manpage.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-23 00:33:58 -07:00
Ramkumar Ramachandra 6077d36299 ls-remote doc: fix example invocation on git.git
Under the EXAMPLES section, there is one invocation on the git.git
repository that attempts to list the refs master, pu, and rc.  The ref
rc does not exist in today's repository, so remove it.  Among other
things, this example demonstrates that the "<refs>..." argument is
simply a filter; requesting a non-existent ref is not an error.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-23 00:33:58 -07:00
W. Trevor King 283efb0108 Documentation: Update 'linux-2.6.git' -> 'linux.git'
The 3.x tree has been out for a while now.  The -2.6 repository name
survived the initial release [1], but kernel.org now only lists
'linux.git' (for aegl as well as torvalds) [2].

[1]: http://article.gmane.org/gmane.linux.kernel/1147422
  On 2011-05-30 01:47:57 GMT, Linus Torvalds wrote:
  > ... yes, that means that my git tree is still called
  > "linux-2.6.git" on kernel.org.
[2]: http://git.kernel.org/cgit/

Signed-off-by: W. Trevor King <wking@tremily.us>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-22 23:36:48 -07:00
W. Trevor King 34a25d4c90 Documentation: Update the NFS remote examples to use the staging repo
linux-nfs.org seems to have restructured their repository layout since
8391c60 (git-remote.txt: fix example url, 2007-11-02), and Bruce's
repo is now at git://git.linux-nfs.org/projects/bfields/linux.git.
Bruce also has a more richer internal branch structure (master,
everything, for-3.1, ...), so updating the existing example to use his
current repo may be confusing.

To simplify, I've replaced the NFS repo with Greg's staging repo.
I've also updated the output of the surrounding commands to match the
output of a current run through.

Signed-off-by: W. Trevor King <wking@tremily.us>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-22 23:35:17 -07:00
W. Trevor King f22a6543d1 doc/clone: Pick more compelling paths for the --reference example
There may be times when using one of your local repositories as a
reference for a new clone make sense, but the implied version-bump in
the old example isn't one of them.  I think a more intuitive example
is multi-user system with a central reference clone, and the new paths
hint at this use case.

Signed-off-by: W. Trevor King <wking@tremily.us>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-22 23:35:00 -07:00
W. Trevor King 8c8fc53c7d doc/clone: Remove the '--bare -l -s' example
There are other examples in git-clone.txt demonstrating both '--bare'
and '-l -s'.

Signed-off-by: W. Trevor King <wking@tremily.us>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-22 23:34:54 -07:00
Yaakov Selkowitz cc2f6b6865 web--browse: support /usr/bin/cygstart on Cygwin
While both GUI and console Cygwin browsers do exist, anecdotal evidence
suggests most users rely on their native Windows browser.  cygstart,
which is a long-standing part of the base Cygwin installation, will
cause the page to be opened in the default Windows browser (the one
registered to open .html files).

Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-21 09:05:15 -07:00
Junio C Hamano 21ff9151e8 Update draft release notes to 1.8.4 2013-06-20 16:13:41 -07:00
Junio C Hamano 73018c0f0b Merge branch 'mm/color-auto-default'
Flip the default for color.ui to 'auto', which is what many
tutorials recommend new users to do.

* mm/color-auto-default:
  make color.ui default to 'auto'
  config: refactor management of color.ui's default value
2013-06-20 16:02:33 -07:00
Junio C Hamano 8f0c843aab Merge branch 'nd/traces'
* nd/traces:
  git.txt: document GIT_TRACE_PACKET
  core: use env variable instead of config var to turn on logging pack access
2013-06-20 16:02:28 -07:00
Antoine Pelisse 36617af7ed diff: add --ignore-blank-lines option
The goal of the patch is to introduce the GNU diff
-B/--ignore-blank-lines as closely as possible. The short option is not
available because it's already used for "break-rewrites".

When this option is used, git-diff will not create hunks that simply
add or remove empty lines, but will still show empty lines
addition/suppression if they are close enough to "valuable" changes.

There are two differences between this option and GNU diff -B option:
- GNU diff doesn't have "--inter-hunk-context", so this must be handled
- The following sequence looks like a bug (context is displayed twice):

    $ seq 5 >file1
    $ cat <<EOF >file2
    change
    1
    2

    3
    4
    5
    change
    EOF
    $ diff -u -B file1 file2
    --- file1	2013-06-08 22:13:04.471517834 +0200
    +++ file2	2013-06-08 22:13:23.275517855 +0200
    @@ -1,5 +1,7 @@
    +change
     1
     2
    +
     3
     4
     5
    @@ -3,3 +5,4 @@
     3
     4
     5
    +change

So here is a more thorough description of the option:
- real changes are interesting
- blank lines that are close enough (less than context size) to
interesting changes are considered interesting (recursive definition)
- "context" lines are used around each hunk of interesting changes
- If two hunks are separated by less than "inter-hunk-context", they
will be merged into one.

The implementation does the "interesting changes selection" in a single
pass.

Signed-off-by: Antoine Pelisse <apelisse@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-19 15:17:45 -07:00
Junio C Hamano c3e2d18996 setup_reflog_action: document the rules for using GIT_REFLOG_ACTION
The set_reflog_action helper (in git-sh-setup) is designed to be
used once at the very top of a program, like this in "git am", for
example:

	set_reflog_action am

The helper function sets the given string to GIT_REFLOG_ACTION only
when GIT_REFLOG_ACTION is not yet set.  Thanks to this, "git am",
when run as the top-level program, will use "am" in GIT_REFLOG_ACTION
and the reflog entries made by whatever it does will record the
updates of refs done by "am".

Because of the conditional assignment, when "git am" is run as a
subprogram (i.e. an implementation detail) of "git rebase" that
already sets GIT_REFLOG_ACTION to its own name, the call in "git am"
to the helper function at the beginning will *not* have any effect.

So "git rebase" can do this:

	set_reflog_action rebase
	... do its own preparation, like checking out "onto" commit
        ... decide to do "format-patch" to "am" pipeline
        	git format-patch --stdout >mbox
		git am mbox

and the reflog entries made inside "git am" invocation will say
"rebase", not "am".

Calls to "git" commands that update refs would use GIT_REFLOG_ACTION
to record who did that update.  Most such calls in scripted Porcelains
do not define custom reflog message and rely on GIT_REFLOG_ACTION to
contain its (or its caller's, when it is called as a subprogram) name.

If a scripted Porcelain wants to record a custom reflog message for
a single invocation of "git" command (e.g. when "git rebase" uses
"git checkout" to detach HEAD at the commit a series is to be
replayed on), it needs to set GIT_REFLOG_ACTION to the custom
message and export it while calling the "git" command, but such an
assignment must be restricted to that single "git" invocation and
should not be left behind to affect later codepath.

Document the rules to avoid future confusion.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-19 10:54:00 -07:00
Namhyung Kim 98c5c4ad01 name-rev: allow to specify a subpath for --refs option
When an user wants to filter specific ref using the --refs option,
the pattern needs to match the full ref, e.g. --refs=refs/tags/v1.*.

It'd be convenient to specify a subpath of ref pattern.  For
example, --refs=origin/* can find refs/remotes/origin/master by
searching the pattern against its substrings in turn:

  refs/remotes/origin/master
  remotes/origin/master
  origin/master

If it finds a match in a subpath, unambigous part of the ref path will
be removed in the output.

Signed-off-by: Namhyung Kim <namhyung.kim@lge.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-18 12:02:02 -07:00
Phil Hord 09b7e2204a fix "builtin-*" references to be "builtin/*"
Documentation and some comments still refer to files in builtin/
as 'builtin-*.[cho]'.  Update these to show the correct location.

Signed-off-by: Phil Hord <hordp@cisco.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Assisted-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-18 11:05:51 -07:00
Kevin Bracey d7747bd5bc Documentation: Move "git diff <blob> <blob>"
The section describing "git diff <blob> <blob>" had been placed in a
position that disrupted the statement "This is synonymous to the
previous form".

Reorder to place this form after all the <commit>-using forms, and the
note applying to them. Also mention this form in the initial description
paragraph.

Signed-off-by: Kevin Bracey <kevin@bracey.fi>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-18 09:33:12 -07:00
Matthieu Moy 76b80cdf17 Documentation/git-merge.txt: weaken warning about uncommited changes
Commit 35d2fffd introduced 'git merge --abort' as a synonym to 'git reset
--merge', and added some failing tests in t7611-merge-abort.sh (search
'###' in this file) showing that 'git merge --abort' could not always
recover the pre-merge state.

Still, in many cases, 'git merge --abort' just works, and it is usually
considered that the ability to start a merge with uncommited changes is
an important property of Git.

Weaken the warning by discouraging only merge with /non-trivial/
uncommited changes.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-18 09:19:19 -07:00
Matthieu Moy 70495b556f Documentation/git-push.txt: explain better cases where --force is dangerous
The behavior of "git push --force" is rather clear when it updates only
one remote ref, but running it when pushing several branches can really
be dangerous. Warn the users a bit more and give them the alternative to
push only one branch.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-18 07:35:48 -07:00
John Keeping 12b9d32790 rev-parse: add --prefix option
This makes 'git rev-parse' behave as if it were invoked from the
specified subdirectory of a repository, with the difference that any
file paths which it prints are prefixed with the full path from the top
of the working tree.

This is useful for shell scripts where we may want to cd to the top of
the working tree but need to handle relative paths given by the user on
the command line.

Signed-off-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-17 13:30:01 -07:00
Namhyung Kim 560d4b86ab config: Add description of --local option
It was missed in the option list while mentioned from the general
description.  Add it for completeness.

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-17 13:27:49 -07:00
John Keeping e21db2c6ad Documentation/Makefile: move infodir to be with other '*dir's
Signed-off-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-17 13:11:56 -07:00
John Keeping 692cfd6b2b Documentation/Makefile: fix spaces around assignments
A simple style fix; no functional change.

Signed-off-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-17 13:11:21 -07:00
Ramkumar Ramachandra bd514cada4 stash: introduce 'git stash store'
save_stash() contains the logic for doing two potentially independent
operations; the first is preparing the stash merge commit, and the
second is updating the stash ref/ reflog accordingly.  While the first
operation is abstracted out into a create_stash() for callers to access
via 'git stash create', the second one is not.  Fix this by factoring
out the logic for storing the stash into a store_stash() that callers
can access via 'git stash store'.

Like create, store is not intended for end user interactive use, but for
callers in other scripts.  We can simplify the logic in the
rebase.autostash feature using this new subcommand.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-17 11:43:13 -07:00
Ramkumar Ramachandra aa7e722dfe stash doc: document short form -p in synopsis
'git stash save' can take -p, the short form of --patch, as an option.
Document this.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-17 09:21:59 -07:00
Ramkumar Ramachandra 2be43516dd stash doc: add a warning about using create
Add a note saying that the user probably wants "save" in the create
description.  While at it, document that it can optionally take a
message in the synopsis.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-17 09:21:52 -07:00
Jorge Juan Garcia Garcia 0e254bbd22 status: introduce status.branch to enable --branch by default
Some people often run 'git status -b'.
The config variable status.branch allows to set it by default.

Signed-off-by: Jorge Juan Garcia Garcia <Jorge-Juan.Garcia-Garcia@ensimag.imag.fr>
Signed-off-by: Mathieu Lienard--Mayor <Mathieu.Lienard--Mayor@ensimag.imag.fr>
Reviewed-by: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
Signed-off-by: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-15 22:15:28 -07:00
Junio C Hamano 0dbd81251d Update draft release notes to 1.8.4
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-15 22:12:52 -07:00
Junio C Hamano b27a79d16b Merge branch 'kb/full-history-compute-treesame-carefully-2'
Major update to the revision traversal logic to improve culling of
irrelevant parents while traversing a mergy history.

* kb/full-history-compute-treesame-carefully-2:
  revision.c: make default history consider bottom commits
  revision.c: don't show all merges for --parents
  revision.c: discount side branches when computing TREESAME
  revision.c: add BOTTOM flag for commits
  simplify-merges: drop merge from irrelevant side branch
  simplify-merges: never remove all TREESAME parents
  t6012: update test for tweaked full-history traversal
  revision.c: Make --full-history consider more merges
  Documentation: avoid "uninteresting"
  rev-list-options.txt: correct TREESAME for P
  t6111: add parents to tests
  t6111: allow checking the parents as well
  t6111: new TREESAME test set
  t6019: test file dropped in -s ours merge
  decorate.c: compact table when growing
2013-06-14 08:45:59 -07:00
Mathieu Lienard--Mayor 7e30944622 rm: introduce advice.rmHints to shorten messages
Introduce advice.rmHints to choose whether to display advice or not
when git rm fails. Defaults to true, in order to preserve current behavior.

As an example, the message:
	error: 'foo.txt' has changes staged in the index
	(use --cached to keep the file, or -f to force removal)

would look like, with advice.rmHints=false:
	error: 'foo.txt' has changes staged in the index

Signed-off-by: Mathieu Lienard--Mayor <Mathieu.Lienard--Mayor@ensimag.imag.fr>
Signed-off-by: Jorge Juan Garcia Garcia <Jorge-Juan.Garcia-Garcia@ensimag.imag.fr>
Signed-off-by: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-12 16:59:55 -07:00
Junio C Hamano 81c6b38b67 log: --author-date-order
Sometimes people would want to view the commits in parallel
histories in the order of author dates, not committer dates.

Teach "topo-order" sort machinery to do so, using a commit-info slab
to record the author dates of each commit, and prio-queue to sort
them.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-11 15:15:21 -07:00
Jorge Juan Garcia Garcia 50e4f757f4 status: introduce status.short to enable --short by default
Some people always run 'git status -s'.
The configuration variable status.short allows to set it by default.

Signed-off-by: Jorge Juan Garcia Garcia <Jorge-Juan.Garcia-Garcia@ensimag.imag.fr>
Signed-off-by: Mathieu Lienard--Mayor <Mathieu.Lienard--Mayor@ensimag.imag.fr>
Reviewed-by: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
Signed-off-by: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-11 14:38:08 -07:00
Junio C Hamano 879070e650 Update draft release notes
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-11 13:50:12 -07:00
Junio C Hamano 0f93608bfe Merge branch 'rr/maint-fetch-tag-doc-asterisks'
* rr/maint-fetch-tag-doc-asterisks:
  fetch-options.txt: prevent a wildcard refspec from getting misformatted
2013-06-11 13:31:41 -07:00
Junio C Hamano 45acb75928 Merge branch 'rr/rebase-autostash'
* rr/rebase-autostash:
  rebase: implement --[no-]autostash and rebase.autostash
  rebase --merge: return control to caller, for housekeeping
  rebase -i: return control to caller, for housekeeping
  am: return control to caller, for housekeeping
  rebase: prepare to do generic housekeeping
  rebase -i: don't error out if $state_dir already exists
  am: tighten a conditional that checks for $dotest
2013-06-11 13:31:29 -07:00
Junio C Hamano bb1c8fbcc8 Merge branch 'fc/at-head'
Instead of typing four capital letters "HEAD", you can say "@"
instead.

* fc/at-head:
  sha1_name: compare variable with constant, not constant with variable
  Add new @ shortcut for HEAD
  sha1_name: refactor reinterpret()
  sha1_name: check @{-N} errors sooner
  sha1_name: reorganize get_sha1_basic()
  sha1_name: don't waste cycles in the @-parsing loop
  sha1_name: remove unnecessary braces
  sha1_name: remove no-op
  tests: at-combinations: @{N} versus HEAD@{N}
  tests: at-combinations: increase coverage
  tests: at-combinations: improve nonsense()
  tests: at-combinations: check ref names directly
  tests: at-combinations: simplify setup
2013-06-11 13:31:23 -07:00
Junio C Hamano 71e120202f Merge branch 'rr/diffcore-pickaxe-doc'
Update the low-level diffcore documentation on -S/-G and --pickaxe-all.

* rr/diffcore-pickaxe-doc:
  diffcore-pickaxe doc: document -S and -G properly
  diffcore-pickaxe: make error messages more consistent
2013-06-11 13:31:04 -07:00
Junio C Hamano b1bd929611 Merge branch 'cr/git-work-tree-sans-git-dir'
These days, "git --work-tree=there cmd" without specifying an
explicit --git-dir=here will do the usual discovery, but we had a
description of older behaviour in the documentation.

* cr/git-work-tree-sans-git-dir:
  git.txt: remove stale comment regarding GIT_WORK_TREE
2013-06-11 13:31:01 -07:00
Junio C Hamano 39fd762572 Sync with 1.8.3.1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-10 12:35:45 -07:00
Junio C Hamano 362de916c0 Git 1.8.3.1
Primarily to push out two regression issues that seem to affect many
people, namely, the ".gitignore !directory" bug and "daemon cannot
read from $HOME owned by root" bug.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-10 12:34:42 -07:00
Matthieu Moy 4c7f1819b3 make color.ui default to 'auto'
Most users seem to like having colors enabled, and colors can help
beginners to understand the output of some commands (e.g. notice
immediately the boundary between commits in the output of "git log").

Many tutorials tell the users to set color.ui=auto as a very first step,
which tend to indicate that color.ui=none is not the recommanded value,
hence should not be the default.

These tutorials would benefit from skipping this step and starting the
real Git manipulations earlier. Other beginners do not know about
color.ui=auto, and may not discover it by themselves, hence live with
black&white outputs while they may have preferred colors.

A few people (e.g. color-blind) prefer having no colors, but they can
easily set color.ui=never for this (and googling "disable colors in git"
already tells them how to do so), but this needs not occupy space in
beginner-oriented documentations.

A transition period with Git emitting a warning when color.ui is unset
would be possible, but the discomfort of having the warning seems
superior to the benefit: users may be surprised by the change, but not
harmed by it.

The default value is changed, and the documentation is reworded to
mention "color.ui=false" first, since the primary use of color.ui after
this change is to disable colors, not to enable it.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-10 10:55:42 -07:00
Nguyễn Thái Ngọc Duy 1dd278ce60 git.txt: document GIT_TRACE_PACKET
"This can help with debugging object negotiation or other protocol
issues."

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-09 16:16:06 -07:00
Nguyễn Thái Ngọc Duy b12ca9631f core: use env variable instead of config var to turn on logging pack access
5f44324 (core: log offset pack data accesses happened - 2011-07-06)
provides a way to observe pack access patterns via a config
switch. Setting an environment variable looks more obvious than a
config var, especially when you just need to _observe_, and more
inline with other tracing knobs we have.

Document it as it may be useful for remote troubleshooting.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-09 16:07:50 -07:00
Fredrik Gustafsson 26f8f32a20 Document .git/modules
A note in the beginning of this document describes the behavior already.
This patch just adds where to find the repositories.

Signed-off-by: Fredrik Gustafsson <iveqy@iveqy.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-09 13:45:32 -07:00
Junio C Hamano 9eb4754d76 fetch-options.txt: prevent a wildcard refspec from getting misformatted
When explaining the "--tags" option as an equivalent to giving an
explicit "refs/tags/*:refs/tags/*" refspec, the two asterisks were
misinterpreted by AsciiDoc as a request to typeset the string
segment between them in bold.

We could fix it in two ways.  We can replace them with {asterisk}s
while keeping the string as body text, or we can mark it as a
literal string with backquotes around it.

Let's do the latter, as it is teaching the user an "exactly as
typed" alternative.

Noticed-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-07 08:22:37 -07:00
Junio C Hamano 882e78c7f9 Update draft release notes to 1.8.4
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-06 14:42:56 -07:00
Junio C Hamano 72e719292d Merge branch 'nd/clone-connectivity-shortcut'
Special case "git clone" and use lighter-weight implementation to
check the completeness of the history behind refs.

* nd/clone-connectivity-shortcut:
  clone: open a shortcut for connectivity check
  index-pack: remove dead code (it should never happen)
  fetch-pack: prepare updated shallow file before fetching the pack
  clone: let the user know when check_everything_connected is run
2013-06-06 12:17:55 -07:00
Junio C Hamano ecb9f3e733 Update draft release notes to 1.8.4
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-05 15:40:37 -07:00
Junio C Hamano 57a00bf604 Merge branch 'nd/urls-doc-no-file-hyperlink-fix'
* nd/urls-doc-no-file-hyperlink-fix:
  urls.txt: avoid auto converting to hyperlink
2013-06-05 14:56:51 -07:00
Junio C Hamano 3f261c092f Merge branch 'tr/push-no-verify-doc'
"git push --[no-]verify" was not documented.

* tr/push-no-verify-doc:
  Document push --no-verify
2013-06-05 14:56:48 -07:00
Ramkumar Ramachandra 5bc3f0b567 diffcore-pickaxe doc: document -S and -G properly
The documentation of -S and -G is very sketchy.  Completely rewrite the
sections in Documentation/diff-options.txt and
Documentation/gitdiffcore.txt.

References:
52e9578 ([PATCH] Introducing software archaeologist's tool "pickaxe".)
f506b8e (git log/diff: add -G<regexp> that greps in the patch text)

Inputs-from: Phil Hord <phil.hord@gmail.com>
Co-authored-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-03 10:53:11 -07:00
Chris Rorvick a758a3499f git.txt: remove stale comment regarding GIT_WORK_TREE
Official support for specifying --work-tree/GIT_WORK_TREE without
--git-dir/GIT_DIR was added with v1.7.4-rc3~2^2~2.  Update description
of GIT_WORK_TREE to reflect this.

Signed-off-by: Chris Rorvick <chris@rorvick.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-03 10:20:43 -07:00
Junio C Hamano b2edae0ab6 Update draft release notes to 1.8.4
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-02 16:02:21 -07:00
Junio C Hamano ed73fe5642 Merge branch 'tr/line-log'
* tr/line-log:
  git-log(1): remove --full-line-diff description
  line-log: fix documentation formatting
  log -L: improve comments in process_all_files()
  log -L: store the path instead of a diff_filespec
  log -L: test merge of parallel modify/rename
  t4211: pass -M to 'git log -M -L...' test
  log -L: fix overlapping input ranges
  log -L: check range set invariants when we look it up
  Speed up log -L... -M
  log -L: :pattern:file syntax to find by funcname
  Implement line-history search (git log -L)
  Export rewrite_parents() for 'log -L'
  Refactor parse_loc
2013-06-02 16:00:44 -07:00
Junio C Hamano 4de1179afc Merge branch 'mc/describe-first-parent'
* mc/describe-first-parent:
  describe: Add --first-parent option
2013-06-02 15:59:49 -07:00
Junio C Hamano db400949b3 Merge branch 'jk/fetch-always-update-tracking'
"git fetch origin master" unlike "git fetch origin" or "git fetch"
did not update "refs/remotes/origin/master"; this was an early
design decision to keep the update of remote tracking branches
predictable, but in practice it turns out that people find it more
convenient to opportunisticly update them whenever we have a chance,
and we have been updating them when we run "git push" which already
breaks the original "predictability" anyway.

Now such a fetch does update refs/remotes/origin/master.

* jk/fetch-always-update-tracking:
  fetch: don't try to update unfetched tracking refs
  fetch: opportunistically update tracking refs
  refactor "ref->merge" flag
  fetch/pull doc: untangle meaning of bare <ref>
  t5510: start tracking-ref tests from a known state
2013-06-02 15:57:26 -07:00
Junio C Hamano 41aaccdcf9 Merge branch 'nd/clone-local-with-colon'
"git clone foo/bar:baz" cannot be a request to clone from a remote
over git-over-ssh specified in the scp style.  Detect this case and
clone from a local repository at "foo/bar:baz".

* nd/clone-local-with-colon:
  clone: allow cloning local paths with colons in them
2013-06-02 15:52:22 -07:00
Junio C Hamano 499eaceb21 Merge branch 'rh/merge-options-doc-fix'
* rh/merge-options-doc-fix:
  Documentation/merge-options.txt: restore `-e` option
2013-06-02 15:48:22 -07:00
Junio C Hamano 7abc6b7151 Merge branch 'an/diff-index-doc'
* an/diff-index-doc:
  Documentation/diff-index: mention two modes of operation
2013-06-02 15:48:17 -07:00
Junio C Hamano 727a46b2f9 Sync with maint
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-29 15:21:47 -07:00
Junio C Hamano a717d9e1d3 Merge branch 'maint-1.8.2' into maint
* maint-1.8.2:
  trivial: Add missing period in documentation
2013-05-29 15:20:36 -07:00
Junio C Hamano 54219a4d89 Start 1.8.4 cycle
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-29 15:19:12 -07:00
Junio C Hamano c51afbbd18 Merge branch 'as/check-ignore'
Enhance "check-ignore" (1.8.2 update) to work more like "check-attr"
over bidi-pipes.

* as/check-ignore:
  t0008: use named pipe (FIFO) to test check-ignore streaming
  Documentation: add caveats about I/O buffering for check-{attr,ignore}
  check-ignore: allow incremental streaming of queries via --stdin
  check-ignore: move setup into cmd_check_ignore()
  check-ignore: add -n / --non-matching option
  t0008: remove duplicated test fixture data
2013-05-29 14:23:40 -07:00
Junio C Hamano 77eb44b8ed Merge branch 'jh/checkout-auto-tracking'
Update "git checkout foo" that DWIMs the intended "upstream" and
turns it into "git checkout -t -b foo remotes/origin/foo" to
correctly take existing remote definitions into account.

The remote "origin" may be what uniquely map its own branch to
remotes/some/where/foo but that some/where may not be "origin".

* jh/checkout-auto-tracking:
  glossary: Update and rephrase the definition of a remote-tracking branch
  branch.c: Validate tracking branches with refspecs instead of refs/remotes/*
  t9114.2: Don't use --track option against "svn-remote"-tracking branches
  t7201.24: Add refspec to keep --track working
  t3200.39: tracking setup should fail if there is no matching refspec.
  checkout: Use remote refspecs when DWIMming tracking branches
  t2024: Show failure to use refspec when DWIMming remote branch names
  t2024: Add tests verifying current DWIM behavior of 'git checkout <branch>'
2013-05-29 14:23:10 -07:00
Junio C Hamano 3e1e7624aa Merge branch 'jc/prune-all'
We used the approxidate() parser for "--expire=<timestamp>" options
of various commands, but it is better to treat --expire=all and
--expire=now a bit more specially than using the current timestamp.
Update "git gc" and "git reflog" with a new parsing function for
expiry dates.

* jc/prune-all:
  prune: introduce OPT_EXPIRY_DATE() and use it
  api-parse-options.txt: document "no-" for non-boolean options
  git-gc.txt, git-reflog.txt: document new expiry options
  date.c: add parse_expiry_date()
2013-05-29 14:23:04 -07:00
Junio C Hamano 305e19bdc3 Merge branch 'mh/fetch-into-shallow'
"git fetch" into a shallow repository from a repository that does
not know about the shallow boundary commits (e.g. a different fork
from the repository the current shallow repository was cloned from)
did not work correctly.

* mh/fetch-into-shallow:
  t5500: add test for fetching with an unknown 'shallow'
  upload-pack: ignore 'shallow' lines with unknown obj-ids
2013-05-29 14:20:30 -07:00
Junio C Hamano 766f0f8ef7 Merge branch 'fc/transport-helper-error-reporting'
Update transport helper to report errors and maintain ref hierarchy
used to keep track of remote helper state better.

* fc/transport-helper-error-reporting:
  transport-helper: fix remote helper namespace regression
  test: remote-helper: add missing and
  t5801: "VAR=VAL shell_func args" is forbidden
  transport-helper: update remote helper namespace
  transport-helper: trivial code shuffle
  transport-helper: warn when refspec is not used
  transport-helper: clarify pushing without refspecs
  transport-helper: update refspec documentation
  transport-helper: clarify *:* refspec
  transport-helper: improve push messages
  transport-helper: mention helper name when it dies
  transport-helper: report errors properly
2013-05-29 14:20:16 -07:00
Ramkumar Ramachandra 587947750b rebase: implement --[no-]autostash and rebase.autostash
This new feature allows a rebase to be executed on a dirty worktree or
index.  It works by creating a temporary "dangling merge commit" out
of the worktree and index changes (via 'git stash create'), and
automatically applying it after a successful rebase or abort.

rebase stores the SHA-1 hex of the temporary merge commit, along with
the rest of the rebase state, in either
.git/{rebase-merge,rebase-apply}/autostash depending on the kind of
rebase.  Since $state_dir is automatically removed at the end of a
successful rebase or abort, so is the autostash.

The advantage of this approach is that we do not affect the normal
stash's reflogs, making the autostash invisible to the end-user.  This
means that you can use 'git stash' during a rebase as usual.

When the autostash application results in a conflict, we push
$state_dir/autostash onto the normal stash and remove $state_dir
ending the rebase.  The user can inspect the stash, and pop or drop at
any time.

Most significantly, this feature means that a caller like pull (with
pull.rebase set to true) can easily be patched to remove the
require_clean_work_tree restriction.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-29 10:34:54 -07:00
Phil Hord b1d04bfcf8 trivial: Add missing period in documentation
Signed-off-by: Phil Hord <hordp@cisco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28 15:15:29 -07:00
Nguyễn Thái Ngọc Duy c6807a40dc clone: open a shortcut for connectivity check
In order to make sure the cloned repository is good, we run "rev-list
--objects --not --all $new_refs" on the repository. This is expensive
on large repositories. This patch attempts to mitigate the impact in
this special case.

In the "good" clone case, we only have one pack. If all of the
following are met, we can be sure that all objects reachable from the
new refs exist, which is the intention of running "rev-list ...":

 - all refs point to an object in the pack
 - there are no dangling pointers in any object in the pack
 - no objects in the pack point to objects outside the pack

The second and third checks can be done with the help of index-pack as
a slight variation of --strict check (which introduces a new condition
for the shortcut: pack transfer must be used and the number of objects
large enough to call index-pack). The first is checked in
check_everything_connected after we get an "ok" from index-pack.

"index-pack + new checks" is still faster than the current "index-pack
+ rev-list", which is the whole point of this patch. If any of the
conditions fail, we fall back to the good old but expensive "rev-list
..". In that case it's even more expensive because we have to pay for
the new checks in index-pack. But that should only happen when the
other side is either buggy or malicious.

Cloning linux-2.6 over file://

        before         after
real    3m25.693s      2m53.050s
user    5m2.037s       4m42.396s
sys     0m13.750s      0m16.574s

A more realistic test with ssh:// over wireless

        before         after
real    11m26.629s     10m4.213s
user    5m43.196s      5m19.444s
sys     0m35.812s      0m37.630s

This shortcut is not applied to shallow clones, partly because shallow
clones should have no more objects than a usual fetch and the cost of
rev-list is acceptable, partly to avoid dealing with corner cases when
grafting is involved.

This shortcut does not apply to unpack-objects code path either
because the number of objects must be small in order to trigger that
code path.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28 08:07:20 -07:00
Junio C Hamano edca415256 Git 1.8.3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-24 11:34:46 -07:00
Nguyễn Thái Ngọc Duy 4c32e361f6 urls.txt: avoid auto converting to hyperlink
file:///path/to/repo.git/ is converted to a hyperlink while others are
not. Put a backslash to avoid the conversion. Tested with asciidoc
8.6.5.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-24 10:55:37 -07:00
Thomas Rast 90d32d1ffa Document push --no-verify
ec55559 (push: Add support for pre-push hooks, 2013-01-13) forgot to
add a note to git-push(1) about the new --no-verify option.

Signed-off-by: Thomas Rast <trast@inf.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-23 10:39:12 -07:00
Junio C Hamano b3d6e6e707 Documentation/diff-index: mention two modes of operation
"diff-index" can be used to compare a tree with the tracked working
tree files (when used without the --index option), or with the index
(when used with the --index option).

The text however did not say anything about the comparison with the
working tree at all.  Fix this.

Reported-by: Albert Netymk <albertnetymk@gmail.com>
Helped-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-20 15:50:44 -07:00
Tobias Schulte f4f4c7fc00 git-svn: introduce --parents parameter for commands branch and tag
This parameter is equivalent to the parameter --parents on svn cp commands
and is useful for non-standard repository layouts.

Signed-off-by: Tobias Schulte <tobias.schulte@gliderpilot.de>
Signed-off-by: Eric Wong <normalperson@yhbt.net>
2013-05-20 22:05:54 +00:00
Jonathan Nieder 7d82b4af1c git-svn: clarify explanation of --destination argument
The existing documentation for "-d" does not make it obvious whether
its argument is supposed to be a full svn path, a partial svn path,
the glob from the config file, or what.  Clarify the text and add an
example to get the reader started.

Reported-by: Nathan Gray <n8gray@n8gray.org>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Eric Wong <normalperson@yhbt.net>
2013-05-20 22:05:47 +00:00
Nathan Gray eff714bdda git-svn: multiple fetch/branches/tags keys are supported
"git svn" can be configured to use multiple fetch, branches, and tags
refspecs by passing multiple --branches or --tags options at init time
or editing the configuration file later, which can be handy when
working with messy Subversion repositories.  Add a note to the
configuration section documenting how this works.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Eric Wong <normalperson@yhbt.net>
2013-05-20 22:05:47 +00:00
Mike Crowe e00dd1e948 describe: Add --first-parent option
Only consider the first parent commit when walking the commit history. This
is useful if you only wish to match tags on your branch after a merge.

Signed-off-by: Mike Crowe <mac@mcrowe.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-20 11:09:03 -07:00
Junio C Hamano 680ed3eeb6 Merge branch 'fc/doc-style'
* fc/doc-style:
  documentation: trivial style cleanups
2013-05-17 12:16:49 -07:00
Junio C Hamano 8639f3e49f Merge branch 'dw/asciidoc-sources-are-dot-txt-files'
* dw/asciidoc-sources-are-dot-txt-files:
  CodingGuidelines: Documentation/*.txt are the sources
2013-05-17 12:16:44 -07:00
Felipe Contreras 0460ed2c93 documentation: trivial style cleanups
White-spaces, missing braces, standardize --[no-]foo.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-17 12:09:21 -07:00
Richard Hansen 66fa1b2c35 Documentation/merge-options.txt: restore -e option
It looks like commit f8246281af
unintentionally removed the documentation for the `-e` option.

Signed-off-by: Richard Hansen <rhansen@bbn.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-16 16:40:00 -07:00
Dale R. Worley 3244eb9b5a git-submodule.txt: Clarify 'init' and 'add' subcommands.
Describe how 'add' sets the submodule's logical name, which is used in
the configuration entry names.

Clarify that 'init' only sets up the configuration entries for
submodules that have already been added elsewhere.  Describe that
<path> arguments limit the submodules that are configured.

Signed-off-by: Dale Worley <worley@ariadne.com>
Acked-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-16 12:01:31 -07:00
Kevin Bracey 143f1eafdb simplify-merges: drop merge from irrelevant side branch
Reimplement commit 4b7f53da on top of the new simplify-merges
infrastructure, tightening the condition to only consider root parents;
the original version incorrectly dropped parents that were TREESAME to
anything.

Original log message follows.

The merge simplification rule stated in 6546b59 (revision traversal:
show full history with merge simplification, 2008-07-31) still
treated merge commits too specially.  Namely, in a history with this
shape:

	---o---o---M
	          /
         x---x---x

where three 'x' were on a history completely unrelated to the main
history 'o' and do not touch any of the paths we are following, we
still said that after simplifying all of the parents of M, 'x'
(which is the leftmost 'x' that rightmost 'x simplifies down to) and
'o' (which would be the last commit on the main history that touches
the paths we are following) are independent from each other, and
both need to be kept.

That is incorrect; when the side branch 'x' never touches the paths,
it should be removed to allow M to simplify down to the last commit
on the main history that touches the paths.

Suggested-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Kevin Bracey <kevin@bracey.fi>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-16 11:51:09 -07:00
Kevin Bracey 9c129eab99 simplify-merges: never remove all TREESAME parents
When simplifying an odd merge, such as one that used "-s ours", we may
find ourselves TREESAME to apparently redundant parents. Prevent
simplify_merges() from removing every TREESAME parent; if this would
happen reinstate the first TREESAME parent - the one that the default
log would have followed.

This avoids producing a totally disjoint history from the default log
when the default log is a better explanation of the end result, and aids
visualisation of odd merges.

Signed-off-by: Kevin Bracey <kevin@bracey.fi>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-16 11:51:09 -07:00
Kevin Bracey d0af663e42 revision.c: Make --full-history consider more merges
History simplification previously always treated merges as TREESAME
if they were TREESAME to any parent.

While this was consistent with the default behaviour, this could be
extremely unhelpful when searching detailed history, and could not be
overridden. For example, if a merge had ignored a change, as if by "-s
ours", then:

  git log -m -p --full-history -Schange file

would successfully locate "change"'s addition but would not locate the
merge that resolved against it.

Futher, simplify_merges could drop the actual parent that a commit
was TREESAME to, leaving it as a normal commit marked TREESAME that
isn't actually TREESAME to its remaining parent.

Now redefine a commit's TREESAME flag to be true only if a commit is
TREESAME to _all_ of its parents. This doesn't affect either the default
simplify_history behaviour (because partially TREESAME merges are turned
into normal commits), or full-history with parent rewriting (because all
merges are output). But it does affect other modes. The clearest
difference is that --full-history will show more merges - sufficient to
ensure that -m -p --full-history log searches can really explain every
change to the file, including those changes' ultimate fate in merges.

Also modify simplify_merges to recalculate TREESAME after removing
a parent. This is achieved by storing per-parent TREESAME flags on the
initial scan, so the combined flag can be easily recomputed.

This fixes some t6111 failures, but creates a couple of new ones -
we are now showing some merges that don't need to be shown.

Signed-off-by: Kevin Bracey <kevin@bracey.fi>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-16 11:51:09 -07:00
Kevin Bracey e32db66d7a Documentation: avoid "uninteresting"
The documentation of --boundary uses the term "uninteresting", which is
not used or defined anywhere else in the documentation. This is
unhelpful and confusing to anyone who hasn't seen the UNINTERESTING
flag in the source code.

Change to use "excluded", as per revisions.txt.

Signed-off-by: Kevin Bracey <kevin@bracey.fi>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-16 11:51:09 -07:00
Kevin Bracey 617f50cbfd rev-list-options.txt: correct TREESAME for P
In the example given, P is not TREESAME to E. This doesn't affect the
current result, but it will matter when we change behaviour.

Signed-off-by: Kevin Bracey <kevin@bracey.fi>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-16 11:51:08 -07:00
Junio C Hamano ab84621754 Git 1.8.3-rc2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-13 11:09:42 -07:00
Jeff King f269048754 fetch: opportunistically update tracking refs
When we run a regular "git fetch" without arguments, we
update the tracking refs according to the configured
refspec. However, when we run "git fetch origin master" (or
"git pull origin master"), we do not look at the configured
refspecs at all, and just update FETCH_HEAD.

We miss an opportunity to update "refs/remotes/origin/master"
(or whatever the user has configured). Some users find this
confusing, because they would want to do further comparisons
against the old state of the remote master, like:

  $ git pull origin master
  $ git log HEAD...origin/master

In the currnet code, they are comparing against whatever
commit happened to be in origin/master from the last time
they did a complete "git fetch".  This patch will update a
ref from the RHS of a configured refspec whenever we happen
to be fetching its LHS. That makes the case above work.

The downside is that any users who really care about whether
and when their tracking branches are updated may be
surprised.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-12 15:23:48 -07:00
Thomas Rast 4ab90e7a5c fetch/pull doc: untangle meaning of bare <ref>
The documentation erroneously used the same wording for both fetch and
pull, stating that something will be merged even in git-fetch(1).

In addition, saying that "<ref> is equivalent to <ref>:" doesn't
really help anyone who still needs to read manpages.  Clarify what is
actually going on.

Signed-off-by: Thomas Rast <trast@inf.ethz.ch>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-12 15:23:47 -07:00
Junio C Hamano 9249175291 Merge git://git.bogomips.org/git-svn
* git://git.bogomips.org/git-svn:
  git-svn: added an --include-path flag
  Git::SVN::*: add missing "NAME" section to perldoc
  git-svn: avoid self-referencing mergeinfo
2013-05-11 11:09:00 -07:00
Dale Worley 48bc1755b6 CodingGuidelines: Documentation/*.txt are the sources
People not familiar with AsciiDoc may not realize they are
supposed to update *.txt files and not *.html/*.1 files when
preparing patches to the project.

Signed-off-by: Dale Worley <worley@ariadne.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-10 12:13:08 -07:00
Jeff King 335ec3bf41 grep: allow to use textconv filters
Recently and not so recently, we made sure that log/grep type operations
use textconv filters when a userfacing diff would do the same:

ef90ab6 (pickaxe: use textconv for -S counting, 2012-10-28)
b1c2f57 (diff_grep: use textconv buffers for add/deleted files, 2012-10-28)
0508fe5 (combine-diff: respect textconv attributes, 2011-05-23)

"git grep" currently does not use textconv filters at all, that is
neither for displaying the match and context nor for the actual grepping,
even when requested by --textconv.

Introduce an option "--textconv" which makes git grep use any configured
textconv filters for grepping and output purposes. It is off by default.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-10 10:27:31 -07:00
Junio C Hamano 6c374008b1 diff_opt: track whether flags have been set explicitly
The diff_opt infrastructure sets flags based on defaults and command
line options.  It is impossible to tell whether a flag has been set
as a default or on explicit request.  Update the structure so that
this detection is possible:

 * Add an extra "opt->touched_flags" that keeps track of all the
   fields that have been touched by DIFF_OPT_SET and DIFF_OPT_CLR.

 * You may continue setting the default values to the flags, like
   commands in the "log" family do in cmd_log_init_defaults(), but
   after you finished setting the defaults, you clear the
   touched_flags field;

 * And then you let the usual callchain call diff_opt_parse(),
   allowing the opt->flags be set or unset, while keeping track of
   which bits the user touched;

 * There is an optional callback "opt->set_default" that is called
   at the very beginning to let you inspect touched_flags and update
   opt->flags appropriately, before the remainder of the diffcore
   machinery is set up, taking the opt->flags value into account.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-10 10:24:17 -07:00
Junio C Hamano b387c77b12 Sync with v1.8.2.3
* maint:
  Git 1.8.2.3
  t5004: avoid using tar for checking emptiness of archive
  t5004: ignore pax global header file
  mergetools/kdiff3: do not use --auto when diffing
  transport-helper: trivial style cleanup
2013-05-09 13:32:54 -07:00
Junio C Hamano 92758dd2a2 Git 1.8.2.3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-09 13:31:17 -07:00
Paul Walmsley a7b102302a git-svn: added an --include-path flag
The SVN::Fetcher module is now able to filter for inclusion as well
as exclusion (as used by --ignore-path). Also added tests, documentation
changes and git completion script.

If you have an SVN repository with many top level directories and you
only want a git-svn clone of some of them then using --ignore-path is
difficult as it requires a very long regexp. In this case it's much
easier to filter for inclusion.

[ew: remove trailing whitespace]

Signed-off-by: Paul Walmsley <pjwhams@gmail.com>
Signed-off-by: Eric Wong <normalperson@yhbt.net>
2013-05-09 01:13:36 +00:00
Felipe Contreras cdfd94837b Add new @ shortcut for HEAD
Typing 'HEAD' is tedious, especially when we can use '@' instead.

The reason for choosing '@' is that it follows naturally from the
ref@op syntax (e.g. HEAD@{u}), except we have no ref, and no
operation, and when we don't have those, it makes sens to assume
'HEAD'.

So now we can use 'git show @~1', and all that goody goodness.

Until now '@' was a valid name, but it conflicts with this idea, so
let's make it invalid. Probably very few people, if any, used this name.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-08 12:13:12 -07:00
Junio C Hamano 9b795193a6 Update draft release notes for 1.8.3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-07 22:50:05 -07:00
Nguyễn Thái Ngọc Duy 60003340cd clone: allow cloning local paths with colons in them
Usually "foo:bar" is interpreted as an ssh url. This patch allows to
clone from such paths by putting at least one slash before the colon
(i.e. /path/to/foo:bar or just ./foo:bar).

file://foo:bar should also work, but local optimizations are off in
that case, which may be unwanted. While at there, warn the users about
--local being ignored in this case.

Reported-by: William Giokas <1007380@gmail.com>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-07 08:32:14 -07:00
Junio C Hamano 1c937682c2 Sync with maint
* maint:
  completion: zsh: don't override suffix on _detault
  Documentation/git-commit: Typo under --edit
2013-05-03 15:17:38 -07:00
Junio C Hamano 571cdfd4e0 Merge branch 'tr/remote-tighten-commandline-parsing' into maint
* tr/remote-tighten-commandline-parsing:
  remote: 'show' and 'prune' can take more than one remote
  remote: check for superfluous arguments in 'git remote add'
  remote: add a test for extra arguments, according to docs
2013-05-03 15:12:38 -07:00
Junio C Hamano 49010c354f Merge branch 'jn/glossary-revision' into maint
* jn/glossary-revision:
  glossary: a revision is just a commit
2013-05-03 15:12:16 -07:00
Anders Granskogen Bjørnstad 9a3e36cd67 Documentation/git-commit: Typo under --edit
-C takes a commit object, not a file.

Signed-off-by: Anders Granskogen Bjørnstad <andersgb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-02 12:03:40 -07:00
Junio C Hamano de0977d528 Update draft release notes to 1.8.3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-01 15:32:24 -07:00
Marc Branchaud e7a3c902a6 Fix grammar in the 1.8.3 release notes.
Signed-off-by: Marc Branchaud <marcnarc@xiplink.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-01 15:25:24 -07:00
Junio C Hamano c259a1a927 Merge branch 'tr/remote-tighten-commandline-parsing'
* tr/remote-tighten-commandline-parsing:
  remote: 'show' and 'prune' can take more than one remote
  remote: check for superfluous arguments in 'git remote add'
  remote: add a test for extra arguments, according to docs
2013-05-01 15:24:01 -07:00
Michael Heemskerk af04fa2a78 upload-pack: ignore 'shallow' lines with unknown obj-ids
When the client sends a 'shallow' line for an object that the server does
not have, the server currently dies with the error: "did not find object
for shallow <obj-id>".  The client may have truncated the history at
the commit by fetching shallowly from a different server, or the commit
may have been garbage collected by the server. In either case, this
unknown commit is not relevant for calculating the pack that is to be
sent and can be safely ignored, and it is not used when recomputing where
the updated history of the client is cauterised.

The documentation in technical/pack-protocol.txt has been updated to
remove the restriction that "Clients MUST NOT mention an obj-id which it
does not know exists on the server". This requirement is not realistic
because clients cannot know whether an object has been garbage collected
by the server.

Signed-off-by: Michael Heemskerk <mheemskerk@atlassian.com>
Reviewed-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-28 22:33:53 -07:00
Junio C Hamano 89740333e8 Merge branch 'maint'
* maint:
  documentation: trivial whitespace cleanups
  t/Makefile: remove smoke test targets
2013-04-28 14:47:24 -07:00
Felipe Contreras 240ae2b8c9 documentation: trivial whitespace cleanups
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-28 14:46:52 -07:00
Junio C Hamano b75cdfaa88 Git 1.8.3-rc0
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-26 15:45:09 -07:00
Junio C Hamano 2a407d7443 Merge branch 'rr/shortlog-doc'
Update documentation for "log" and "shortlog".

* rr/shortlog-doc:
  builtin/shortlog.c: make usage string consistent with log
  builtin/log.c: make usage string consistent with doc
  git-shortlog.txt: make SYNOPSIS match log, update OPTIONS
  git-log.txt: rewrite note on why "--" may be required
  git-log.txt: generalize <since>..<until>
  git-log.txt: order OPTIONS properly; move <since>..<until>
  revisions.txt: clarify the .. and ... syntax
  git-shortlog.txt: remove (-h|--help) from OPTIONS
2013-04-26 15:28:39 -07:00
Junio C Hamano 019eb0dd35 Merge branch 'jn/glossary-revision'
The wording for "revision" in the glossary wanted to say it refers
to "commit (noun) as a concept" but it was badly phrased.

This may need further updates to hint that in contexts where it is
clear, the word may refer to an object name, not necessarily a
commit. But the patch as-is is already an improvement.

* jn/glossary-revision:
  glossary: a revision is just a commit
2013-04-26 15:28:23 -07:00
Junio C Hamano 838f9c1eb6 Merge branch 'jc/add-ignore-removal'
Introduce "--ignore-removal" as a synonym to "--no-all" for "git
add", and improve the 2.0 migration warning with it.

* jc/add-ignore-removal:
  git add: rephrase -A/--no-all warning
  git add: --ignore-removal is a better named --no-all
2013-04-26 15:28:09 -07:00
Junio C Hamano e27004e341 Sync with 1.8.2.2 2013-04-26 13:00:48 -07:00
Junio C Hamano 4a9a4f0ec1 Git 1.8.2.2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-26 12:59:36 -07:00
Junio C Hamano 40a9c3c9a0 Merge branch 'jn/gitweb-install-doc' into maint
* jn/gitweb-install-doc:
  gitweb/INSTALL: GITWEB_CONFIG_SYSTEM is for backward compatibility
  gitweb/INSTALL: Simplify description of GITWEB_CONFIG_SYSTEM
2013-04-26 11:12:48 -07:00
Junio C Hamano 27ec394a97 prune: introduce OPT_EXPIRY_DATE() and use it
Earlier we added support for --expire=all (or --expire=now) that
considers all crufts, regardless of their age, as eligible for
garbage collection by turning command argument parsers that use
approxidate() to use parse_expiry_date(), but "git prune" used a
built-in parse-options facility OPT_DATE() and did not benefit from
the new function.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-25 11:42:10 -07:00
Junio C Hamano cd33b41c69 Merge branch 'jk/remote-helper-with-signed-tags'
Allows remote-helpers to declare they can handle signed tags, and
issue a warning when using those that don't.

* jk/remote-helper-with-signed-tags:
  transport-helper: add 'signed-tags' capability
  transport-helper: pass --signed-tags=warn-strip to fast-export
  fast-export: add --signed-tags=warn-strip mode
2013-04-24 16:30:50 -07:00
Junio C Hamano 2d0b07178d Sync with maint
* maint:
  Update draft release notes to 1.8.2.2
  completion: remove duplicate block for "git commit -c"
  cherry-pick/revert: make usage say '<commit-ish>...'
2013-04-24 16:30:04 -07:00
Junio C Hamano 173f9a7145 Update draft release notes to 1.8.2.2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-24 16:22:07 -07:00
Junio C Hamano e4d15959d4 Merge branch 'jk/diff-algo-finishing-touches' into maint
"git diff --diff-algorithm=algo" was understood by the command line
parser, but "git diff --diff-algorithm algo" was not.

* jk/diff-algo-finishing-touches:
  diff: allow unstuck arguments with --diff-algorithm
  git-merge(1): document diff-algorithm option to merge-recursive
2013-04-24 16:19:42 -07:00
Thomas Rast b17dd3f9d6 remote: 'show' and 'prune' can take more than one remote
The 'git remote show' and 'prune' subcommands are documented as taking
only a single remote name argument, but that is not the case; they
will simply iterate the action over all remotes given.  Update the
documentation and tests to match.

With the last user of the -f flag gone, we also remove the code
supporting it.

Signed-off-by: Thomas Rast <trast@inf.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-24 13:13:21 -07:00
Junio C Hamano 562af5b0b9 Update draft release notes to 1.8.3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-23 11:27:15 -07:00
Junio C Hamano e52e6f79cc Merge branch 'nd/pretty-formats'
pretty-printing body of the commit that is stored in non UTF-8
encoding did not work well.  The early part of this series fixes
it.  And then it adds %C(auto) specifier that turns the coloring on
when we are emitting to the terminal, and adds column-aligning
format directives.

* nd/pretty-formats:
  pretty: support %>> that steal trailing spaces
  pretty: support truncating in %>, %< and %><
  pretty: support padding placeholders, %< %> and %><
  pretty: add %C(auto) for auto-coloring
  pretty: split color parsing into a separate function
  pretty: two phase conversion for non utf-8 commits
  utf8.c: add reencode_string_len() that can handle NULs in string
  utf8.c: add utf8_strnwidth() with the ability to skip ansi sequences
  utf8.c: move display_mode_esc_sequence_len() for use by other functions
  pretty: share code between format_decoration and show_decorations
  pretty-formats.txt: wrap long lines
  pretty: get the correct encoding for --pretty:format=%e
  pretty: save commit encoding from logmsg_reencode if the caller needs it
2013-04-23 11:22:48 -07:00
Junio C Hamano 7093d2c0dd Merge branch 'kb/status-ignored-optim-2'
Fixes a handful of issues in the code to traverse working tree to
find untracked and/or ignored files, cleans up and optimizes the
codepath in general.

* kb/status-ignored-optim-2:
  dir.c: git-status --ignored: don't scan the work tree twice
  dir.c: git-status --ignored: don't scan the work tree three times
  dir.c: git-status: avoid is_excluded checks for tracked files
  dir.c: replace is_path_excluded with now equivalent is_excluded API
  dir.c: unify is_excluded and is_path_excluded APIs
  dir.c: move prep_exclude
  dir.c: factor out parts of last_exclude_matching for later reuse
  dir.c: git-clean -d -X: don't delete tracked directories
  dir.c: make 'git-status --ignored' work within leading directories
  dir.c: git-status --ignored: don't list empty directories as ignored
  dir.c: git-ls-files --directories: don't hide empty directories
  dir.c: git-status --ignored: don't list empty ignored directories
  dir.c: git-status --ignored: don't list files in ignored directories
  dir.c: git-status --ignored: don't drop ignored directories
2013-04-23 11:21:23 -07:00
Junio C Hamano 9e94f9ba9e Merge branch 'jn/gitweb-install-doc'
Reword gitweb configuration instrutions.

* jn/gitweb-install-doc:
  gitweb/INSTALL: GITWEB_CONFIG_SYSTEM is for backward compatibility
  gitweb/INSTALL: Simplify description of GITWEB_CONFIG_SYSTEM
2013-04-23 11:17:08 -07:00
Junio C Hamano 9f60f49b92 git add: --ignore-removal is a better named --no-all
In the historical context of "git add --all ." that pays attention
to "all kinds of changes" (implying "without ignoring removals"),
the option to countermand it "--no-all" may have made sense, but
because we will be making "--all" the default when a pathspec is
given, it makes more sense to rename the option to a more explicit
"--ignore-removal".  The "--all" option naturally becomes its
negation, "--no-ignore-removal".

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-22 13:34:31 -07:00
Junio C Hamano 118f60ee06 Sync with maint 2013-04-22 11:33:31 -07:00
Junio C Hamano 3e7bb5da9f Start preparing for 1.8.2.2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-22 11:32:58 -07:00
Junio C Hamano 76f9bc9f53 Merge branch 'ta/glossary' into maint
* 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
2013-04-22 11:26:58 -07:00
Junio C Hamano 56303b8bb5 Merge branch 'jk/doc-http-backend' into maint
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
2013-04-22 11:26:58 -07:00
Junio C Hamano 34ab7fc461 Merge branch 'jk/daemon-user-doc' into maint
* jk/daemon-user-doc:
  doc: clarify that "git daemon --user=<user>" option does not export HOME=~user
2013-04-22 11:26:58 -07:00
Junio C Hamano be9d07f520 Merge branch 'jc/detached-head-doc' into maint
* jc/detached-head-doc:
  glossary: extend "detached HEAD" description

Conflicts:
	Documentation/glossary-content.txt
2013-04-22 11:26:57 -07:00
Junio C Hamano 3d88f83db2 Update draft release notes to 1.8.3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-22 11:18:43 -07:00
Junio C Hamano 561954bfa1 Merge branch 'jc/add-2.0-delete-default' (early part)
Preparatory steps to make "git add <pathspec>" take notice of
removed paths that match <pathspec> by default in Git 2.0.

* 'jc/add-2.0-delete-default' (early part):
  git add: rephrase the "removal will cease to be ignored" warning
  git add: rework the logic to warn "git add <pathspec>..." default change
  git add: start preparing for "git add <pathspec>..." to default to "-A"
  builtin/add.c: simplify boolean variables
2013-04-22 11:11:45 -07:00
Junio C Hamano de0d774d46 Merge branch 'nd/checkout-keep-sparse'
Make the initial "sparse" selection of the paths more sticky across
"git checkout".

* nd/checkout-keep-sparse:
  checkout: add --ignore-skip-worktree-bits in sparse checkout mode
2013-04-22 11:11:40 -07:00
Thomas Rast 4999266706 git-log(1): remove --full-line-diff description
This option is a remnant of an earlier log -L version, and not
currently implemented.  Remove it until (if at all) it is implemented
again.

Signed-off-by: Thomas Rast <trast@inf.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-22 07:53:59 -07:00
Ramkumar Ramachandra 46b2a46dd9 git-shortlog.txt: make SYNOPSIS match log, update OPTIONS
There are broadly two problems with the current SYNOPSIS.  First, it
completely omits the detail that paths can be specified.  Second, it
attempts to list all the options: this is futile as, in addition to
the options unique to it, it accepts all the options that git-rev-list
accepts.  In fixing these problems, make the SYNOPSIS consistent with
that in git-log.txt.  Also add the corresponding sections to OPTIONS.
Save adding the options from rev-list-options.txt for a later patch,
as it requires some work to pick out the options that are relevant to
shortlog.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-21 23:11:02 -07:00
Ramkumar Ramachandra 00200e9ea0 git-log.txt: rewrite note on why "--" may be required
In its current form, the note talks about separating options from
"branch names" and "refnames" in the same sentence.  This is entirely
inaccurate, as <revision range> need not be a set of branch names or
ref names.  Rewrite it to use the word "revision range", to be
consistent with the SYNOPSIS.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-21 23:10:51 -07:00
Ramkumar Ramachandra 21a40b90e9 git-log.txt: generalize <since>..<until>
'<since>..<until>' is misleading, as there are many other forms that
'git log' can accept as an argument.  Replace it with <revision range>,
referring to the section "Specifying Ranges" in revisions.txt, and
rewrite the section appropriately.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-21 23:10:40 -07:00
Ramkumar Ramachandra a682187e19 git-log.txt: order OPTIONS properly; move <since>..<until>
The OPTIONS section lists <since>..<until> as the first item, but this
is inconsistent with the ordering in SYNOPSIS.  Move it down until it
appears just before [[--] <path>...].

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-21 23:10:20 -07:00
Ramkumar Ramachandra 3a4dc48623 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>
2013-04-21 23:10:09 -07:00
Junio C Hamano 0f483436e9 line-log: fix documentation formatting
The second paragraph of the added description for the -L option
"<start> and <end> can take one of these forms:", and the list of
forms that follow the headline, were indented one level too short,
due to the missing "+" to signal that the next paragraph continues
the previous one.

Also "You can specify this option more than once" is about the -L
option, not about its various forms of starting and ending points.
Move it to the end of the main text.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-21 19:41:24 -07:00
Jonathan Nieder dfb44106cd 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>
2013-04-21 18:53:59 -07:00
Junio C Hamano ad77690fe4 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
2013-04-21 18:40:15 -07:00
Junio C Hamano c6c4d61673 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
2013-04-21 18:40:09 -07:00
Johan Herland 229177aaea glossary: Update and rephrase the definition of a remote-tracking branch
The definition of a remote-tracking branch in the glossary have been
out-of-date for a while (by e.g. referring to "Pull:" from old-style
$GIT_DIR/remotes files).

Also, the preceding patches have formalized that a remote-tracking branch
must match a configured refspec in order to be usable as an upstream.

This patch rewrites the paragraph on remote-tracking branches accordingly.

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-21 15:14:42 -07:00
Johan Herland fa83a33b22 checkout: Use remote refspecs when DWIMming tracking branches
The DWIM mode of checkout allows you to run "git checkout foo" when there
is no existing local ref or path called "foo", and there is exactly _one_
remote with a remote-tracking branch called "foo". Git will automatically
create a new local branch called "foo" using the remote-tracking "foo" as
its starting point and configured upstream.

For example, consider the following unconventional (but perfectly valid)
remote setup:

	[remote "origin"]
		fetch = refs/heads/*:refs/remotes/origin/*
	[remote "frotz"]
		fetch = refs/heads/*:refs/remotes/frotz/nitfol/*

Case 1: Assume both "origin" and "frotz" have remote-tracking branches called
"foo", at "refs/remotes/origin/foo" and "refs/remotes/frotz/nitfol/foo"
respectively. In this case "git checkout foo" should fail, because there is
more than one remote with a "foo" branch.

Case 2: Assume only "frotz" have a remote-tracking branch called "foo". In
this case "git checkout foo" should succeed, and create a local branch "foo"
from "refs/remotes/frotz/nitfol/foo", using remote branch "foo" from "frotz"
as its upstream.

The current code hardcodes the assumption that all remote-tracking branches
must match the "refs/remotes/$remote/*" pattern (which is true for remotes
with "conventional" refspecs, but not true for the "frotz" remote above).
When running "git checkout foo", the current code looks for exactly one ref
matching "refs/remotes/*/foo", hence in the above example, it fails to find
"refs/remotes/frotz/nitfol/foo", which causes it to fail both case #1 and #2.

The better way to handle the above example is to actually study the fetch
refspecs to deduce the candidate remote-tracking branches for "foo"; i.e.
assume "foo" is a remote branch being fetched, and then map "refs/heads/foo"
through the refspecs in order to get the corresponding remote-tracking
branches "refs/remotes/origin/foo" and "refs/remotes/frotz/nitfol/foo".
Finally we check which of these happens to exist in the local repo, and
if there is exactly one, we have an unambiguous match for "git checkout foo",
and may proceed.

This fixes most of the failing tests introduced in the previous patch.

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-21 15:14:41 -07:00
Ramkumar Ramachandra be6f722452 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>
2013-04-21 12:25:09 -07:00
Junio C Hamano d2949c7b3c Update draft release notes to 1.8.3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-19 13:53:44 -07:00
Junio C Hamano d7bffe9fb6 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
2013-04-19 13:31:27 -07:00
Junio C Hamano 4059da3352 Merge branch 'fc/branch-upstream-color'
Add more colors to "git branch -vv" output.

* fc/branch-upstream-color:
  branch: colour upstream branches
2013-04-19 13:31:24 -07:00
Junio C Hamano 574d51b575 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
2013-04-19 13:31:08 -07:00
Nguyễn Thái Ngọc Duy 1640632b4f 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>
2013-04-18 16:28:29 -07:00
Nguyễn Thái Ngọc Duy a7f01c6b4d 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>
2013-04-18 16:28:29 -07:00
Nguyễn Thái Ngọc Duy a57523428b 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>
2013-04-18 16:28:29 -07:00
Nguyễn Thái Ngọc Duy a95f067e3f 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>
2013-04-18 16:28:28 -07:00
Nguyễn Thái Ngọc Duy d2ea4afb03 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>
2013-04-18 16:28:27 -07:00
Junio C Hamano 1468a58393 Update draft release notes to 1.8.3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-18 12:03:09 -07:00
Junio C Hamano 288aa7534a 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
2013-04-18 11:49:11 -07:00
Junio C Hamano 8dd28584a5 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
2013-04-18 11:47:23 -07:00
Junio C Hamano cd797c7e6b Merge branch 'jc/detached-head-doc'
* jc/detached-head-doc:
  glossary: extend "detached HEAD" description
2013-04-18 11:46:29 -07:00
Michael Haggerty 8a09e6c5f9 api-parse-options.txt: document "no-" for non-boolean options
Document that the "no-" prefix can also be used for non-boolean
options.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-18 09:30:28 -07:00
Michael Haggerty 61929404df git-gc.txt, git-reflog.txt: document new expiry options
Document the new values that can be used for expiry values where their
use makes sense:

* git reflog expire --expire=[all|never]
* git reflog expire --expire-unreachable=[all|never]
* git gc --prune=all

Other combinations aren't useful and therefore no documentation is
added (even though they are allowed):

* git gc --prune=never

  is redundant with "git gc --no-prune"

* git prune --expire=all

  is equivalent to providing no --expire option

* git prune --expire=never

  is a NOP

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-18 09:30:15 -07:00
Felipe Contreras 21610d820b transport-helper: clarify pushing without refspecs
This has never worked, since it's inception the code simply skips all
the refs, essentially telling fast-export to do nothing.

Let's at least tell the user what's going on.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-17 23:27:03 -07:00
Felipe Contreras bb0a5cc9dc transport-helper: update refspec documentation
The refspec capability is not only used by 'import', also by
'export', and it's recommended in both.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-17 23:27:03 -07:00
Felipe Contreras 7a43c55415 transport-helper: clarify *:* refspec
The *:* refspec doesn't work, and never has, clarify the code and
documentation to reflect that. This in effect reverts commit 9e7673e
(gitremote-helpers(1): clarify refspec behaviour).

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-17 23:27:03 -07:00
Jonathan Nieder 1a39b72787 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.
2013-04-17 15:18:12 -07:00
Junio C Hamano aec3f77941 Update draft release notes to 1.8.3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-15 12:45:15 -07:00
Junio C Hamano 825ccfc23c 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
2013-04-15 12:40:58 -07:00
Karsten Blees 0aaf62b6e0 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>
2013-04-15 12:36:42 -07:00
Thomas Ackermann 57148ebb30 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>
2013-04-15 11:10:36 -07:00
Thomas Ackermann d5fa1f1a69 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>
2013-04-15 11:08:37 -07:00
Thomas Ackermann 3ab501209b 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>
2013-04-15 11:06:15 -07:00
Thomas Ackermann 79de45588c glossary: remove outdated/misleading/irrelevant entries
Signed-off-by: Thomas Ackermann <th.acker@arcor.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-15 11:04:52 -07:00
Felipe Contreras dbda21fa87 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>
2013-04-15 11:04:44 -07:00
John Keeping 0d957a4df5 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>
2013-04-15 09:04:43 -07:00
John Keeping cd16c59bfa 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>
2013-04-15 09:02:25 -07:00
Nguyễn Thái Ngọc Duy 08d595dc1c 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>
2013-04-15 08:54:45 -07:00
Jeff King b0808819e5 doc/http-backend: match query-string in apache half-auth example
When setting up a "half-auth" repository in which reads can
be done anonymously but writes require authentication, it is
best if the server can require authentication for both the
ref advertisement and the actual receive-pack POSTs. This
alleviates the need for the admin to set http.receivepack in
the repositories, and means that the client is challenged
for credentials immediately, instead of partway through the
push process (and git clients older than v1.7.11.7 had
trouble handling these challenges).

Since detecting a push during the ref advertisement requires
matching the query string, and this is non-trivial to do in
Apache, we have traditionally punted and instructed users to
just protect "/git-receive-pack$".  This patch provides the
mod_rewrite recipe to actually match the ref advertisement,
which is preferred.

While we're at it, let's add the recipe to our test scripts
so that we can be sure that it works, and doesn't get broken
(either by our changes or by changes in Apache).

Signed-off-by: Jeff King <peff@peff.net>
Acked-by: Jakub Narębski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-13 22:27:06 -07:00
Junio C Hamano caa7d79f1f Sync with 'maint'
* maint:
  Correct common spelling mistakes in comments and tests
  kwset: fix spelling in comments
  precompose-utf8: fix spelling of "want" in error message
  compat/nedmalloc: fix spelling in comments
  compat/regex: fix spelling and grammar in comments
  obstack: fix spelling of similar
  contrib/subtree: fix spelling of accidentally
  git-remote-mediawiki: spelling fixes
  doc: various spelling fixes
  fast-export: fix argument name in error messages
  Documentation: distinguish between ref and offset deltas in pack-format
  i18n: make the translation of -u advice in one go
2013-04-12 13:54:01 -07:00
Junio C Hamano 97ff97dc05 Merge branch 'mg/texinfo-5' into maint
* mg/texinfo-5:
  Documentation: Strip texinfo anchors to avoid duplicates
2013-04-12 13:41:48 -07:00
Junio C Hamano 788e98f8c0 Merge branch 'cn/commit-amend-doc' into maint
* cn/commit-amend-doc:
  Documentation/git-commit: reword the --amend explanation
2013-04-12 13:41:47 -07:00
Stefano Lattarini e1c3bf496f doc: various spelling fixes
Most of these were found using Lucas De Marchi's codespell tool.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-12 12:00:52 -07:00
Junio C Hamano 7f20008d14 Merge branch 'maint-1.8.1' into maint
* maint-1.8.1:
  fast-export: fix argument name in error messages
  Documentation: distinguish between ref and offset deltas in pack-format
2013-04-12 11:48:38 -07:00
Junio C Hamano 714d25868f doc: clarify that "git daemon --user=<user>" option does not export HOME=~user
The fact that we don't set $HOME may confuse admins who expect
~<user>/.gitconfig to be used, because that is not what we try to
read.  And worse, since 96b9e0e3, a git-daemon started by root is
likely to fail to run at all, as the user we switch to generally
cannot read ~root.

Signed-off-by: Jeff King <peff@peff.net>
Helped-by: W. Trevor King <wking@tremily.us>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-12 10:29:06 -07:00
Stefan Saasen 06cb843fea Documentation: distinguish between ref and offset deltas in pack-format
eb32d236 introduced the OBJ_OFS_DELTA object that uses a relative offset to
identify the base object instead of the 20-byte SHA1 reference. The pack file
documentation only mentions the SHA1 based reference in its description of the
deltified object entry.

Update the pack format documentation to clarify that the deltified object
representation refers to its base using either a relative negative offset or
the absolute SHA1 identifier.

Signed-off-by: Stefan Saasen <ssaasen@atlassian.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-12 09:14:01 -07:00
Modestas Vainius 4bc444eb64 Support FTP-over-SSL/TLS for regular FTP
Add a boolean http.sslTry option which allows to enable AUTH SSL/TLS and
encrypted data transfers when connecting via regular FTP protocol.

Default is false since it might trigger certificate verification errors on
misconfigured servers.

Signed-off-by: Modestas Vainius <modestas@vainius.eu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-12 08:52:23 -07:00
Junio C Hamano e2af9e361b Merge branch 'maint'
* maint:
  Typo fix: replacing it's -> its
  t: make PIPE a standard test prerequisite
  archive: clarify explanation of --worktree-attributes
  t/README: --immediate skips cleanup commands for failed tests
2013-04-11 17:41:48 -07:00
Junio C Hamano 7ece7ee607 Update dtaft release notes to 1.8.3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-11 17:41:14 -07:00
Junio C Hamano b3569933dd Merge branch 'po/help-guides'
"git help" learned "-g" option to show the list of guides just like
list of commands are given with "-a".

* po/help-guides:
  doc: include --guide option description for "git help"
  help: mention -a and -g option, and 'git help <concept>' usage.
  builtin/help.c: add list_common_guides_help() function
  builtin/help.c: add --guide option
  builtin/help.c: split "-a" processing into two
2013-04-11 17:41:00 -07:00
René Scharfe 59a7714c89 archive: clarify explanation of --worktree-attributes
Make it a bit clearer that --worktree-attributes is about files in the
working tree (checked out files, possibly changed) and not the current
working directory ($PWD).  Link to the ATTRIBUTES section, which has
more details.

Reported-by: Amit Bakshi <ambakshi@gmail.com>
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-11 17:38:45 -07:00
Adam Spiers f1ed7fea79 Documentation: add caveats about I/O buffering for check-{attr,ignore}
check-attr and check-ignore have the potential to deadlock callers
which do not read back the output in real-time.  For example, if a
caller writes N paths out and then reads N lines back in, it risks
becoming blocked on write() to check-*, and check-* is blocked on
write back to the caller.  Somebody has to buffer; the pipe buffers
provide some leeway, but they are limited.

Thanks to Peff for pointing this out:

    http://article.gmane.org/gmane.comp.version-control.git/220534

Signed-off-by: Adam Spiers <git@adamspiers.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-11 11:11:36 -07:00
Adam Spiers ae3caf4c91 check-ignore: add -n / --non-matching option
If `-n` or `--non-matching` are specified, non-matching pathnames will
also be output, in which case all fields in each output record except
for <pathname> will be empty.  This can be useful when running
check-ignore as a background process, so that files can be
incrementally streamed to STDIN, and for each of these files, STDOUT
will indicate whether that file matched a pattern or not.  (Without
this option, it would be impossible to tell whether the absence of
output for a given file meant that it didn't match any pattern, or
that the result simply hadn't been flushed to STDOUT yet.)

Signed-off-by: Adam Spiers <git@adamspiers.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-11 11:01:58 -07:00
Jeff King 3813a33de5 doc/http-backend: give some lighttpd config examples
The examples in the documentation are all for Apache. Let's
at least cover the basics: an anonymous server, an
authenticated server, and a "half auth" server with
anonymous read and authenticated write.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-11 07:33:21 -07:00
Jeff King fdae191003 doc/http-backend: clarify "half-auth" repo configuration
When the http-backend is set up to allow anonymous read but
authenticated write, the http-backend manual suggests
catching only the "/git-receive-pack" POST of the packfile,
not the initial "info/refs?service=git-receive-pack" GET in
which we advertise refs.

This does work and is secure, as we do not allow any write
during the info/refs request, and the information in the ref
advertisement is the same that you would get from a fetch.

However, the configuration required by the server is
slightly more complex. The default `http.receivepack`
setting is to allow pushes if the webserver tells us that
the user authenticated, and otherwise to return a 403
("Forbidden"). That works fine if authentication is turned
on completely; the initial request requires authentication,
and http-backend realizes it is OK to do a push.

But for this "half-auth" state, no authentication has
occurred during the initial ref advertisement. The
http-backend CGI therefore does not think that pushing
should be enabled, and responds with a 403. The client
cannot continue, even though the server would have allowed
it to run if it had provided credentials.

It would be much better if the server responded with a 401,
asking for credentials during the initial contact. But
git-http-backend does not know about the server's auth
configuration (so a 401 would be confusing in the case of a
true anonymous server). Unfortunately, configuring Apache to
recognize the query string and apply the auth appropriately
to receive-pack (but not upload-pack) initial requests is
non-trivial.

The site admin can work around this by just turning on
http.receivepack explicitly in its repositories. Let's
document this workaround.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-11 07:33:07 -07:00
Antoine Pelisse 1918225d2f count-objects: add -H option to humanize sizes
Use the new humanize() function to print loose objects size, pack size,
and garbage size in verbose mode, or loose objects size in regular mode.
This patch doesn't change the way anything is displayed when the option
is not used.

Also update the documentation.

Signed-off-by: Antoine Pelisse <apelisse@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-10 13:27:26 -07:00
Antoine Pelisse 079b546a29 strbuf: create strbuf_humanise_bytes() to show byte sizes
Humanization of downloaded size is done in the same function as text
formatting in 'process.c'. The code cannot be reused easily elsewhere.

Separate text formatting from size simplification and make the
function public in strbuf so that it can easily be used by other
callers.

We now can use strbuf_humanise_bytes() for both downloaded size and
download speed calculation. One of the drawbacks is that speed will
now look like this when download is stalled: "0 bytes/s" instead of
"0 KiB/s".

Signed-off-by: Antoine Pelisse <apelisse@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-10 12:58:33 -07:00
Junio C Hamano 52a3e011c7 Sync with 1.8.2.1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-07 15:28:50 -07:00
Junio C Hamano 5bda18c186 Git 1.8.2.1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-07 15:27:23 -07:00
Junio C Hamano c17b651f19 Update draft release notes to 1.8.3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-07 14:40:26 -07:00
Junio C Hamano 60eea92b50 Merge branch 'cn/commit-amend-doc'
* cn/commit-amend-doc:
  Documentation/git-commit: reword the --amend explanation
2013-04-07 14:33:06 -07:00
Junio C Hamano cd5123da9b Merge branch 'mg/texinfo-5'
Strip @anchor elements in the texinfo output of the documentation,
as a single document created by concatenating our entire manual set
will produce many duplicates that makes newer texinfo unhappy.

* mg/texinfo-5:
  Documentation: Strip texinfo anchors to avoid duplicates
2013-04-07 14:32:59 -07:00
Junio C Hamano 4d35924e3a Merge branch 'rr/triangle'
Support "pull from one place, push to another place" workflow
better by introducing remote.pushdefault (overrides the "origin"
thing) and branch.*.pushremote (overrides the branch.*.remote).

* rr/triangle:
  remote.c: introduce branch.<name>.pushremote
  remote.c: introduce remote.pushdefault
  remote.c: introduce a way to have different remotes for fetch/push
  t5516 (fetch-push): drop implicit arguments from helper functions
  t5516 (fetch-push): update test description
  remote.c: simplify a bit of code using git_config_string()
2013-04-07 14:32:50 -07:00
Felipe Contreras 2a4c26076c format-patch: add format.coverLetter configuration variable
Also, add a new option: 'auto', so if there's more than one patch, the
cover letter is generated, otherwise it's not.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-07 13:37:47 -07:00
Junio C Hamano 6466fbbeef Sync with 1.8.1.6 2013-04-07 13:17:50 -07:00
Junio C Hamano 2137ce01f8 Git 1.8.1.6
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-07 08:58:30 -07:00
Felipe Contreras 402596aafa send-email: make annotate configurable
Some people always do --annotate, lets not force them to always type
that.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-07 00:42:29 -07:00
John Keeping 9e7673ed7f gitremote-helpers(1): clarify refspec behaviour
The documentation says that "If no 'refspec' capability is advertised,
there is an implied `refspec *:*`" but this is only the case for the
"import" command.

Since there is a comment in transport-helper.c indicating that this
default is for historical reasons, change the documentation to clarify
that a refspec should always be specified.

Signed-off-by: John Keeping <john@keeping.me.uk>
Acked-by: Sverre Rabbelier <srabbelier@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-07 00:40:48 -07:00
Antoine Pelisse c4458ecdc5 fast-export: Allow pruned-references in mark file
fast-export can fail because of some pruned-reference when importing a
mark file.

The problem happens in the following scenario:

    $ git fast-export --export-marks=MARKS master
    (rewrite master)
    $ git prune
    $ git fast-export --import-marks=MARKS master

This might fail if some references have been removed by prune
because some marks will refer to no longer existing commits.
git-fast-export will not need these objects anyway as they were no
longer reachable.

We still need to update last_numid so we don't change the mapping
between marks and objects for remote-helpers.
Unfortunately, the mark file should not be rewritten without lost marks
if no new objects has been exported, as we could lose track of the last
last_numid.

Signed-off-by: Antoine Pelisse <apelisse@gmail.com>
Reviewed-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-07 00:40:23 -07:00
Junio C Hamano 21ccebec0d Update draft release notes to 1.8.3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-05 14:19:57 -07:00
Junio C Hamano 7cd895e59e Merge branch 'mh/rev-parse-verify-doc'
"rev-parse --verify" was documented in a misleading way.

* mh/rev-parse-verify-doc:
  rev-parse: clarify documentation for the --verify option
2013-04-05 14:15:20 -07:00
Junio C Hamano d5fec92a7a Merge branch 'sg/gpg-sig'
Teach "merge/pull" to optionally verify and reject commits that are
not signed properly.

* sg/gpg-sig:
  pretty printing: extend %G? to include 'N' and 'U'
  merge/pull Check for untrusted good GPG signatures
  merge/pull: verify GPG signatures of commits being merged
  commit.c/GPG signature verification: Also look at the first GPG status line
  Move commit GPG signature verification to commit.c
2013-04-05 14:15:16 -07:00
John Keeping 4db4f0fba4 git-merge(1): document diff-algorithm option to merge-recursive
Commit 07924d4 (diff: Introduce --diff-algorithm command line option
2013-01-16) added diff-algorithm as a parameter to the recursive merge
strategy but did not document it.  Do so.

Signed-off-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-05 10:57:23 -07:00
Junio C Hamano 1d77d249f9 glossary: extend "detached HEAD" description
When we introduced the concept of "detached HEAD", we made sure that
commands that operate on the history of the current branch "just
work" in that state.  They update the HEAD to point at the new
history without affecting any branch when the HEAD is detached, just
like they update the tip of the "current branch" to point at the new
history when HEAD points at a specific branch.

As this is done as the natural extension for these commands, we did
not, we still do not, and we do not want to repeat "A detached HEAD
is updated without affecting any branch" when describing what each
and every one of these commands that operates "on the current branch"
does.

Add a blanket description to the glossary to cover them instead.
The general principle is that operations to update the branch work
on and affect the HEAD, while operations to update the information
about a branch do not.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-05 10:42:58 -07:00
Carlos Martín Nieto aa7b8c657e Documentation/git-commit: reword the --amend explanation
The explanation for 'git commit --amend' talks about preparing a tree
object, which shouldn't be how user-facing documentation talks about
commit.

Reword it to say it works as usual, but replaces the current commit.

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-05 07:40:39 -07:00
Martin von Gagern cbfd124c22 Documentation: Strip texinfo anchors to avoid duplicates
This keeps texinfo 5.x happy. See https://bugs.gentoo.org/464210.

Signed-off-by: Martin von Gagern <Martin.vGagern@gmx.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-03 16:14:19 -07:00
Junio C Hamano 8d994db46e Update draft release notes to 1.8.3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-03 09:44:50 -07:00
Junio C Hamano 260dba5d49 Sync with maint 2013-04-03 09:44:34 -07:00
Junio C Hamano 1b7b22bfd0 Merge branch 'jc/sha1-name-object-peeler'
There was no good way to ask "I have a random string that came from
outside world. I want to turn it into a 40-hex object name while
making sure such an object exists".  A new peeling suffix ^{object}
can be used for that purpose, together with "rev-parse --verify".

* jc/sha1-name-object-peeler:
  peel_onion(): teach $foo^{object} peeler
  peel_onion: disambiguate to favor tree-ish when we know we want a tree-ish
2013-04-03 09:34:54 -07:00
Junio C Hamano 19534ee8a7 Update draft release notes to 1.8.2.1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-03 09:29:14 -07:00
Junio C Hamano b771d8d7cf Merge branch 'mg/gpg-interface-using-status' into maint
Verification of signed tags were not done correctly when not in C
or en/US locale.

* mg/gpg-interface-using-status:
  pretty: make %GK output the signing key for signed commits
  pretty: parse the gpg status lines rather than the output
  gpg_interface: allow to request status return
  log-tree: rely upon the check in the gpg_interface
  gpg-interface: check good signature in a reliable way
2013-04-03 09:26:27 -07:00
Junio C Hamano 14c79b1faa Merge branch 'bc/commit-complete-lines-given-via-m-option' into maint
'git commit -m "$msg"' used to add an extra newline even when
$msg already ended with one.

* bc/commit-complete-lines-given-via-m-option:
  Documentation/git-commit.txt: rework the --cleanup section
  git-commit: only append a newline to -m mesg if necessary
  t7502: demonstrate breakage with a commit message with trailing newlines
  t/t7502: compare entire commit message with what was expected
2013-04-03 09:26:07 -07:00
Junio C Hamano 92e0d91632 Sync with 1.8.1 maintenance track
* maint-1.8.1:
  Start preparing for 1.8.1.6
  git-tag(1): we tag HEAD by default
  Fix revision walk for commits with the same dates
  t2003: work around path mangling issue on Windows
  pack-refs: add fully-peeled trait
  pack-refs: write peeled entry for non-tags
  use parse_object_or_die instead of die("bad object")
  avoid segfaults on parse_object failure
  entry: fix filter lookup
  t2003: modernize style
  name-hash.c: fix endless loop with core.ignorecase=true
2013-04-03 09:18:01 -07:00
Junio C Hamano 072dda68ea Start preparing for 1.8.1.6
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-03 09:12:11 -07:00
Junio C Hamano 0311e373b5 Merge branch 'yd/doc-merge-annotated-tag' into maint-1.8.1
* yd/doc-merge-annotated-tag:
  Documentation: merging a tag is a special case
2013-04-03 08:36:52 -07:00
Thomas Rast dd686cd4b1 git-tag(1): we tag HEAD by default
The <commit>|<object> argument is actually not explained anywhere
(except implicitly in the description of an unannotated tag).  Write a
little explanation, in particular to cover the default.

Signed-off-by: Thomas Rast <trast@inf.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-03 08:33:56 -07:00
Philip Oakley a133737b80 doc: include --guide option description for "git help"
Note that the ability to display an individual guide was always
possible. Include this in the update.

Also tell readers how git(1) can be accessed, especially for Git for
Windows users who do not have the 'man' command.  Likewise include a
commentary on how to access this page (Catch 22).

Signed-off-by: Philip Oakley <philipoakley@iee.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-03 07:43:29 -07:00
Junio C Hamano 961c5129d5 Update draft release notes to 1.8.3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-02 15:14:26 -07:00
Junio C Hamano c5f05b2356 Merge branch 'bk/document-commit-tree-S'
* bk/document-commit-tree-S:
  commit-tree: document -S option consistently
2013-04-02 15:09:43 -07:00
Ramkumar Ramachandra 9f765ce62f remote.c: introduce branch.<name>.pushremote
This new configuration variable overrides `remote.pushdefault` and
`branch.<name>.remote` for pushes.  When you pull from one
place (e.g. your upstream) and push to another place (e.g. your own
publishing repository), you would want to set `remote.pushdefault` to
specify the remote to push to for all branches, and use this option to
override it for a specific branch.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-02 10:41:43 -07:00
Ramkumar Ramachandra 224c217163 remote.c: introduce remote.pushdefault
This new configuration variable defines the default remote to push to,
and overrides `branch.<name>.remote` for all branches.  It is useful
in the typical triangular-workflow setup, where the remote you're
fetching from is different from the remote you're pushing to.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-02 10:41:42 -07:00
Michael Haggerty 2db60670ba rev-parse: clarify documentation for the --verify option
The old version could be read to mean that the argument has to refer
to a valid object, but that is incorrect:

* the object is not necessarily read (e.g., to check for corruption)

* if the argument is a 40-digit string of hex digits, then it is
  accepted whether or not is is the name of an existing object.

So reword the explanation to be less ambiguous.

Also fix the examples involving --verify: to be sure that the argument
refers to a commit (rather than some other kind of object), the
argument has to be suffixed with "^{commit}".  This trick is not
possible in the example involving --default, so don't imply that it is
exactly the same as the previous example.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-02 08:41:17 -07:00
Junio C Hamano cc3e4eba72 Update draft release notes to 1.8.3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-01 09:24:56 -07:00
Junio C Hamano b442731638 Merge branch 'maint'
* maint:
  Update draft release notes to 1.8.2.1
2013-04-01 09:23:30 -07:00
Junio C Hamano 40a0f842da Update draft release notes to 1.8.2.1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-01 09:23:05 -07:00
Junio C Hamano 432930bd33 Merge branch 'yd/doc-is-in-asciidoc' into maint
* yd/doc-is-in-asciidoc:
  CodingGuidelines: our documents are in AsciiDoc
2013-04-01 09:19:40 -07:00
Junio C Hamano ab24e7521c Merge branch 'yd/doc-merge-annotated-tag' into maint
* yd/doc-merge-annotated-tag:
  Documentation: merging a tag is a special case
2013-04-01 09:19:37 -07:00
Junio C Hamano fec274b01f Merge branch 'tb/document-status-u-tradeoff' into maint
* tb/document-status-u-tradeoff:
  status: advise to consider use of -u when read_directory takes too long
  git status: document trade-offs in choosing parameters to the -u option
2013-04-01 09:19:30 -07:00
Junio C Hamano 41e603af58 Merge branch 'da/downcase-u-in-usage' into maint
* da/downcase-u-in-usage:
  contrib/mw-to-git/t/install-wiki.sh: use a lowercase "usage:" string
  contrib/examples/git-remote.perl: use a lowercase "usage:" string
  tests: use a lowercase "usage:" string
  git-svn: use a lowercase "usage:" string
  Documentation/user-manual.txt: use a lowercase "usage:" string
  templates/hooks--update.sample: use a lowercase "usage:" string
  contrib/hooks/setgitperms.perl: use a lowercase "usage:" string
  contrib/examples: use a lowercase "usage:" string
  contrib/fast-import/import-zips.py: use spaces instead of tabs
  contrib/fast-import/import-zips.py: fix broken error message
  contrib/fast-import: use a lowercase "usage:" string
  contrib/credential: use a lowercase "usage:" string
  git-cvsimport: use a lowercase "usage:" string
  git-cvsimport: use a lowercase "usage:" string
  git-cvsexportcommit: use a lowercase "usage:" string
  git-archimport: use a lowercase "usage:" string
  git-merge-one-file: use a lowercase "usage:" string
  git-relink: use a lowercase "usage:" string
  git-svn: use a lowercase "usage:" string
  git-sh-setup: use a lowercase "usage:" string
2013-04-01 09:19:04 -07:00
Sebastian Götte e290c4b944 pretty printing: extend %G? to include 'N' and 'U'
Expand %G? in pretty format strings to 'N' in case of no GPG signature
and 'U' in case of a good but untrusted GPG signature in addition to
the previous 'G'ood and 'B'ad. This eases writing anyting parsing
git-log output.

Signed-off-by: Sebastian Götte <jaseg@physik-pool.tu-berlin.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-31 22:38:53 -07:00
Sebastian Götte eb307ae7bb merge/pull Check for untrusted good GPG signatures
When --verify-signatures is specified, abort the merge in case a good
GPG signature from an untrusted key is encountered.

Signed-off-by: Sebastian Götte <jaseg@physik-pool.tu-berlin.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-31 22:38:49 -07:00
Sebastian Götte efed002249 merge/pull: verify GPG signatures of commits being merged
When --verify-signatures is specified on the command-line of git-merge
or git-pull, check whether the commits being merged have good gpg
signatures and abort the merge in case they do not. This allows e.g.
auto-deployment from untrusted repo hosts.

Signed-off-by: Sebastian Götte <jaseg@physik-pool.tu-berlin.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-31 19:23:59 -07:00
Junio C Hamano a6a3f2cc07 peel_onion(): teach $foo^{object} peeler
A string that names an object can be suffixed with ^{type} peeler to
say "I have this object name; peel it until you get this type. If
you cannot do so, it is an error".  v1.8.2^{commit} asks for a commit
that is pointed at an annotated tag v1.8.2; v1.8.2^{tree} unwraps it
further to the top-level tree object.  A special suffix ^{} (i.e. no
type specified) means "I do not care what it unwraps to; just peel
annotated tag until you get something that is not a tag".

When you have a random user-supplied string, you can turn it to a
bare 40-hex object name, and cause it to error out if such an object
does not exist, with:

	git rev-parse --verify "$userstring^{}"

for most objects, but this does not yield the tag object name when
$userstring refers to an annotated tag.

Introduce a new suffix, ^{object}, that only makes sure the given
name refers to an existing object.  Then

	git rev-parse --verify "$userstring^{object}"

becomes a way to make sure $userstring refers to an existing object.

This is necessary because the plumbing "rev-parse --verify" is only
about "make sure the argument is something we can feed to get_sha1()
and turn it into a raw 20-byte object name SHA-1" and is not about
"make sure that 20-byte object name SHA-1 refers to an object that
exists in our object store".  When the given $userstring is already
a 40-hex, by definition "rev-parse --verify $userstring" can turn it
into a raw 20-byte object name.  With "$userstring^{object}", we can
make sure that the 40-hex string names an object that exists in our
object store before "--verify" kicks in.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-31 15:57:42 -07:00
Junio C Hamano f893be2712 Merge branch 'yd/doc-is-in-asciidoc'
* yd/doc-is-in-asciidoc:
  CodingGuidelines: our documents are in AsciiDoc
2013-03-28 14:38:20 -07:00
Junio C Hamano f1c8d8338f Merge branch 'yd/doc-merge-annotated-tag'
Document the 1.7.9 feature to merge a signed tag and keep that in
the mergetag header in the resulting commit better.

* yd/doc-merge-annotated-tag:
  Documentation: merging a tag is a special case
2013-03-28 14:38:17 -07:00
Junio C Hamano 18973d8ac9 Merge branch 'jk/difftool-dir-diff-edit-fix'
"git difftool --dir-diff" made symlinks to working tree files when
preparing a temporary directory structure, so that accidental edits
of these files in the difftool are reflected back to the working
tree, but the logic to decide when to do so was not quite right.

* jk/difftool-dir-diff-edit-fix:
  difftool --dir-diff: symlink all files matching the working tree
  difftool: avoid double slashes in symlink targets
  git-difftool(1): fix formatting of --symlink description
2013-03-28 14:37:22 -07:00
Junio C Hamano d8355e5eae Merge branch 'maint'
* maint:
  git help config: s/insn/instruction/
2013-03-28 14:34:55 -07:00
Junio C Hamano 5e950c2199 Merge branch 'maint-1.8.1' into maint
* maint-1.8.1:
  git help config: s/insn/instruction/
2013-03-28 14:34:07 -07:00
Thomas Rast 13b8f68c1f log -L: :pattern:file syntax to find by funcname
This new syntax finds a funcname matching /pattern/, and then takes from there
up to (but not including) the next funcname.  So you can say

  git log -L:main:main.c

and it will dig up the main() function and show its line-log, provided
there are no other funcnames matching 'main'.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-28 10:30:04 -07:00
Thomas Rast 12da1d1f6f Implement line-history search (git log -L)
This is a rewrite of much of Bo's work, mainly in an effort to split
it into smaller, easier to understand routines.

The algorithm is built around the struct range_set, which encodes a
series of line ranges as intervals [a,b).  This is used in two
contexts:

* A set of lines we are tracking (which will change as we dig through
  history).
* To encode diffs, as pairs of ranges.

The main routine is range_set_map_across_diff().  It processes the
diff between a commit C and some parent P.  It determines which diff
hunks are relevant to the ranges tracked in C, and computes the new
ranges for P.

The algorithm is then simply to process history in topological order
from newest to oldest, computing ranges and (partial) diffs.  At
branch points, we need to merge the ranges we are watching.  We will
find that many commits do not affect the chosen ranges, and mark them
TREESAME (in addition to those already filtered by pathspec limiting).
Another pass of history simplification then gets rid of such commits.

This is wired as an extra filtering pass in the log machinery.  This
currently only reduces code duplication, but should allow for other
simplifications and options to be used.

Finally, we hook a diff printer into the output chain.  Ideally we
would wire directly into the diff logic, to optionally use features
like word diff.  However, that will require some major reworking of
the diff chain, so we completely replace the output with our own diff
for now.

As this was a GSoC project, and has quite some history by now, many
people have helped.  In no particular order, thanks go to

  Jakub Narebski <jnareb@gmail.com>
  Jens Lehmann <Jens.Lehmann@web.de>
  Jonathan Nieder <jrnieder@gmail.com>
  Junio C Hamano <gitster@pobox.com>
  Ramsay Jones <ramsay@ramsay1.demon.co.uk>
  Will Palmer <wmpalmer@gmail.com>

Apologies to everyone I forgot.

Signed-off-by: Bo Yang <struggleyb.nku@gmail.com>
Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-28 10:29:22 -07:00
Bo Yang 25ed3412f8 Refactor parse_loc
We want to use the same style of -L n,m argument for 'git log -L' as
for git-blame.  Refactor the argument parsing of the range arguments
from builtin/blame.c to the (new) file that will hold the 'git log -L'
logic.

To accommodate different data structures in blame and log -L, the file
contents are abstracted away; parse_range_arg takes a callback that it
uses to get the contents of a line of the (notional) file.

The new test is for a case that made me pause during debugging: the
'blame -L with invalid end' test was the only one that noticed an
outright failure to parse the end *at all*.  So make a more explicit
test for that.

Signed-off-by: Bo Yang <struggleyb.nku@gmail.com>
Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-28 10:28:41 -07:00
Matthias Krüger 3322ad4284 git help config: s/insn/instruction/
"insn" appears to be an in-code abbreviation and should not appear
in manual/help pages.

Signed-off-by: Matthias Krüger <matthias.krueger@famsik.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-28 08:53:47 -07:00
Junio C Hamano 8617715cc0 Merge branch 'maint'
* maint:
  More fixes for 1.8.2.1
  merge-tree: fix typo in merge-tree.c::unresolved
  git-commit doc: describe use of multiple `-m` options
  git-pull doc: fix grammo ("conflicts" is plural)
2013-03-27 10:58:07 -07:00
Junio C Hamano 9a82efd0d2 More fixes for 1.8.2.1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-27 10:57:57 -07:00
Junio C Hamano d011ab4312 Merge branch 'maint-1.8.1' into maint
* maint-1.8.1:
  merge-tree: fix typo in merge-tree.c::unresolved
  git-commit doc: describe use of multiple `-m` options
  git-pull doc: fix grammo ("conflicts" is plural)
2013-03-27 10:51:10 -07:00
Christian Helmuth 6bf6366cc6 git-commit doc: describe use of multiple -m options
The text is copied from Documentation/git-tag.txt.

Signed-off-by: Christian Helmuth <christian.helmuth@genode-labs.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-27 09:32:02 -07:00
Mihai Capotă 38ef8a76e7 git-pull doc: fix grammo ("conflicts" is plural)
Signed-off-by: Mihai Capotă <mihai@mihaic.ro>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-27 09:30:54 -07:00
Junio C Hamano 2bba2f0e65 More topics from the second batch for 1.8.3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-26 13:16:11 -07:00
Junio C Hamano 183f88018a Merge branch 'kb/p4merge'
Adjust the order mergetools feeds the files to the p4merge backend
to match the p4 convention.

* kb/p4merge:
  merge-one-file: force content conflict for "both sides added" case
  git-merge-one-file: send "ERROR:" messages to stderr
  git-merge-one-file: style cleanup
  merge-one-file: remove stale comment
  mergetools/p4merge: create a base if none available
  mergetools/p4merge: swap LOCAL and REMOTE
2013-03-26 13:15:24 -07:00
Junio C Hamano 7f95f2dce0 Merge branch 'maint'
* maint:
  More corrections for 1.8.2.1
  Correct the docs about GIT_SSH.
2013-03-26 13:14:45 -07:00
Junio C Hamano 3bbbf18d71 More corrections for 1.8.2.1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-26 13:14:20 -07:00
Junio C Hamano f4ccd9f1bd Merge branch 'maint-1.8.1' into maint
* maint-1.8.1:
  Correct the docs about GIT_SSH.
2013-03-26 13:14:11 -07:00
Junio C Hamano f4bdb255f6 Merge branch 'jc/maint-push-refspec-default-doc' into maint
* jc/maint-push-refspec-default-doc:
  Documentation/git-push: clarify the description of defaults
2013-03-26 12:40:14 -07:00
Junio C Hamano 273ca55907 Merge branch 'wk/user-manual-literal-format' into maint
* wk/user-manual-literal-format:
  user-manual: Standardize backtick quoting
2013-03-26 12:40:11 -07:00
Junio C Hamano c17866d7b6 Merge branch 'gp/avoid-explicit-mention-of-dot-git-refs' into maint
* gp/avoid-explicit-mention-of-dot-git-refs:
  Fix ".git/refs" stragglers
2013-03-26 12:40:04 -07:00
Dan Bornstein e39c695d87 Correct the docs about GIT_SSH.
In particular, it can get called with four arguments if you happen to
be referring to a repo using the ssh:// scheme with a non-default port
number.

Signed-off-by: Dan Bornstein <danfuzz@milk.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-26 07:53:13 -07:00
Brad King df45cb3ea3 commit-tree: document -S option consistently
Commit ba3c69a9 (commit: teach --gpg-sign option, 2011-10-05) added the
-S option but documented it in the command usage without indicating that
the value is optional and forgot to mention it in the manpage.  Later
commit 098bbdc3 (Add -S, --gpg-sign option to manpage of "git commit",
2012-10-21) documented the option in the porcelain manpage.

Use wording from the porcelain manpage to document the option in the
plumbing manpage.  Also update the commit-tree usage summary to indicate
that the -S value is optional to be consistent with the manpage and with
the implementation.

Signed-off-by: Brad King <brad.king@kitware.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-25 15:01:22 -07:00
Junio C Hamano 7632cd2744 Second wave of topics toward 1.8.3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-25 14:08:00 -07:00
Junio C Hamano 55f6fbef3d Merge branch 'jc/push-follow-tag'
The new "--follow-tags" option tells "git push" to push relevant
annotated tags when pushing branches out.

* jc/push-follow-tag:
  push: --follow-tags
  commit.c: use clear_commit_marks_many() in in_merge_bases_many()
  commit.c: add in_merge_bases_many()
  commit.c: add clear_commit_marks_many()
2013-03-25 14:00:41 -07:00
Junio C Hamano b03b41e24c Merge branch 'jl/submodule-deinit'
There was no Porcelain way to say "I no longer am interested in
this submodule", once you express your interest in a submodule with
"submodule init".  "submodule deinit" is the way to do so.

* jl/submodule-deinit:
  submodule: add 'deinit' command
2013-03-25 14:00:29 -07:00
Junio C Hamano cd04c522bd Merge branch 'maint'
* maint:
  Start preparing for 1.8.2.1
  transport.c: help gcc 4.6.3 users by squelching compiler warning
2013-03-25 13:52:25 -07:00
Junio C Hamano 1252f8b29f Start preparing for 1.8.2.1
... at the same time, preparation for 1.8.1.6 also has started ;-)

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-25 13:51:13 -07:00
Junio C Hamano f7b1ad870c Merge branch 'maint-1.8.1' into maint
* maint-1.8.1:
  bundle: Add colons to list headings in "verify"
  bundle: Fix "verify" output if history is complete
  Documentation: filter-branch env-filter example
  git-filter-branch.txt: clarify ident variables usage
  git-compat-util.h: Provide missing netdb.h definitions
  describe: Document --match pattern format
  Documentation/githooks: Explain pre-rebase parameters
  update-index: list supported idx versions and their features
  diff-options: unconfuse description of --color
  read-cache.c: use INDEX_FORMAT_{LB,UB} in verify_hdr()
  index-format.txt: mention of v4 is missing in some places
2013-03-25 13:46:42 -07:00
Junio C Hamano a12816b7dc Merge branch 'tk/doc-filter-branch' into maint-1.8.1
Add an example use of "--env-filter" in "filter-branch"
documentation.

* tk/doc-filter-branch:
  Documentation: filter-branch env-filter example
  git-filter-branch.txt: clarify ident variables usage
2013-03-25 13:45:53 -07:00