1
0
mirror of https://github.com/git/git.git synced 2024-10-19 21:08:12 +02:00
Commit Graph

20842 Commits

Author SHA1 Message Date
Junio C Hamano
96aa7adda3 Merge branch 'maint-1.6.0' into maint-1.6.1
* maint-1.6.0:
  base85: Make the code more obvious instead of explaining the non-obvious
  base85: encode_85() does not use the decode table
  base85 debug code: Fix length byte calculation
  checkout -m: do not try to fall back to --merge from an unborn branch
  branch: die explicitly why when calling "git branch [-a|-r] branchname".
2010-01-10 00:48:47 -08:00
Erik Faye-Lund
15515b7371 daemon: consider only address in kill_some_child()
kill_some_child() compares the entire sockaddr_storage
structure (with the pad-bits zeroed out) when trying to
find out if connections originate from the same host.
However, sockaddr_storage contains the port-number for
the connection (which varies between connections), so
the comparison always fails.

Change the code so we only consider the host-address,
by introducing the addrcmp()-function that inspects
the address family and compare as appropriate.

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-09 23:43:49 -08:00
Brad King
40c813e00c Handle relative paths in submodule .git files
Commit 842abf0 (Teach resolve_gitlink_ref() about the .git file, 2008-02-20)
taught resolve_gitlink_ref() to call read_gitfile_gently() to resolve .git
files.  In this commit teach read_gitfile_gently() to interpret a relative
path in a .git file with respect to the file location.

This change allows update-index to recognize a submodule that uses a relative
path in its .git file.  It previously failed because the relative path was
wrongly interpreted with respect to the superproject directory.

Signed-off-by: Brad King <brad.king@kitware.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-09 23:43:22 -08:00
Brad King
48cc95ed4a Test update-index for a gitlink to a .git file
Check that update-index recognizes a submodule that uses a .git file.
Currently it works when the .git file specifies an absolute path, but
not when it specifies a relative path.

Signed-off-by: Brad King <brad.king@kitware.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-09 23:43:22 -08:00
Christian Couder
3caa82396c help: fix configured help format taking over command line one
Since commit 7c3baa9 (help -a: do not unnecessarily look for a
repository, 2009-09-04), the help format that is passed as a
command line option is not used if an help format has been
configured. This patch fixes that.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-09 23:42:48 -08:00
Thiago Farina
0afcb5f791 string-list: rename the include guard to STRING_LIST_H
Signed-off-by: Thiago Farina <tfransosi@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-09 23:39:11 -08:00
Christian Couder
d7eed8cbef t7111: check that reset options work as described in the tables
Some previous patches added some tables to the "git reset"
documentation. These tables describe the behavior of "git reset"
depending on the option it is passed and the state of the files
in the working tree, the index, HEAD and the target commit.

This patch adds some tests to make sure that the tables describe
the behavior of "git reset".

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-09 23:38:43 -08:00
Tay Ray Chuan
c1ceea1d27 transport-helper.c::push_refs(): emit "no refs" error message
Emit an error message when remote_refs is not set.

This behaviour is consistent with that of builtin-send-pack.c and
http-push.c.

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-09 23:34:11 -08:00
Tay Ray Chuan
08d63a422b transport-helper.c::push_refs(): ignore helper-reported status if ref is not to be pushed
If the status of a ref is REF_STATUS_NONE, the remote helper will not
be told to push the ref (via a 'push' command).

However, the remote helper may still act on these refs.

If the helper does act on the ref, and prints a status for it, ignore
the report (ie. don't overwrite the status of the ref with it, nor the
message in the remote_status member) if the reported status is 'no
match'.

This allows the user to be alerted to more "interesting" ref statuses,
like REF_STATUS_NONFASTFORWARD.

Cc: Jeff King <peff@peff.net>
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-09 23:34:10 -08:00
Tay Ray Chuan
4232826771 transport.c::transport_push(): make ref status affect return value
Use push_had_errors() to check the refs for errors and modify the
return value.

Mark the non-fast-forward push tests to succeed.

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-09 23:34:10 -08:00
Tay Ray Chuan
20e8b465a5 refactor ref status logic for pushing
Move the logic that detects up-to-date and non-fast-forward refs to a
new function in remote.[ch], set_ref_status_for_push().

Make transport_push() invoke set_ref_status_for_push() before invoking
the push_refs() implementation. (As a side-effect, the push_refs()
implementation in transport-helper.c now knows of non-fast-forward
pushes.)

Removed logic for detecting up-to-date refs from the push_refs()
implementation in transport-helper.c, as transport_push() has already
done so for it.

Make cmd_send_pack() invoke set_ref_status_for_push() before invoking
send_pack(), as transport_push() can't do it for send_pack() here.

Mark the test on the return status of non-fast-forward push to fail.
Git now exits with success, as transport.c::transport_push() does not
check for refs with status REF_STATUS_REJECT_NONFASTFORWARD nor does it
indicate rejected pushes with its return value.

Mark the test for ref status to succeed. As mentioned earlier, refs
might be marked as non-fast-forwards, triggering the push status
printing mechanism in transport.c.

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-09 23:34:10 -08:00
Tay Ray Chuan
7b69079be9 t5541-http-push.sh: add test for unmatched, non-fast-forwarded refs
Some refs can only be matched to a remote ref with an explicit refspec.
When such a ref is a non-fast-forward of its remote ref,  test that
pushing them (with the explicit refspec specified) fails with a non-
fast-foward-type error (viz. printing of ref status and help message).

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-09 23:34:10 -08:00
Tay Ray Chuan
1945237486 t5541-http-push.sh: add tests for non-fast-forward pushes
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-09 23:34:10 -08:00
Andreas Gruenbacher
0606c36a73 base85: Make the code more obvious instead of explaining the non-obvious
Here is another cleanup ...

Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-09 22:43:47 -08:00
Andreas Gruenbacher
b0bec518aa base85: encode_85() does not use the decode table
Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-09 22:43:37 -08:00
Andreas Gruenbacher
75b7e16b6e base85 debug code: Fix length byte calculation
Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-09 22:43:27 -08:00
David Aguilar
3bdfd44309 git-diff.txt: Link to git-difftool
Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-09 22:41:31 -08:00
David Aguilar
1c6f5b52b7 difftool: Allow specifying unconfigured commands with --extcmd
git-difftool requires difftool.<tool>.cmd configuration even when
tools use the standard "$diffcmd $from $to" form.  This teaches
git-difftool to run these tools in lieu of configuration by
allowing the command to be specified on the command line.

Reference: http://article.gmane.org/gmane.comp.version-control.git/133377
Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-09 22:41:30 -08:00
David Aguilar
61ed71dcff difftool--helper: Remove use of the GIT_MERGE_TOOL variable
An undocumented mis-feature in git-difftool is that it allows you
to specify a default difftool by setting GIT_MERGE_TOOL.
This behavior was never documented and was included as an
oversight back when git-difftool was maintained outside of git.

git-mergetool never honored GIT_MERGE_TOOL so neither should
git-difftool.

Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-09 22:41:29 -08:00
David Aguilar
db36713660 difftool--helper: Update copyright and remove distracting comments
Some of the comments in git-difftool--helper are not needed because
the code is sufficiently readable without them.

Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-09 22:41:28 -08:00
Jonathan Nieder
578b62bfa2 Documentation: tiny git config manual tweaks
As a verb, 'setup' is spelled 'set up'.  “diff commands such as
diff-files” scans better without a comma.  Clarify that shallow
and deep are special non-boolean values for format.thread rather
than boolean values with some other name.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-09 22:41:08 -08:00
Jonathan Nieder
efc266e8ae Documentation: git gc packs refs by default now
In commit 56752391 (Make "git gc" pack all refs by default,
2007-05-24), 'git gc' was changed to run pack-refs by default

Versions before v1.5.1.2 cannot clone repos with packed refs over
http, and versions before v1.4.4 cannot handled packed refs at
all, but more recent git should have no problems.  Try to make
this more clear in the git-config manual.

The analagous passage in git-gc.txt was updated already with
commit fe2128a (Change git-gc documentation to reflect
gc.packrefs implementation., 2008-01-09).

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-09 22:40:52 -08:00
Ilari Liusvaara
27a557a9ff Reset possible helper before reusing remote structure
If one had multiple URLs configured for remote with previous one
having forced helper but the subsequent one not, like:

url = foo::bar://baz
url = ssh://example/example.git

Then the subsequent URL is passed to foo helper, which isn't
correct. Fix it to be parsed normally by resetting foreign VCS
name before parsing the URL protocol.

Signed-off-by: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-09 22:38:49 -08:00
Junio C Hamano
18e95f279e ident.c: remove unused variables
d5cc2de (ident.c: Trim hint printed when gecos is empty., 2006-11-28)
reworded the message used as printf() format and dropped "%s" from it;
these two variables that hold the names of GIT_{AUTHOR,COMMITTER}_NAME
environment variables haven't been used since then.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-08 05:53:56 -08:00
Junio C Hamano
d6f8fd0b3e Describe second batch for 1.7.0 in draft release notes
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-07 15:47:32 -08:00
Junio C Hamano
f012d27ff3 Merge branch 'js/filter-branch-prime'
* js/filter-branch-prime:
  filter-branch: remove an unnecessary use of 'git read-tree'
2010-01-07 15:40:30 -08:00
Junio C Hamano
3259ada4c7 Merge branch 'sb/maint-octopus'
* sb/maint-octopus:
  octopus: remove dead code
  octopus: reenable fast-forward merges
  octopus: make merge process simpler to follow

Conflicts:
	git-merge-octopus.sh
2010-01-07 15:40:21 -08:00
Junio C Hamano
0ad6f1a988 Merge branch 'mg/tag-d-show'
* mg/tag-d-show:
  tag -d: print sha1 of deleted tag
2010-01-07 15:38:50 -08:00
Junio C Hamano
aec7de4bed Merge branch 'so/cvsserver-update'
* so/cvsserver-update:
  cvsserver: make the output of 'update' more compatible with cvs.
2010-01-07 15:38:11 -08:00
Junio C Hamano
693f2b1792 Merge branch 'bg/maint-add-all-doc'
* bg/maint-add-all-doc:
  git-rm doc: Describe how to sync index & work tree
  git-add/rm doc: Consistently back-quote
  Documentation: 'git add -A' can remove files
2010-01-07 15:37:57 -08:00
Björn Gustavsson
47b7012024 git-rm doc: Describe how to sync index & work tree
Newcomers to git that want to remove from the index only the
files that have disappeared from the working tree will probably
look for a way to do that in the documentation for 'git rm'.

Therefore, describe how that can be done (even though it involves
other commands than 'git rm'). Based on a suggestion by Junio,
but re-arranged and rewritten to better fit into the style of
command reference.

While at it, change a single occurrence of "work tree" to "working
tree" for consistency.

Signed-off-by: Björn Gustavsson <bgustavsson@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-07 15:37:33 -08:00
Junio C Hamano
762c710b36 Merge branch 'mv/commit-date'
* mv/commit-date:
  Document date formats accepted by parse_date()
  builtin-commit: add --date option
2010-01-07 15:35:55 -08:00
Junio C Hamano
79f6ce5717 Merge branch 'mo/bin-wrappers'
* mo/bin-wrappers:
  INSTALL: document a simpler way to run uninstalled builds
  run test suite without dashed git-commands in PATH
  build dashless "bin-wrappers" directory similar to installed bindir
2010-01-07 15:35:52 -08:00
Nanako Shiraishi
230a456638 rebase -i: teach --onto A...B syntax
When rewriting commits on a topic branch, sometimes it is easier to
compare the version of commits before and after the rewrite if they are
based on the same commit that forked from the upstream. An earlier commit
by Junio (fixed up by the previous commit) gives "--onto A...B" syntax to
rebase command, and rebases on top of the merge base between A and B;
teach the same to the interactive version, too.

Signed-off-by: しらいし ななこ <nanako3@lavabit.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-07 11:15:20 -08:00
Nanako Shiraishi
9f21e97ddc rebase: fix --onto A...B parsing and add tests
The previous patch didn't parse "rebase --onto A...B" correctly when A
isn't an empty string. It also tried to be careful to notice a case in
which there are more than one merge bases, but forgot to give --all option
to merge-base, making the test pointless.

Fix these problems and add a test script to verify. Improvements to the
script to parse A...B syntax was taken from review comments by Johannes
Schindelin.

Signed-off-by: しらいし ななこ <nanako3@lavabit.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-07 11:14:39 -08:00
Junio C Hamano
64da3ae5c1 checkout -m: do not try to fall back to --merge from an unborn branch
If switching from an unborn branch (= empty tree) to a valid commit failed
without -m, it would fail with -m option as well.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-06 23:51:47 -08:00
Nguyễn Thái Ngọc Duy
8740773ee5 t7002: test for not using external grep on skip-worktree paths
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-06 18:29:23 -08:00
Nguyễn Thái Ngọc Duy
cd83ac4156 t7002: set test prerequisite "external-grep" if supported
Add another test to set prerequisite EXTGREP if the current build supports
external grep. This can be used to skip external grep only tests on builds
that do not support this optimization.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-06 18:28:11 -08:00
Nanako Shiraishi
f59baa502f rebase -i --autosquash: auto-squash commits
Teach a new option, --autosquash, to the interactive rebase.
When the commit log message begins with "!fixup ...", and there
is a commit whose title begins with the same ..., automatically
modify the todo list of rebase -i so that the commit marked for
squashing come right after the commit to be modified, and change
the action of the moved commit from pick to squash.

Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-06 17:18:56 -08:00
Junio C Hamano
6d6f9acc5d checkout -m path: fix recreating conflicts
We should tell ll_merge() that the 3-way merge between stages #2 and #3 is
an outermost merge, not a virtual-ancestor creation.

Back when this code was originally written, users couldn't write custom
merge drivers easily, so the bug didn't matter, but these days it does.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-06 13:49:41 -08:00
Junio C Hamano
2df3299d86 .gitattributes: detect 8-space indent in shell scripts
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-06 12:22:25 -08:00
Jonathan Nieder
13fca9f36b Makefile: consolidate .FORCE-* targets
Providing multiple targets to force a rebuild is unnecessary
complication.

Avoid using a name that could conflict with future special
targets in GNU make (a leading period followed by uppercase
letters).

The corresponding change to the git-gui Makefile is left for
another patch.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-06 01:33:45 -08:00
Jonathan Nieder
de54e67c1a Makefile: learn to generate listings for targets requiring special flags
'make git.s' to debug code generation of main() fails because
git.c makes use of preprocessor symbols such as GIT_VERSION that
are not set.  make does not generate code listings for
builtin_help.c, exec_cmd.c, builtin-init-db.c, config.c, http.c,
or http-walker.c either, for the same reason.

So pass the flags used to generate each .o file when generating
the corresponding assembler listing.

Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-06 01:33:35 -08:00
Jonathan Nieder
373a5ede53 Makefile: use target-specific variable to pass flags to cc
This allows reusing the standard %.o: %.c pattern rule even for
targets that require special flags to be set.  Thus after this
change, any changes in the command for compilation only have to
be performed in one place.

Target-specific variables have been supported in GNU make since
version 3.77, which has been available since 1998.

Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-06 01:33:22 -08:00
Jonathan Nieder
31838b4dcd Makefile: regenerate assembler listings when asked
'make var.s' fails to regenerate an assembler listing if var.c
has not changed but a header it includes has:

	$ make var.s
	    CC var.s
	$ touch cache.h
	$ make var.s
	$

The corresponding problem for 'make var.o' does not occur because
the Makefile lists dependencies for each .o target explicitly;
analogous dependency rules for the .s targets are not present.
Rather than add some, it seems better to force 'make' to always
regenerate assembler listings, since the assembler listing
targets are only invoked when specifically requested on the make
command line.

Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-06 01:33:02 -08:00
Tarmigan Casebolt
fd0a8c2e64 Smart-http tests: Test http-backend without curl or a webserver
This reuses many of the tests from the old t5560 but runs those tests
without curl or a webserver.  This will hopefully increase the testing
coverage for http-backend because it does not require users to set
GIT_TEST_HTTPD.

Signed-off-by: Tarmigan Casebolt <tarmigan+git@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-06 01:18:37 -08:00
Tarmigan Casebolt
04481adffe Smart-http tests: Break test t5560-http-backend into pieces
This should introduce no functional change in the tests or the amount
of test coverage.

Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Tarmigan Casebolt <tarmigan+git@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-06 01:18:32 -08:00
Tarmigan Casebolt
43015774c3 Smart-http tests: Improve coverage in test t5560
Commit 34b6cb8bb ("http-backend: Protect GIT_PROJECT_ROOT from /../
requests") added the path_info helper function to test t5560 but did
not use it.  We should use it as it provides another level of error
checking.

The /etc/.../passwd case is one that is not special (and the test
fails for reasons other than being aliased), so we remove that test
case.

Also rename the function from 'path_info' to 'expect_aliased'.

Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Tarmigan Casebolt <tarmigan+git@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-06 01:16:54 -08:00
Tarmigan Casebolt
8b2bd7cdac Smart-http: check if repository is OK to export before serving it
Similar to how git-daemon checks whether a repository is OK to be
exported, smart-http should also check.  This check can be satisfied
in two different ways: the environmental variable GIT_HTTP_EXPORT_ALL
may be set to export all repositories, or the individual repository
may have the file git-daemon-export-ok.

Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Tarmigan Casebolt <tarmigan+git@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-06 01:16:50 -08:00
Tarmigan Casebolt
0d344738dc t/lib-http.sh: Restructure finding of default httpd location
On CentOS 5, httpd is located at /usr/sbin/httpd, and the modules are
located at /usr/lib64/httpd/modules.  To enable easy testing of httpd,
we would like those locations to be detected automatically.

uname might not be the best way to determine the default location for
httpd since different Linux distributions apparently put httpd in
different places, so we test a couple different locations for httpd,
and use the first one that we come across.  We do the same for the
modules directory.

cc: Jay Soffian <jaysoffian@gmail.com>
Signed-off-by: Tarmigan Casebolt <tarmigan+git@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-06 01:07:07 -08:00