1
0
mirror of https://github.com/git/git.git synced 2024-10-21 05:48:38 +02:00
Commit Graph

565 Commits

Author SHA1 Message Date
Ævar Arnfjörð Bjarmason
5cde59895f i18n: git-clone "Cloning into" message
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-03-09 23:52:52 -08:00
Ævar Arnfjörð Bjarmason
3781fcce05 i18n: git-clone "Cloning into" message
Separate the "Cloning into %s" and "Cloning into bare repository %s"
messages to make them easier to translate. No noticeable change
intended.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-03-09 23:52:52 -08:00
Ævar Arnfjörð Bjarmason
e84d7b74c6 i18n: git-clone basic messages
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-03-09 23:52:52 -08:00
Ævar Arnfjörð Bjarmason
3e5dd7e960 i18n: git-init "Initialized [...] repository" message
These messages could benefit from splitting up.  An earlier version of
this patch began like this:

    const char *reinit_shared   = _("Reinitialized existing shared Git repository in %s\n");
    const char *init_shared     = _("Initialized empty shared Git repository in %s\n");
    const char *reinit_noshared = _("Reinitialized existing Git repository in %s\n");
    const char *init_noshared   = _("Initialized empty Git repository in %s\n");

But in the first round of gettextization I'm aiming to keep code
changes to a minimum for ease of review.  So just add a comment
explaining to translators how the sprintf format gets used so they
can cope for now if the language's grammar allows.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-03-09 23:52:52 -08:00
Ævar Arnfjörð Bjarmason
33e92e47c5 i18n: git-init basic messages
Change the user visible strings in init-db.c to use gettext
localizations. This only converts messages which needed to be changed
from "foo" to _("foo"), and didn't need any TRANSLATORS comments.

I haven't marked the messages in init_db_usage or init_db_options for
translation, since that would require additional changes in
parse-options.c. Those can be done later.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-03-09 23:52:52 -08:00
Jonathan Nieder
098d0e0e8e commit, status: use status_printf{,_ln,_more} helpers
wt-status code is used to provide a reminder of changes included and
not included for the commit message template opened in the operator's
text editor by "git commit".  Therefore each line of its output begins
with the comment character "#":

	# Please enter the commit message for your changes. Lines starting

Use the new status_printf{,_ln,_more} functions to take care of adding
"#" to the beginning of such status lines automatically.  Using these
will have two advantages over the current code:

 - The obvious one is to force separation of the "#" from the
   translatable part of the message when git learns to translate its
   output.

 - Another advantage is that this makes it easier for us to drop "#"
   prefix in "git status" output in later versions of git if we want
   to.

Explained-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-03-08 12:10:03 -08:00
Jonathan Nieder
3c624a30fa commit: refer to commit template as s->fp
Instead of maintaining a local variable for it, use s->fp to keep
track of where the commit message template should be written.

This prepares us to take advantage of the status_printf functions,
which use a struct wt_status instead of a FILE pointer to determine
where to send their output.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-03-08 12:10:02 -08:00
Jonathan Nieder
b3c0494aa9 checkout: add missing const to describe_detached_head
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-02-22 16:51:20 -08:00
Junio C Hamano
43f9f05301 Merge branch 'maint'
* maint:
  pull: do not display fetch usage on --help-all
  git-tag.txt: list all modes in the description
  commit,status: describe -u likewise
  add: describe --patch like checkout, reset
  commit,merge,tag: describe -m likewise
  clone,init: describe --template using the same wording
  commit,status: describe --porcelain just like push
  commit,tag: use same wording for -F
  configure: use AC_LANG_PROGRAM consistently
  string_list_append: always set util pointer to NULL
  correct type of EMPTY_TREE_SHA1_BIN
2011-02-15 11:03:22 -08:00
Michael J Gruber
8547090c92 commit,status: describe -u likewise
They differ by one character only. Being exactly equal should help
translations.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-02-15 10:51:08 -08:00
Michael J Gruber
08918e4a38 add: describe --patch like checkout, reset
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-02-15 10:51:08 -08:00
Michael J Gruber
3f40617566 commit,merge,tag: describe -m likewise
This also removes the superfluous "specify" and rewords the misleading
"if any" which sounds as if omitting "-m" would omit the merge commit
message. (It means "if a merge commit is created at all".)

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-02-15 10:51:08 -08:00
Michael J Gruber
5027fa864d clone,init: describe --template using the same wording
This also corrects a wrong description for clone.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-02-15 10:51:08 -08:00
Michael J Gruber
ba9d7fe11c commit,status: describe --porcelain just like push
Push has the clearer description, so take that one for all.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-02-15 10:51:08 -08:00
Michael J Gruber
726c4e3d42 commit,tag: use same wording for -F
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-02-15 10:51:08 -08:00
Jonathan Nieder
dab0d4108d correct type of EMPTY_TREE_SHA1_BIN
Functions such as hashcmp that expect a binary SHA-1 value take
parameters of type "unsigned char *" to avoid accepting a textual
SHA-1 passed by mistake.  Unfortunately, this means passing the string
literal EMPTY_TREE_SHA1_BIN requires an ugly cast.  Tweak the
definition of EMPTY_TREE_SHA1_BIN to produce a value of more
convenient type.

In the future the definition might change to

	extern const unsigned char empty_tree_sha1_bin[20];
	#define EMPTY_TREE_SHA1_BIN empty_tree_sha1_bin

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-02-14 10:48:06 -08:00
René Scharfe
6390c905dc repo-config: add deprecation warning
repo-config was deprecated in 5c66d0d4 on 2008-01-17.  Warn the
remaining users that it has been replaced by config and is going to
be removed eventually.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-02-13 15:13:41 -08:00
Junio C Hamano
00e6ee7246 Merge branch 'maint'
* maint:
  Git 1.7.4.1
  clone: fixup recurse_submodules option
  svn-fe: warn about experimental status

Conflicts:
	contrib/examples/git-revert.sh
	contrib/svn-fe/svn-fe.txt
2011-02-11 16:01:47 -08:00
Junio C Hamano
b76bf72428 Merge branch 'jc/fsck-fixes' into maint
* jc/fsck-fixes:
  fsck: do not give up too early in fsck_dir()
  fsck: drop unused parameter from traverse_one_object()
2011-02-11 14:26:10 -08:00
Chris Packham
3446a54c9a clone: fixup recurse_submodules option
The recurse_submodules option was added in ccdd3da6 to bring 'git clone'
into line with 'git fetch' and future commands. The correct option should
have been "recurse-submodules".

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-02-11 14:24:34 -08:00
Junio C Hamano
7fb9ec2123 Merge branch 'jc/fsck-fixes'
* jc/fsck-fixes:
  fsck: do not give up too early in fsck_dir()
  fsck: drop unused parameter from traverse_one_object()
2011-02-09 16:41:17 -08:00
Junio C Hamano
06938a37dc Merge branch 'jn/cherry-pick-strategy-option'
* jn/cherry-pick-strategy-option:
  cherry-pick/revert: add support for -X/--strategy-option
2011-02-09 16:41:16 -08:00
Nguyễn Thái Ngọc Duy
a2b7a3b3a9 diff: support --cached on unborn branches
"git diff --cached" (without revision) used to mean "git diff --cached
HEAD" (i.e. the user was too lazy to type HEAD). This "correctly"
failed when there was no commit yet. But was that correctness useful?

This patch changes the definition of what particular command means.
It is a request to show what _would_ be committed without further "git
add". The internal implementation is the same "git diff --cached HEAD"
when HEAD exists, but when there is no commit yet, it compares the index
with an empty tree object to achieve the desired result.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-02-07 15:04:30 -08:00
Junio C Hamano
ea6f0a23ac fsck: do not give up too early in fsck_dir()
When there is a random garbage file whose name happens to be 38-byte
long in a .git/objects/??/ directory, the loop terminated prematurely
without marking all the other files that it hasn't checked in the
readdir() loop.

Treat such a file just like any other garbage file, and do not break out
of the readdir() loop.

While at it, replace repeated sprintf() calls to a single one outside the
loop.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-27 12:58:15 -08:00
Junio C Hamano
a1cdc25172 fsck: drop unused parameter from traverse_one_object()
Also add comments to seemingly unsafe pointer dereferences, that
are all safe.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-27 12:58:10 -08:00
Jonathan Nieder
60a2e3320f remote-ext: do not segfault for blank lines
Instead of stripping space characters past the beginning of the
line and overflowing a buffer, stop at the beginning of the line
(mimicking the corresponding fix in remote-fd).

The argument to isspace does not need to be cast explicitly because
git isspace takes care of that already.

Noticed-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-18 10:18:25 -08:00
Junio C Hamano
d2f15e29a6 Merge branch 'maint'
* maint:
  commit: suggest --amend --reset-author to fix commiter identity
2011-01-12 21:26:51 -08:00
Matthieu Moy
3f14246899 commit: suggest --amend --reset-author to fix commiter identity
Since the message advises to fix the configuration first, the
advantage of using this command is that it is cut-and-paste ready,
while using --author='...' requires the user to type his name and
email again.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-12 12:43:58 -08:00
Jonathan Nieder
67ac1e1d57 cherry-pick/revert: add support for -X/--strategy-option
For example, this would allow cherry-picking or reverting patches from
a piece of history with a different end-of-line style, like so:

	$ git revert -Xrenormalize old-problematic-commit

Currently that is possible with manual use of merge-recursive but the
cherry-pick/revert porcelain does not expose the functionality.

While at it, document the existing support for --strategy.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-28 11:27:56 -08:00
Junio C Hamano
f3bb8b4b84 Merge branch 'nd/setup'
* nd/setup: (47 commits)
  setup_work_tree: adjust relative $GIT_WORK_TREE after moving cwd
  git.txt: correct where --work-tree path is relative to
  Revert "Documentation: always respect core.worktree if set"
  t0001: test git init when run via an alias
  Remove all logic from get_git_work_tree()
  setup: rework setup_explicit_git_dir()
  setup: clean up setup_discovered_git_dir()
  t1020-subdirectory: test alias expansion in a subdirectory
  setup: clean up setup_bare_git_dir()
  setup: limit get_git_work_tree()'s to explicit setup case only
  Use git_config_early() instead of git_config() during repo setup
  Add git_config_early()
  git-rev-parse.txt: clarify --git-dir
  t1510: setup case #31
  t1510: setup case #30
  t1510: setup case #29
  t1510: setup case #28
  t1510: setup case #27
  t1510: setup case #26
  t1510: setup case #25
  ...
2010-12-28 11:26:55 -08:00
Junio C Hamano
3ea3860758 Merge branch 'jk/commit-die-on-bogus-ident'
* jk/commit-die-on-bogus-ident:
  commit: die before asking to edit the log message
  ident: die on bogus date format

Conflicts:
	builtin/commit.c
2010-12-22 14:41:14 -08:00
Junio C Hamano
716958c9a2 Merge branch 'tf/commit-list-prefix'
* tf/commit-list-prefix:
  commit: Add commit_list prefix in two function names.

Conflicts:
	sha1_name.c
2010-12-22 14:40:17 -08:00
Nguyễn Thái Ngọc Duy
835183603b Remove all logic from get_git_work_tree()
This logic is now only used by cmd_init_db(). setup_* functions do not
rely on it any more. Move all the logic to cmd_init_db() and turn
get_git_work_tree() into a simple function.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-22 14:34:24 -08:00
Nguyễn Thái Ngọc Duy
e6aea2dba2 setup: limit get_git_work_tree()'s to explicit setup case only
get_git_work_tree() takes input as core.worktree, core.bare,
GIT_WORK_TREE and decides correct worktree setting.

Unfortunately it does not do its job well. core.worktree and
GIT_WORK_TREE should only be taken into account, if GIT_DIR is set
(which is handled by setup_explicit_git_dir). For other setup cases,
only core.bare matters.

Add a temporary variable setup_explicit to adjust get_git_work_tree()
behavior as such. This variable will be gone once setup_* rework is
done.

Also remove is_bare_repository_cfg check in set_git_work_tree() to
ease the rework. We are going to check for core.bare and core.worktree
early before setting worktree. For example, if core.bare is true, no
need to set worktree.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-22 14:34:24 -08:00
Junio C Hamano
4c28e4ada0 commit: die before asking to edit the log message
When determine_author_info() returns to the calling prepare_to_commit(),
we already know the pieces of information necessary to determine what
author ident will be used in the final message, but deferred making a call
to fmt_ident() before the final commit_tree().  Most importantly, we would
open the editor to ask the user to compose the log message before it.

As one important side effect of fmt_ident() is to error out when the given
information is malformed, this resulted in us spawning the editor first
and then refusing to commit due to error, even though we had enough
information to detect the error before starting the editor, which was
annoying.

Move the fmt_ident() call to the end of determine_author_info() where we
have final determination of author info to rectify this.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-20 17:45:51 -08:00
Thiago Farina
834d9eb6b7 builtin/rm.c: Use ALLOC_GROW instead of alloc_nr and xrealloc.
Signed-off-by: Thiago Farina <tfransosi@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-19 10:44:06 -08:00
Thiago Farina
fcbc0d8e82 builtin/branch.c: Use ALLOC_GROW instead of alloc_nr and xrealloc.
Signed-off-by: Thiago Farina <tfransosi@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-19 10:43:53 -08:00
Junio C Hamano
4bb4d30095 Merge branch 'jl/fetch-submodule-recursive'
* jl/fetch-submodule-recursive:
  fetch_populated_submodules(): document dynamic allocation
  Submodules: Add the "fetchRecurseSubmodules" config option
  Add the 'fetch.recurseSubmodules' config setting
  fetch/pull: Add the --recurse-submodules option

Conflicts:
	builtin/fetch.c
2010-12-16 12:57:15 -08:00
Junio C Hamano
f68b780b25 Merge branch 'aa/status-hilite-branch'
* aa/status-hilite-branch:
  default color.status.branch to "same as header"
  status: show branchname with a configurable color
2010-12-16 12:50:03 -08:00
Junio C Hamano
b932c3c1c1 Merge branch 'ak/describe-exact'
* ak/describe-exact:
  describe: Delay looking up commits until searching for an inexact match
  describe: Store commit_names in a hash table by commit SHA1
  describe: Do not use a flex array in struct commit_name
  describe: Use for_each_rawref
2010-12-16 12:49:59 -08:00
Junio C Hamano
6e67619d0c Merge branch 'jn/parse-options-extra'
* jn/parse-options-extra:
  update-index: migrate to parse-options API
  setup: save prefix (original cwd relative to toplevel) in startup_info
  parse-options: make resuming easier after PARSE_OPT_STOP_AT_NON_OPTION
  parse-options: allow git commands to invent new option types
  parse-options: never suppress arghelp if LITERAL_ARGHELP is set
  parse-options: do not infer PARSE_OPT_NOARG from option type
  parse-options: sanity check PARSE_OPT_NOARG flag
  parse-options: move NODASH sanity checks to parse_options_check
  parse-options: clearer reporting of API misuse
  parse-options: Don't call parse_options_check() so much
2010-12-12 21:49:53 -08:00
Junio C Hamano
33935dca6d Merge branch 'tc/format-patch-p'
* tc/format-patch-p:
  format-patch: page output with --stdout
2010-12-12 21:49:52 -08:00
Junio C Hamano
6758af89e4 Merge branch 'jn/git-cmd-h-bypass-setup'
* jn/git-cmd-h-bypass-setup:
  update-index -h: show usage even with corrupt index
  merge -h: show usage even with corrupt index
  ls-files -h: show usage even with corrupt index
  gc -h: show usage even with broken configuration
  commit/status -h: show usage even with broken configuration
  checkout-index -h: show usage even in an invalid repository
  branch -h: show usage even in an invalid repository

Conflicts:
	builtin/merge.c
2010-12-12 21:49:50 -08:00
Junio C Hamano
aa78384156 Merge branch 'mg/maint-tag-rfc1991' into maint
* mg/maint-tag-rfc1991:
  tag: recognize rfc1991 signatures
  tag: factor out sig detection for tag display
  tag: factor out sig detection for body edits
  verify-tag: factor out signature detection
  t/t7004-tag: test handling of rfc1991 signatures
2010-12-10 16:13:03 -08:00
Junio C Hamano
b361888dd5 thread-utils.h: simplify the inclusion
All files that include this header file use the same four line
incantation:

    #ifndef NO_PTHREADS
    #include <pthread.h>
    #include "thread-utils.h"
    #endif

Move the responsibility for that gymnastics to the header file from the
files that include it.  This approach makes it easier to later declare new
services that are related to threading in thread-utils.h and have them
available to all the threading code.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-10 12:58:06 -08:00
Anders Kaseorg
d1645d02de describe: Delay looking up commits until searching for an inexact match
Now that struct commit.util is not used until after we've checked that
the argument doesn't exactly match a tag, we can wait until then to
look up the commits for each tag.

This avoids a lot of I/O on --exact-match queries in repositories with
many tags.  For example, 'git describe --exact-match HEAD' becomes
about 12 times faster on a cold cache (3.2s instead of 39s) in a
linux-2.6 repository with 2000 packed tags.  That is a huge win for the
interactivity of the __git_ps1 shell prompt helper when on a detached
HEAD.

Signed-off-by: Anders Kaseorg <andersk@ksplice.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-09 11:20:26 -08:00
Anders Kaseorg
3cfa4db322 describe: Store commit_names in a hash table by commit SHA1
describe is currently forced to look up the commit at each tag in
order to store the struct commit_name pointers in struct commit.util.
For --exact-match queries, those lookups are wasteful.  In preparation
for removing them, put the commit_names into a hash table, indexed by
commit SHA1, that can be used to quickly check for exact matches.

Signed-off-by: Anders Kaseorg <andersk@ksplice.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-09 11:20:26 -08:00
Anders Kaseorg
1e1ade1833 describe: Do not use a flex array in struct commit_name
Now add_to_known_names overwrites commit_names in place when multiple
tags point to the same commit.  This will make it easier to store
commit_names in a hash table.

Signed-off-by: Anders Kaseorg <andersk@ksplice.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-09 11:20:25 -08:00
Anders Kaseorg
56a5f3afa7 describe: Use for_each_rawref
Don't waste time checking for dangling refs; they wouldn't affect the
output of 'git describe' anyway.  Although this does not gain much
performance by itself, it does in conjunction with the next commits.

Signed-off-by: Anders Kaseorg <andersk@ksplice.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-09 11:20:25 -08:00
Junio C Hamano
6aa6a92fb6 Merge branch 'jn/cherry-pick-refresh-index' into maint
* jn/cherry-pick-refresh-index:
  cherry-pick/revert: transparently refresh index
2010-12-09 10:36:51 -08:00
Junio C Hamano
a59c87265b Merge branch 'fc/apply-p2-get-header-name' into maint
* fc/apply-p2-get-header-name:
  test: git-apply -p2 rename/chmod only
  Fix git-apply with -p greater than 1
2010-12-09 10:36:36 -08:00
Junio C Hamano
5605685a71 Merge branch 'np/pack-broken-boundary' into maint
* np/pack-broken-boundary:
  make pack-objects a bit more resilient to repo corruption
2010-12-09 10:36:23 -08:00
Junio C Hamano
ded4dfd519 Merge branch 'ak/apply-non-git-epoch' into maint
* ak/apply-non-git-epoch:
  apply: handle patches with funny filename and colon in timezone
  apply: Recognize epoch timestamps with : in the timezone
2010-12-09 10:36:16 -08:00
Junio C Hamano
f80b6de4ec Merge branch 'nd/maint-fix-add-typo-detection' (early part)
* 'nd/maint-fix-add-typo-detection' (early part):
  add: do not rely on dtype being NULL behavior
2010-12-08 11:25:52 -08:00
Junio C Hamano
3d90c79650 Merge branch 'il/remote-fd-ext'
* il/remote-fd-ext:
  remote-fd/ext: finishing touches after code review
  git-remote-ext
  git-remote-fd
  Add bidirectional_transfer_loop()

Conflicts:
	compat/mingw.h
2010-12-08 11:24:14 -08:00
Junio C Hamano
a5066a0b07 Merge branch 'mg/maint-tag-rfc1991'
* mg/maint-tag-rfc1991:
  tag: recognize rfc1991 signatures
  tag: factor out sig detection for tag display
  tag: factor out sig detection for body edits
  verify-tag: factor out signature detection
  t/t7004-tag: test handling of rfc1991 signatures
2010-12-08 11:24:13 -08:00
Junio C Hamano
657072f3ac Merge branch 'jh/notes-merge'
* jh/notes-merge: (23 commits)
  Provide 'git merge --abort' as a synonym to 'git reset --merge'
  cmd_merge(): Parse options before checking MERGE_HEAD
  Provide 'git notes get-ref' to easily retrieve current notes ref
  git notes merge: Add testcases for merging notes trees at different fanouts
  git notes merge: Add another auto-resolving strategy: "cat_sort_uniq"
  git notes merge: --commit should fail if underlying notes ref has moved
  git notes merge: List conflicting notes in notes merge commit message
  git notes merge: Manual conflict resolution, part 2/2
  git notes merge: Manual conflict resolution, part 1/2
  Documentation: Preliminary docs on 'git notes merge'
  git notes merge: Add automatic conflict resolvers (ours, theirs, union)
  git notes merge: Handle real, non-conflicting notes merges
  builtin/notes.c: Refactor creation of notes commits.
  git notes merge: Initial implementation handling trivial merges only
  builtin/notes.c: Split notes ref DWIMmery into a separate function
  notes.c: Use two newlines (instead of one) when concatenating notes
  (trivial) t3303: Indent with tabs instead of spaces for consistency
  notes.h/c: Propagate combine_notes_fn return value to add_note() and beyond
  notes.h/c: Allow combine_notes functions to remove notes
  notes.c: Reorder functions in preparation for next commit
  ...

Conflicts:
	builtin.h
2010-12-08 11:24:12 -08:00
Jonathan Nieder
309be813c9 update-index: migrate to parse-options API
--refresh and --really-refresh accept flags (like -q) and modify
an error indicator.  It might make sense to make the error
indicator global, but just pass the flags and a pointer to the error
indicator in a struct instead.

--cacheinfo wants 3 arguments.  Use the OPTION_LOWLEVEL_CALLBACK
extension to grab them and PARSE_OPT_NOARG to disallow the "sticked"
--cacheinfo=foo form.  (The resulting message

	$ git update-index --cacheinfo=foo
	error: option `cacheinfo' takes no value

is unfortunately incorrect.)

--assume-unchanged and --no-assume-unchanged probably should use the
OPT_UYN feature; but use a callback for now so the existing MARK_FLAG
and UNMARK_FLAG values can be used.

--stdin and --index-info are still constrained to be the last argument
(implemented using the OPTION_LOWLEVEL_CALLBACK extension).

--unresolve and --again consume all arguments that come after them
(also using OPTION_LOWLEVEL_CALLBACK).

The order of options matters.  Each path on the command line is
affected only by the options that come before it.  A custom
argument-parsing loop with parse_options_step() brings that about.

In exchange for all the fuss, we get the usual perks: support for
un-sticked options, better usage error messages, more useful -h
output, and argument parsing code that should be easier to tweak
in the future.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-07 14:19:32 -08:00
Stephen Boyd
9ca1169fd9 parse-options: Don't call parse_options_check() so much
parse_options_check() is being called for each invocation of
parse_options_step which can be quite a bit for some commands. The
commit introducing this function cb9d398 (parse-options: add
parse_options_check to validate option specs., 2009-06-09) had the
correct motivation and explicitly states that parse_options_check()
should be called from parse_options_start(). However, the implementation
differs from the motivation. Fix it.

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-06 16:51:36 -08:00
Junio C Hamano
39f04dbaac Merge branch 'jn/thinner-wrapper'
* jn/thinner-wrapper:
  Remove pack file handling dependency from wrapper.o
  pack-objects: mark file-local variable static
  wrapper: give zlib wrappers their own translation unit
  strbuf: move strbuf_branchname to sha1_name.c
  path helpers: move git_mkstemp* to wrapper.c
  wrapper: move odb_* to environment.c
  wrapper: move xmmap() to sha1_file.c
2010-12-03 16:13:06 -08:00
Junio C Hamano
9bec60d3a5 Merge branch 'pn/commit-autosquash'
* pn/commit-autosquash:
  add tests of commit --squash
  commit: --squash option for use with rebase --autosquash
  add tests of commit --fixup
  commit: --fixup option for use with rebase --autosquash
  pretty.c: teach format_commit_message() to reencode the output
  commit: helper methods to reduce redundant blocks of code

Conflicts:
	Documentation/git-commit.txt
	t/t3415-rebase-autosquash.sh
2010-12-03 16:13:06 -08:00
Junio C Hamano
45a7b55d6f Merge branch 'sn/diff-doc'
* sn/diff-doc:
  docs: clarify git diff modes of operation
  diff,difftool: Don't use the {0,2} notation in usage strings
  CodingGuidelines: Add a section on writing documentation
2010-12-03 16:10:36 -08:00
Junio C Hamano
47f16e8b11 Merge branch 'cb/maint-orphan-merge-noclobber' into maint
* cb/maint-orphan-merge-noclobber:
  do not overwrite untracked during merge from unborn branch
2010-12-02 11:27:13 -08:00
Junio C Hamano
a49e9af493 Merge branch 'tr/maint-merge-file-subdir' into maint
* tr/maint-merge-file-subdir:
  merge-file: correctly find files when called in subdir
  prefix_filename(): safely handle the case where pfx_len=0
2010-12-02 11:26:40 -08:00
Junio C Hamano
9f6774ed86 Merge branch 'ks/no-textconv-symlink' into maint
* ks/no-textconv-symlink:
  blame,cat-file --textconv: Don't assume mode is ``S_IFREF | 0664''
  blame,cat-file: Demonstrate --textconv is wrongly running converter on symlinks
  blame,cat-file: Prepare --textconv tests for correctly-failing conversion program
2010-12-02 11:26:24 -08:00
Junio C Hamano
94fdb6f6eb Merge branch 'maint'
* maint:
  add: introduce add.ignoreerrors synonym for add.ignore-errors
  bash: Match lightweight tags in prompt
  git-commit.txt: (synopsis): move -i and -o before "--"
2010-12-01 16:41:13 -08:00
Junio C Hamano
5501bf854c Merge branch 'maint-1.7.2' into maint
* maint-1.7.2:
  add: introduce add.ignoreerrors synonym for add.ignore-errors
  bash: Match lightweight tags in prompt
  git-commit.txt: (synopsis): move -i and -o before "--"
2010-12-01 16:40:26 -08:00
Junio C Hamano
2de132f884 Merge branch 'maint-1.7.1' into maint-1.7.2
* maint-1.7.1:
  add: introduce add.ignoreerrors synonym for add.ignore-errors
2010-12-01 16:40:20 -08:00
Junio C Hamano
e760924cbe Merge branch 'maint-1.7.0' into maint-1.7.1
* maint-1.7.0:
  add: introduce add.ignoreerrors synonym for add.ignore-errors
2010-12-01 16:37:34 -08:00
Junio C Hamano
106e3afa6f Merge branch 'jl/clone-recurse-sm-synonym'
* jl/clone-recurse-sm-synonym:
  clone: Add the --recurse-submodules option as alias for --recursive
2010-11-29 17:52:34 -08:00
Junio C Hamano
5eee142c89 Merge branch 'jn/cherry-pick-refresh-index'
* jn/cherry-pick-refresh-index:
  cherry-pick/revert: transparently refresh index
2010-11-29 17:52:34 -08:00
Junio C Hamano
09efc4510d Merge branch 'np/pack-broken-boundary'
* np/pack-broken-boundary:
  make pack-objects a bit more resilient to repo corruption
2010-11-29 17:52:33 -08:00
Junio C Hamano
f3f973a017 Merge branch 'fc/apply-p2-get-header-name'
* fc/apply-p2-get-header-name:
  test: git-apply -p2 rename/chmod only
  Fix git-apply with -p greater than 1
2010-11-29 17:52:33 -08:00
Junio C Hamano
4ef927a995 Merge branch 'kb/blame-author-email'
* kb/blame-author-email:
  blame: Add option to show author email instead of name

Conflicts:
	t/annotate-tests.sh
2010-11-29 17:52:32 -08:00
Junio C Hamano
f565f6e065 Merge branch 'ak/apply-non-git-epoch'
* ak/apply-non-git-epoch:
  apply: handle patches with funny filename and colon in timezone
  apply: Recognize epoch timestamps with : in the timezone
2010-11-29 17:52:31 -08:00
Aleksi Aalto
1d282327d7 status: show branchname with a configurable color
You can tell "git status" to paint the name of the current branch in its
output (the line that says "On branch ...") by setting the configuration
variable color.status.branch; it is by default turned off.

Signed-off-by: Aleksi Aalto <aga@iki.fi>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-11-29 16:31:34 -08:00
Thiago Farina
47e44ed1dc commit: Add commit_list prefix in two function names.
Add commit_list prefix to insert_by_date function and to sort_by_date,
so it's clear that these functions refer to commit_list structure.

Signed-off-by: Thiago Farina <tfransosi@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-11-29 14:01:52 -08:00
Junio C Hamano
7d43de925b Merge branch 'cb/maint-orphan-merge-noclobber'
* cb/maint-orphan-merge-noclobber:
  do not overwrite untracked during merge from unborn branch
2010-11-24 15:55:36 -08:00
Junio C Hamano
20f84c8f56 Merge branch 'rs/opt-help-text'
* rs/opt-help-text:
  verify-tag: document --verbose
  branch: improve --verbose description
  archive: improve --verbose description
  Describe various forms of "be quiet" using OPT__QUIET
  add OPT__FORCE
  add description parameter to OPT__QUIET
  add description parameter to OPT__DRY_RUN
  add description parameter to OPT__VERBOSE
2010-11-24 15:55:19 -08:00
Junio C Hamano
786f174dab Merge branch 'mm/phrase-remote-tracking'
* mm/phrase-remote-tracking:
  git-branch.txt: mention --set-upstream as a way to change upstream configuration
  user-manual: remote-tracking can be checked out, with detached HEAD
  user-manual.txt: explain better the remote(-tracking) branch terms
  Change incorrect "remote branch" to "remote tracking branch" in C code
  Change incorrect uses of "remote branch" meaning "remote-tracking"
  Change "tracking branch" to "remote-tracking branch"
  everyday.txt: change "tracking branch" to "remote-tracking branch"
  Change remote tracking to remote-tracking in non-trivial places
  Replace "remote tracking" with "remote-tracking"
  Better "Changed but not updated" message in git-status
2010-11-24 15:55:05 -08:00
Junio C Hamano
9bdef78fb0 Merge branch 'jk/maint-apply-no-binary' into maint
* jk/maint-apply-no-binary:
  apply: don't segfault on binary files with missing data
2010-11-24 12:47:04 -08:00
Junio C Hamano
d2a99221a7 Merge branch 'jn/send-pack-error' into maint
* jn/send-pack-error:
  send-pack: avoid redundant "pack-objects died with strange error"
2010-11-24 12:46:46 -08:00
Junio C Hamano
e7b9b80e2f Merge branch 'jk/maint-rev-list-nul' into maint
* jk/maint-rev-list-nul:
  rev-list: handle %x00 NUL in user format
2010-11-24 12:46:32 -08:00
Junio C Hamano
2f9d2e22cb Merge branch 'bc/fix-cherry-pick-root' into maint
* bc/fix-cherry-pick-root:
  builtin/revert.c: don't dereference a NULL pointer
2010-11-24 12:44:46 -08:00
Tay Ray Chuan
38a94bb6ba format-patch: page output with --stdout
Pass output through the pager if format-patch is run with --stdout. This
saves the user the trouble of running git with '-p' or piping through a
pager.

setup_pager() already checks if stdout is a tty, so we don't have to
worry about behaviour if the user redirects/pipes stdout. Paging can
also be disabled with the config

  [pager]
      format-patch = false

Add tests to check for these behaviour.

Helped-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-11-23 12:17:03 -08:00
Ilari Liusvaara
7851b1e60f remote-fd/ext: finishing touches after code review
When compiling with pthread support, transport-helper.c needs to include
necessary header files.  Also fix a few error messages in remote-ext and
remote-fd programs, and a potential buffer underrun in remote-fd.

In the documentation, clarify how %G and %V are used; the old description
looked as if they take repository/vhost parameters, which was wrong.

Also fix AsciiDoc markup for the page title of remote-fd/remote-ext manpages,
and tweak the way how section headers are shown.

Signed-off-by: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-11-19 11:04:20 -08:00
Junio C Hamano
ee438efbc1 Merge branch 'jk/maint-apply-no-binary'
* jk/maint-apply-no-binary:
  apply: don't segfault on binary files with missing data
2010-11-17 15:01:18 -08:00
Junio C Hamano
0510480510 Merge branch 'jk/push-progress'
* jk/push-progress:
  push: pass --progress down to git-pack-objects
  t5523-push-upstream: test progress messages
  t5523-push-upstream: add function to ensure fresh upstream repo
  test_terminal: ensure redirections work reliably
  test_terminal: catch use without TTY prerequisite
  test-lib: allow test code to check the list of declared prerequisites
  tests: test terminal output to both stdout and stderr
  tests: factor out terminal handling from t7006
2010-11-17 15:01:00 -08:00
Junio C Hamano
ba0254cb32 Merge branch 'tr/maint-merge-file-subdir'
* tr/maint-merge-file-subdir:
  merge-file: correctly find files when called in subdir
  prefix_filename(): safely handle the case where pfx_len=0
2010-11-17 15:00:56 -08:00
Junio C Hamano
e2110c8d88 Merge branch 'jn/send-pack-error'
* jn/send-pack-error:
  send-pack: avoid redundant "pack-objects died with strange error"
2010-11-17 15:00:51 -08:00
Junio C Hamano
07e0a8314d Merge branch 'jk/maint-rev-list-nul'
* jk/maint-rev-list-nul:
  rev-list: handle %x00 NUL in user format
2010-11-17 14:59:33 -08:00
Junio C Hamano
dd9d290bc9 Merge branch 'ks/no-textconv-symlink'
* ks/no-textconv-symlink:
  blame,cat-file --textconv: Don't assume mode is ``S_IFREF | 0664''
  blame,cat-file: Demonstrate --textconv is wrongly running converter on symlinks
  blame,cat-file: Prepare --textconv tests for correctly-failing conversion program
2010-11-17 14:59:27 -08:00
Junio C Hamano
5a7a0fae8f Merge branch 'maint'
* maint:
  clean: remove redundant variable baselen
  Documentation/git-pull: clarify configuration
  Document that rev-list --graph triggers parent rewriting.
  clean: avoid quoting twice
  document sigchain api
  Keep together options controlling the behaviour of diffcore-rename.
  t3402: test "rebase -s<strategy> -X<opt>"
2010-11-17 13:57:58 -08:00
Nguyễn Thái Ngọc Duy
1c7d402b3e clean: remove redundant variable baselen
baselen used to be the result of common_prefix() when it was made
builtin. Since 1d8842d (Add 'fill_directory()' helper function for
directory traversal - 2009-05-14), its value will always be
zero. Remove it because it's no longer variable.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-11-17 13:26:38 -08:00
Johan Herland
35d2fffdb8 Provide 'git merge --abort' as a synonym to 'git reset --merge'
Teach 'git merge' the --abort option, which verifies the existence of
MERGE_HEAD and then invokes 'git reset --merge' to abort the current
in-progress merge and attempt to reconstruct the pre-merge state.

The reason for adding this option is to provide a user interface for
aborting an in-progress merge that is consistent with the interface
for aborting a rebase ('git rebase --abort'), aborting the application
of a patch series ('git am --abort'), and aborting an in-progress notes
merge ('git notes merge --abort').

The patch includes documentation and testcases that explain and verify
the various scenarios in which 'git merge --abort' can run. The
testcases also document the cases in which 'git merge --abort' is
unable to correctly restore the pre-merge state (look for the '###'
comments towards the bottom of t/t7609-merge-abort.sh).

This patch has been improved by the following contributions:
- Jonathan Nieder: Move test documentation into test_description

Thanks-to: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-11-17 13:23:55 -08:00
Johan Herland
2a22c1b35d cmd_merge(): Parse options before checking MERGE_HEAD
Reorder the initial part of builtin/merge.c:cmd_merge() so that command-line
options are parsed _before_ we load the index and check for MERGE_HEAD
(and exits if it exists). This does not change the behaviour of 'git merge',
but is needed in preparation for the implementation of 'git merge --abort'
(which requires MERGE_HEAD to be present).

This patch has been improved by the following contributions:
- Junio C Hamano: fixup minor style issues

Thanks-to: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-11-17 13:23:55 -08:00
Johan Herland
618cd75707 Provide 'git notes get-ref' to easily retrieve current notes ref
Script may use 'git notes get-ref' to easily retrieve the current notes ref.

Suggested-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-11-17 13:23:55 -08:00
Johan Herland
a6a09095a0 git notes merge: Add another auto-resolving strategy: "cat_sort_uniq"
This new strategy is similar to "concatenate", but in addition to
concatenating the two note candidates, this strategy sorts the resulting
lines, and removes duplicate lines from the result. This is equivalent to
applying the "cat | sort | uniq" shell pipeline to the two note candidates.

This strategy is useful if the notes follow a line-based format where one
wants to avoid duplicate lines in the merge result.

Note that if either of the note candidates contain duplicate lines _prior_
to the merge, these will also be removed by this merge strategy.

The patch also contains tests and documentation for the new strategy.

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-11-17 13:22:53 -08:00
Johan Herland
6cfd6a9dea git notes merge: --commit should fail if underlying notes ref has moved
When manually resolving a notes merge, if the merging ref has moved since
the merge started, we should fail to complete the merge, and alert the user
to what's going on.

This situation may arise if you start a 'git notes merge' which results in
conflicts, and you then update the current notes ref (using for example
'git notes add/copy/amend/edit/remove/prune', 'git update-ref', etc.),
before you get around to resolving the notes conflicts and calling
'git notes merge --commit'.

We detect this situation by comparing the first parent of the partial merge
commit (which was created when the merge started) to the current value of the
merging notes ref (pointed to by the .git/NOTES_MERGE_REF symref).

If we don't fail in this situation, the notes merge commit would overwrite
the updated notes ref, thus losing the changes that happened in the meantime.

The patch includes a testcase verifying that we fail correctly in this
situation.

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-11-17 13:22:49 -08:00
Johan Herland
443259cf92 git notes merge: List conflicting notes in notes merge commit message
This brings notes merge in line with regular merge's behaviour.

This patch has been improved by the following contributions:
- Ævar Arnfjörð Bjarmason: Don't use C99 comments.

Thanks-to: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-11-17 13:22:49 -08:00