Commit graph

24499 commits

Author SHA1 Message Date
Michael J Gruber 3b0d24053b Make <identifier> lowercase in Documentation
Leaving uppercase abbreviations (e.g. URL) and an identifier named after
an upercase env variable (CVSROOT) in place, this adjusts the few
remaining cases and fixes an unidentified identifier along the way.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-02-17 11:49:54 -08:00
Junio C Hamano 5673d695fc Merge branch 'maint'
* maint:
  parse_tag_buffer(): do not prefixcmp() out of range
2011-02-16 14:33:22 -08:00
Junio C Hamano 759e84f07f Merge branch 'maint-1.7.3' into maint
* maint-1.7.3:
2011-02-16 14:33:11 -08:00
Junio C Hamano da656f17d3 Merge branch 'maint-1.7.2' into maint-1.7.3
* maint-1.7.2:
  fast-import: introduce "feature notes" command
  fast-import: clarify documentation of "feature" command
2011-02-16 14:32:59 -08:00
Junio C Hamano 6a7f71d376 Merge branch 'maint-1.7.1' into maint-1.7.2
* maint-1.7.1:
  fast-import: introduce "feature notes" command
  fast-import: clarify documentation of "feature" command
2011-02-16 14:32:54 -08:00
Junio C Hamano 206af7c96b Merge branch 'maint-1.7.0' into maint-1.7.1
* maint-1.7.0:
  fast-import: introduce "feature notes" command
  fast-import: clarify documentation of "feature" command
2011-02-16 14:32:47 -08:00
Martin von Zweigbergk 2f59c94704 mergetool: don't skip modify/remove conflicts
Since bb0a484 (mergetool: Skip autoresolved paths, 2010-08-17),
mergetool uses different ways of figuring out the list of files with
merge conflicts depending on whether rerere is active. If rerere is
active, mergetool will use 'git rerere status' to list the files with
remaining conflicts. However, the output from that command does not
list conflicts of types that rerere does not handle, such as
modify/remove conflicts.

Another problem with solely relying on the output from 'git rerere
status' is that, for new conflicts that are not yet known to rerere,
the output from the command will list the files even after adding them
to the index. This means that if the conflicts in some files have been
resolved and 'git mergetool' is run again, it will ask the user
something like the following for each of those files.

 file1: file does not need merging
 Continue merging other unresolved paths (y/n) ?

Solve both of these problems by replacing the call to 'git rerere
status' with a call to the new 'git rerere remaining' that was
introduced in the previous commit.

Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-02-16 13:21:09 -08:00
Martin von Zweigbergk ac49f5ca84 rerere "remaining"
After "rerere" resolves conflicts by reusing old resolution, there would
be three kinds of paths with conflict in the index:

 * paths that have been resolved in the working tree by rerere;
 * paths that need further work whose resolution could be recorded;
 * paths that need resolving that rerere won't help.

When the user wants a list of paths that need hand-resolving, output from
"rerere status" does not help, as it shows only the second category, but
the paths in the third category still needs work (rerere only makes sense
for regular files that have both our side and their side, and does not
help other kinds of conflicts, e.g. "we modified, they deleted").

The new subcommand "rerere remaining" can be used to show both. As
opposed to "rerere status", this subcommand also skips printing paths
that have been added to the index, since these paths are already
resolved and are no longer "remaining".

Initial patch provided by Junio. Refactored and modified to skip
resolved paths by Martin. Commit message mostly by Junio.

Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-02-16 13:20:50 -08:00
Johan Herland 53c403116a push.default: Rename 'tracking' to 'upstream'
Users are sometimes confused with two different types of "tracking" behavior
in Git: "remote-tracking" branches (e.g. refs/remotes/*/*) versus the
merge/rebase relationship between a local branch and its @{upstream}
(controlled by branch.foo.remote and branch.foo.merge config settings).

When the push.default is set to 'tracking', it specifies that a branch should
be pushed to its @{upstream} branch. In other words, setting push.default to
'tracking' applies only to the latter of the above two types of "tracking"
behavior.

In order to make this more understandable to the user, we rename the
push.default == 'tracking' option to push.default == 'upstream'.

push.default == 'tracking' is left as a deprecated synonym for 'upstream'.

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-02-16 10:21:52 -08:00
Nguyễn Thái Ngọc Duy 855942528e parse_tag_buffer(): do not prefixcmp() out of range
There is a check (size < 64) at the beginning of the function, but
that only covers object+type lines.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-02-16 10:05:14 -08:00
Nguyễn Thái Ngọc Duy ef5dd8a922 git.c: reorder builtin command list
The majority of commands is in alphabet order except some. Reorder
them so it's easier to locate a command by eye and able to binary
search.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-02-15 13:46:18 -08:00
Jay Soffian 65969d43d1 merge: honor prepare-commit-msg hook
When a merge is stopped due to conflicts or --no-commit, the
subsequent commit calls the prepare-commit-msg hook. However,
it is not called after a clean merge. Fix this inconsistency
by invoking the hook after clean merges as well.

Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-02-15 13:35:35 -08:00
Michael J Gruber 41dbcd4540 Make <identifier> lowercase as per CodingGuidelines
*.c part for matches with '<[A-Z]+>' (and affected test).

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-02-15 11:53:11 -08:00
Michael J Gruber 23c6a803d3 Make <identifier> lowercase as per CodingGuidelines
*.c part for matches with '"[A-Z]+"'.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-02-15 11:53:10 -08:00
Michael J Gruber 1d5006ab31 Make <identifier> lowercase as per CodingGuidelines
parse-options part

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-02-15 11:53:09 -08:00
Junio C Hamano b1afe49dfb CodingGuidelines: downcase placeholders in usage messages
We accumulated some inconsistencies without an explicit guidance to spell
this out over time.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-02-15 11:53:00 -08:00
Shawn O. Pearce 206b099d26 smart-http: Don't use Expect: 100-Continue
Some HTTP/1.1 servers or proxies don't correctly implement the
100-Continue feature of HTTP/1.1.  Its a difficult feature to
implement right, and isn't commonly used by browsers, so many
developers may not even be aware that their server (or proxy)
doesn't honor it.

Within the smart HTTP protocol for Git we only use this newer
"Expect: 100-Continue" feature to probe for missing authentication
before uploading a large payload like a pack file during push.
If authentication is necessary, we expect the server to send the
401 Not Authorized response before the bulk data transfer starts,
thus saving the client bandwidth during the retry.

A different method to probe for working authentication is to send an
empty command list (that is just "0000") to $URL/git-receive-pack.
or $URL/git-upload-pack.  All versions of both receive-pack and
upload-pack since the introduction of smart HTTP in Git 1.6.6
cleanly accept just a flush-pkt under --stateless-rpc mode, and
exit with success.

If HTTP level authentication is successful, the backend will return
an empty response, but with HTTP status code 200.  This enables
the client to continue with the transfer.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-02-15 11:42: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 24231e063f pull: do not display fetch usage on --help-all
Currently, "git pull --help-all" displays the fetch usage info.

Make it equivalent to "git pull -h" instead since "--help-all" is
documented in gitcli(7).

Do not try to sanitize the pull option parser (aka last hair puller).

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-02-15 10:53:24 -08:00
Michael J Gruber cfb5e6b2da git-tag.txt: list all modes in the description
Currently, the description sounds as if it applied always, but most of
its content is true in "create tag mode" only.

Make this clearer by listing all modes upfront.

Also, sneak in some linguistic improvements and make it clearer that
lightweight tags are "created" because "written" may be misread as
"are output".

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 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
Junio C Hamano 4e363b11bd Revert "unpack_trees(): skip trees that are the same in all input"
This reverts commit 83c90314aa, which
seems to have broken merge to report conflicts when there should be
none.
2011-02-15 10:47:04 -08:00
Junio C Hamano 6c74ce8c7d Rename t2019 with typo "amiguous" that meant "ambiguous"
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-02-15 10:43:45 -08:00
Masatake Osanai 48d9e6ae4b perl: command_bidi_pipe() method should set-up git environmens
When command_input_pipe and command_output_pipe are used as a
method of a Git::repository instance, they eventually call into
_cmd_exec method that sets up the execution environment such as
GIT_DIR, GIT_WORK_TREE environment variables and the current
working directory in the child process that interacts with the
repository.

command_bidi_pipe however didn't expect to be called as such, and
lacked all these set-up.  Because of this, a program that did this
did not work as expected:

    my $repo = Git->repository(Directory => '/some/where/else');
    my ($pid, $in, $out, $ctx) =
    $repo->command_bidi_pipe(qw(hash-object -w --stdin-paths));

This patch refactors the _cmd_exec into _setup_git_cmd_env that
sets up the execution environment, and makes _cmd_exec and
command_bidi_pipe to use it.

Note that unlike _cmd_exec that execv's a git command as an
external process, command_bidi_pipe is called from the main line
of control, and the execution environment needs to be restored
after open2() does its magic.

Signed-off-by: Masatake Osanai <unpush@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-02-14 15:28:13 -08:00
Ralf Wildenhues 1e58dba142 configure: use AC_LANG_PROGRAM consistently
Avoid warnings from Autoconf 2.68 about missing use of AC_LANG_PROGRAM
and friends.

Quoting autoconf-2.68/NEWS:

  ** The macros AC_PREPROC_IFELSE, AC_COMPILE_IFELSE, AC_LINK_IFELSE, and
     AC_RUN_IFELSE now warn if the first argument failed to use
     AC_LANG_SOURCE or AC_LANG_PROGRAM to generate the conftest file
     contents.  A new macro AC_LANG_DEFINES_PROVIDED exists if you have
     a compelling reason why you cannot use AC_LANG_SOURCE but must
     avoid the warning.

The underlying reason for that change is that AC_LANG_{SOURCE,PROGRAM}
take care to supply the previously computed set of #defines (and
include standard headers if so desired) for preprocessed languages
like C and C++.

In some cases, AC_LANG_PROGRAM is already used but not sufficiently
m4-quoted, so we just need to add another set of [quotes] to prevent
the autoconf warning from being triggered bogusly.  Quoting all
arguments (except when calling special macros that need to be expanded
before recursion) is better style, anyway.  These and more rules are
described in detail in 'info Autoconf "Programming in M4"'.

No change in the resulting config.mak.autogen after running
./configure intended.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-02-14 10:55:15 -08:00
Jeff King 62b8102c60 string_list_append: always set util pointer to NULL
It is not immediately obvious that the util field may
contain random bytes after appending an item. Especially
since the string_list_insert* functions _do_ explicitly zero
the util pointer.

This does not appear to be a bug in any current git code, as
all callers either fill in the util field immediately or
never use it. However, it is worth it to be less surprising
to new users of the string-list API who may expect it to be
intialized to NULL.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-02-14 10:55:03 -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
Ian Wienand 3952710bfa Obey p4 views when using client spec
When using the p4 client spec, this attempts to obey the client's
output preferences.

For example, a view like

//depot/foo/branch/... //client/branch/foo/...
//depot/bar/branch/... //client/branch/bar/...

will result in a directory layout in the git tree of

branch/
branch/foo
branch/bar

p4 can do various other reordering that this change doesn't support,
but we should detect it and at least fail nicely.

Signed-off-by: Ian Wienand <ianw@vmware.com>
Acked-by: Pete Wyckoff <pw@padd.com>
Acked-by: Tor Arvid Lund <torarvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-02-14 10:34:49 -08:00
Ævar Arnfjörð Bjarmason cbef0db6cc gitignore: add test-mktemp to ignore list
Change the .gitignore to ignore test-mktemp which is built from
test-mktemp.c. Arnout Engelen added this in 6cf6bb3 (Improve error
messages when temporary file creation fails, 2010-12-18) but forgot
to add a corresponding entry to .gitignore.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-02-13 15:15:08 -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 9971d6d52c Git 1.7.4.1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-02-11 14:39:55 -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
Jonathan Nieder 75323459b8 svn-fe: warn about experimental status
svn-fe is young and some coming cleanups might involve backward
incompatible UI changes.  Add some words of warning to the manual so
early adopters that are not following the project closely don't get
burned.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-02-11 10:13:14 -08:00
Junio C Hamano b308bf1863 Merge branch 'maint'
* maint:
  compat: helper for detecting unsigned overflow
2011-02-10 14:45:55 -08:00
Jonathan Nieder 1368f65002 compat: helper for detecting unsigned overflow
The idiom (a + b < a) works fine for detecting that an unsigned
integer has overflowed, but a more explicit

	unsigned_add_overflows(a, b)

might be easier to read.

Define such a macro, expanding roughly to ((a) < UINT_MAX - (b)).
Because the expansion uses each argument only once outside of sizeof()
expressions, it is safe to use with arguments that have side effects.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-02-10 13:47:56 -08:00
Junio C Hamano 1a9fe45326 Merge branch 'tr/merge-unborn-clobber'
* tr/merge-unborn-clobber:
  Exhibit merge bug that clobbers index&WT

Conflicts:
	t/t7607-merge-overwrite.sh
2011-02-09 16:41:17 -08:00
Junio C Hamano 7551391478 Merge branch 'jc/unpack-trees'
* jc/unpack-trees:
  unpack_trees(): skip trees that are the same in all input
  unpack-trees.c: cosmetic fix

Conflicts:
	unpack-trees.c
2011-02-09 16:41:17 -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 1bb4abeff7 Merge branch 'tr/diff-words-test'
* tr/diff-words-test:
  t4034 (diff --word-diff): add a minimum Perl drier test vector
  t4034 (diff --word-diff): style suggestions
  userdiff: simplify word-diff safeguard
  t4034: bulk verify builtin word regex sanity
2011-02-09 16:41:17 -08:00
Junio C Hamano fc180d98a2 Merge branch 'rr/fi-import-marks-if-exists'
* rr/fi-import-marks-if-exists:
  fast-import: Introduce --import-marks-if-exists
2011-02-09 16:41:16 -08:00
Junio C Hamano 5bb20ece6b Merge branch 'jn/unpack-lstat-failure-report'
* jn/unpack-lstat-failure-report:
  unpack-trees: handle lstat failure for existing file
  unpack-trees: handle lstat failure for existing directory
2011-02-09 16:41:16 -08:00
Junio C Hamano f5bbbf9cad Merge branch 'ef/alias-via-run-command'
* ef/alias-via-run-command:
  alias: use run_command api to execute aliases
2011-02-09 16:41:16 -08:00
Junio C Hamano 05f08e4c9e Merge branch 'cb/setup'
* cb/setup:
  setup: translate symlinks in filename when using absolute paths
2011-02-09 16:41:16 -08:00