1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-10-31 22:37:54 +01:00
Commit graph

1082 commits

Author SHA1 Message Date
Junio C Hamano
106db883b7 Merge branch 'maint'
* maint:
  Makefile: add merge_recursive.h to LIB_H
  Improve documentation for --dirstat diff option
  Bring local clone's origin URL in line with that of a remote clone
  Documentation: minor cleanup in a use case in 'git stash' manual
  Documentation: fix disappeared lines in 'git stash' manpage
  Documentation: fix reference to a for-each-ref option
2008-09-02 17:10:08 -07:00
Miklos Vajna
db3a95459c Makefile: add merge_recursive.h to LIB_H
When modifying merge-recursive.h, for example builtin-merge-recursive.c
have to be recompiled which was not true till now, causing various
runtime errors using an incremental build.

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-02 17:03:51 -07:00
Junio C Hamano
7df437e56b Merge branch 'maint'
* maint:
  gitattributes: -crlf is not binary
  git-apply: Loosen "match_beginning" logic
  Fix example in git-name-rev documentation
  shell: do not play duplicated definition games to shrink the executable
  Fix use of hardlinks in "make install"
  pack-objects: Allow missing base objects when creating thin packs
2008-08-30 20:31:39 -07:00
Junio C Hamano
014aff7c92 Merge branch 'af/maint-install-no-handlink' into maint
* af/maint-install-no-handlink:
  Fix use of hardlinks in "make install"
  Makefile: always provide a fallback when hardlinks fail
2008-08-29 22:39:25 -07:00
Junio C Hamano
6ffaecc7d8 shell: do not play duplicated definition games to shrink the executable
Playing with linker games to shrink git-shell did not go well with various
other platforms and compilers.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-29 22:38:41 -07:00
Alex Riesen
4e3ae59ef6 Fix use of hardlinks in "make install"
The code failed to filter-out git-add properly on platforms were $X is
not empty (ATM there is only one such a platform).

Than it tried to create a hardlink to the file ($execdir/git-add) it just
removed (because git-add is first in the BUILT_INS), so ln failed (but
because stderr was redirected into /dev/null the error was never seen), and
the whole install ended up using "ln -s" instead.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-29 22:37:04 -07:00
Junio C Hamano
a1184d85e8 Merge branch 'mv/merge-custom'
* mv/merge-custom:
  t7606: fix custom merge test
  Fix "git-merge -s bogo" help text
  Update .gitignore to ignore git-help
  Builtin git-help.
  builtin-help: always load_command_list() in cmd_help()
  Add a second testcase for handling invalid strategies in git-merge
  Add a new test for using a custom merge strategy
  builtin-merge: allow using a custom strategy
  builtin-help: make some internal functions available to other builtins

Conflicts:
	help.c
2008-08-27 17:28:31 -07:00
Junio C Hamano
cb138fede6 Merge branch 'af/maint-install-no-handlink'
* af/maint-install-no-handlink:
  Makefile: always provide a fallback when hardlinks fail
2008-08-26 17:08:25 -07:00
Junio C Hamano
c7f72248e3 Merge branch 'jc/no-slim-shell'
* jc/no-slim-shell:
  Revert "Build-in "git-shell""
2008-08-26 17:08:22 -07:00
Andreas Färber
3e073dc561 Makefile: always provide a fallback when hardlinks fail
We make hardlinks from "git" to "git-<cmd>" built-ins and have been
careful to avoid cross-device links when linking "git-<cmd>" to
gitexecdir.

However, we were not prepared to deal with a build directory that is
incapable of making hard links within itself. This patch corrects it.

Instead of temporarily linking "git" to gitexecdir, directly link "git-
add", falling back to "cp". Try hardlinking that as "git-<cmd>", falling
back to symlinks or "cp" on error.

While at it, avoid 100+ error messages from hardlink failures when we are
going to fall back to symlinks or "cp" by redirecting the standard error
to /dev/null.

Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-25 23:14:39 -07:00
Junio C Hamano
1e7abc593d Revert "Build-in "git-shell""
This reverts commit daa0cc9a92.
It was a stupid idea to do this; when run as a log-in shell,
it is spawned with argv[0] set to "-git-shell", so the usual
name-based dispatch would not work to begin with.
2008-08-25 22:39:17 -07:00
Tommi Virtanen
27a6ed492b Install git-shell in bindir, too
/etc/passwd shell field must be something execable, you can't enter
"/usr/bin/git shell" there. git-shell must be present as a separate
executable, or it is useless.

Signed-off-by: Tommi Virtanen <tv@eagain.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-24 16:15:25 -07:00
Junio C Hamano
837a156197 Merge branch 'jc/no-slim-shell'
* jc/no-slim-shell:
  Build-in "git-shell"
  shell: do not play duplicated definition games to shrink the executable
2008-08-24 16:14:22 -07:00
Junio C Hamano
49d3536594 Merge branch 'maint' to sync with 1.6.0.1 2008-08-24 14:50:44 -07:00
Miklos Vajna
7d77016327 Makefile: enable SNPRINTF_RETURNS_BOGUS for HP-UX
In 81cc66a, customization has been added to Makefile for supporting
HP-UX, but git commit is still problematic. This should fix the issue.

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Acked-by: Robert Schiele <rschiele@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-23 21:53:35 -07:00
Junio C Hamano
daa0cc9a92 Build-in "git-shell"
This trivially makes "git-shell" a built-in.  It makes the executable even
fatter, though.

And MinGW removed git-shell only because of the funny dependencies; there
is no reason to do so anymore.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Tested-on-MinGW-by: Johannes Sixt <johannes.sixt@telecom.at>
2008-08-20 01:36:10 -07:00
Junio C Hamano
652b0bbe09 Merge branch 'ph/enable-threaded'
* ph/enable-threaded:
  Enable threaded delta search on *BSD and Linux.
2008-08-19 21:43:01 -07:00
Junio C Hamano
c8a4cbc239 Merge branch 'rs/imap'
* rs/imap:
  Documentation: Improve documentation for git-imap-send(1)
  imap-send.c: more style fixes
  imap-send.c: style fixes
  git-imap-send: Support SSL
  git-imap-send: Allow the program to be run from subdirectories of a git tree
2008-08-19 21:42:46 -07:00
Junio C Hamano
4cfc24afc9 shell: do not play duplicated definition games to shrink the executable
Playing with linker games to shrink git-shell did not go well with various
other platforms and compilers.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-19 18:05:39 -07:00
Junio C Hamano
fdb2a2a600 compat: introduce on_disk_bytes()
Some platforms do not have st_blocks member in "struct stat"; mingw
already emulates it by rounding it up to closest 512-byte blocks (even
though it could overcount when a file has holes).

The reason to use the member is only to figure out how many kilobytes the
files occupy on-disk, so give a helper function in git-compat-util.h to
compute this value.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Acked-by: Johannes Sixt <johannes.sixt@telecom.at>
2008-08-18 22:37:55 -07:00
Eric Blake
0d768f7c8f Makefile: building git in cygwin 1.7.0
On platforms with $X, make removes any leftover scripts 'a' from
earlier builds if a new binary 'a.exe' is now built.  However, on
cygwin 1.7.0, 'git' and 'git.exe' now consistently name the same file.
Test for file equality before attempting a remove, in order to avoid
nuking just-built binaries.

Signed-off-by: Eric Blake <ebb9@byu.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-16 02:34:23 -07:00
Brandon Casey
6dc4627ef4 Makefile: add a target which will abort compilation with ancient shells
This adds a make target which can be used to try to execute certain shell
constructs which are required for compiling and running git.

This patch provides a test for the $() notation for command substition
which is used in the Makefile and extensively in the git scripts.

The make target is named in such a way as to be a hint to the user that
SHELL_PATH should be set to an appropriate shell. If the shell command
fails, the user should receive a message similar to the following:

make: *** [please_set_SHELL_PATH_to_a_more_modern_shell] Error 2

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-08 16:15:17 -07:00
Brandon Casey
c94c8e5ff6 Makefile: set SHELL to value of SHELL_PATH
Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-08 13:17:25 -07:00
Miklos Vajna
3d78d1f18f Builtin git-help.
This patch splits out git-help's functions to builtin-help.c and leaves
only functions used by other builtins in help.c.

First this removes git-help's functions from libgit which are not
interesting for other builtins, second this makes 'git help help' work
again.

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-02 18:06:37 -07:00
Miklos Vajna
940208a771 builtin-help: make some internal functions available to other builtins
Make load_command_list() capable of filtering for a given prefix and
loading into a pair of "struct cmdnames" supplied by the caller.

Make the static add_cmdname(), exclude_cmds() and is_in_cmdlist()
functions non-static.

Make list_commands() accept a custom title, and work from a pair of
"struct cmdnames" supplied by the caller.

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-29 23:21:36 -07:00
Junio C Hamano
1b65f38c06 Allow installing in the traditional way
In an earlier commit c70a8d9 (Makefile: Do not install a copy of 'git' in
$(gitexecdir), 2008-07-21), we tried to avoid installing two git, one in
/usr/bin/git and the other in /usr/libexec/git-core/git.  It mistakenly
removed the only copy of git when gitexecdir and bindir are set to the
same directory, i.e. the traditional layout.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-28 13:09:54 -07:00
Junio C Hamano
e84a063da8 Allow building without any git installed
This is a follow-up patch to 49fa65a (Allow the built-in exec path to be
relative to the command invocation path, 2008-07-23).  Without specific
gitexecdir passed from the command line, git-gui's build procedure would
try to figure out the value for it by running an installed git.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-28 13:09:54 -07:00
Robert Shearman
684ec6c63c git-imap-send: Support SSL
Allow SSL to be used when a imaps:// URL is used for the host name.

Also, automatically use TLS when not using imaps:// by using the IMAP
STARTTLS command, if the server supports it.

Tested with Courier and Gimap IMAP servers.

Signed-off-by: Robert Shearman <robertshearman@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-25 21:51:30 -07:00
Johannes Sixt
7b4b59a963 Windows: Do not compile git-shell
Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-25 17:41:13 -07:00
Johannes Sixt
bf74a88244 Windows: Make $(gitexecdir) relative
Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-25 17:41:13 -07:00
Johannes Sixt
49fa65a7a8 Allow the built-in exec path to be relative to the command invocation path
If GIT_EXEC_PATH (the macro that is defined in the Makefile) is relative,
it is interpreted relative to the command's invocation path, which usually
is $(bindir).

The Makefile rules were written with the assumption that $(gitexecdir) is
an absolute path. We introduce a separate variable that names the
(absolute) installation directory.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-25 17:41:13 -07:00
Johannes Sixt
966c6edd31 Fix relative built-in paths to be relative to the command invocation
$(gitexecdir) (as defined in the Makefile) has gained another path
component, but the relative paths in the MINGW section of the Makefile,
which are interpreted relative to it, do not account for it.

Instead of adding another ../ in front of the path, we change the code that
constructs the absolute paths to do it relative to the command's directory,
which is essentially $(bindir). We do it this way because we will also
allow a relative $(gitexecdir) later.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-25 17:41:13 -07:00
Johannes Sixt
46beb55988 Makefile: Normalize $(bindir) and $(gitexecdir) before comparing
The install target needs to check whether the user has opted to make
$(gitexecdir) equal to $(bindir). It did so by a straight string
comparison. Since we are going to allow a relative $(gitexecdir), we have
to normalize paths before comparison, which we do with $(cd there && pwd).

The normalized paths are stored in shell variables. These we can now
reuse in the subsequent install statements, which conveniently shortens
the lines a bit.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-25 17:41:12 -07:00
Johannes Sixt
c70a8d98a5 Makefile: Do not install a copy of 'git' in $(gitexecdir)
There is already a copy in $(bindir). A subsequent patch will enable git
to derive the exec-path from its invocation path. If git is invoked
recursively, the first invocation puts the exec-path into PATH, so that
the recursive invocation would find the instance in the exec-path. This
second instance would again try to derive an exec-path from its invocation
path, but would base its result on the wrong "bindir".

We do install the copy of git first, but remove it later, so that we can
use it as the source of the hardlinks for the builtins.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-25 17:41:12 -07:00
Stephan Beyer
d82f33e20d Move launch_editor() from builtin-tag.c to editor.c
launch_editor() is declared in strbuf.h but defined in builtin-tag.c.
This patch moves launch_editor() into a new source file editor.c,
but keeps the declaration in strbuf.h.

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-25 17:08:34 -07:00
Junio C Hamano
d9d9e6ee63 Merge branch 'maint'
* maint:
  Makefile: fix shell quoting
  tests: propagate $(TAR) down from the toplevel Makefile
  index-pack.c: correctly initialize appended objects
  send-email: find body-encoding correctly
2008-07-25 13:56:36 -07:00
Junio C Hamano
bfce5087ee Makefile: fix shell quoting
Makefile records paths to a few programs in GIT-BUILD-OPTIONS file.  These
paths need to be quoted twice: once to protect specials from the shell
that runs the generated GIT-BUILD-OPTIONS file, and again to protect them
(and the first level of quoting itself) from the shell that runs the
"echo" inside the Makefile.

You can test this by trying:

    $ ln -s /bin/tar "$HOME/Tes' program/tar"
    $ make TAR="$HOME/Tes' program/tar" test

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-25 12:36:16 -07:00
Junio C Hamano
c30e699fc5 tests: propagate $(TAR) down from the toplevel Makefile
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-25 11:09:48 -07:00
Pierre Habouzit
38bd64979a Enable threaded delta search on *BSD and Linux.
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-22 00:09:49 -07:00
Johannes Schindelin
c455c87c5c Rename path_list to string_list
The name path_list was correct for the first usage of that data structure,
but it really is a general-purpose string list.

$ perl -i -pe 's/path-list/string-list/g' $(git grep -l path-list)
$ perl -i -pe 's/path_list/string_list/g' $(git grep -l path_list)
$ git mv path-list.h string-list.h
$ git mv path-list.c string-list.c
$ perl -i -pe 's/has_path/has_string/g' $(git grep -l has_path)
$ perl -i -pe 's/path/string/g' string-list.[ch]
$ git mv Documentation/technical/api-path-list.txt \
	Documentation/technical/api-string-list.txt
$ perl -i -pe 's/strdup_paths/strdup_strings/g' $(git grep -l strdup_paths)

... and then fix all users of string-list to access the member "string"
instead of "path".

Documentation/technical/api-string-list.txt needed some rewrapping, too.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-21 19:11:50 -07:00
Junio C Hamano
7df1709c36 Link shell with compat layer functions
This in the short term will break on platforms that use compat implemenations
that call outside compat layer, but that is exactly what we want.  To give
incentive to fix things for people who are affected and more importantly have
environment to test their fixes.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-20 17:17:09 -07:00
Peter Harris
c09df8a74e Add ANSI control code emulation for the Windows console
This adds only the minimum necessary to keep git pull/merge's diffstat from
wrapping. Notably absent is support for the K (erase) operation, and support
for POSIX write.

Signed-off-by: Peter Harris <git@peter.is-a-geek.org>
Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-19 11:17:43 -07:00
Stephan Beyer
7856844823 Link git-shell only to a subset of libgit.a
Commit 5b8e6f85 introduced stubs for three functions that make no sense
for git-shell. But those stubs defined libgit.a functions a second time
so that a linker can complain.

Now git-shell is only linked to a subset of libgit.a.

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-19 11:17:42 -07:00
Junio C Hamano
1f8dc67155 Merge branch 'mv/dashless'
* mv/dashless:
  make remove-dashes: apply to scripts and programs as well, not just to builtins
  git-bisect: use dash-less form on git bisect log
  t1007-hash-object.sh: use quotes for the test description
  t0001-init.sh: change confusing directory name
2008-07-16 17:49:59 -07:00
Junio C Hamano
fcab40a389 Merge branch 'mv/merge-in-c'
* mv/merge-in-c:
  reduce_heads(): protect from duplicate input
  reduce_heads(): thinkofix
  Add a new test for git-merge-resolve
  t6021: add a new test for git-merge-resolve
  Teach merge.log to "git-merge" again
  Build in merge
  Fix t7601-merge-pull-config.sh on AIX
  git-commit-tree: make it usable from other builtins
  Add new test case to ensure git-merge prepends the custom merge message
  Add new test case to ensure git-merge reduces octopus parents when possible
  Introduce reduce_heads()
  Introduce get_merge_bases_many()
  Add new test to ensure git-merge handles more than 25 refs.
  Introduce get_octopus_merge_bases() in commit.c
  git-fmt-merge-msg: make it usable from other builtins
  Move read_cache_unmerged() to read-cache.c
  Add new test to ensure git-merge handles pull.twohead and pull.octopus
  Move parse-options's skip_prefix() to git-compat-util.h
  Move commit_list_count() to commit.c
  Move split_cmdline() to alias.c

Conflicts:
	Makefile
	parse-options.c
2008-07-15 19:09:46 -07:00
Miklos Vajna
b4f02d3509 make remove-dashes: apply to scripts and programs as well, not just to builtins
All programs and scripts are now moved outside PATH, so it's a good idea
not to use the dashed forms for them, either.

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-11 21:13:17 -07:00
Stephan Beyer
5b2fd95606 rerere: Separate libgit and builtin functions
This patch moves rerere()-related functions into a newly created
rerere.c file.
The setup_rerere() function is needed by both rerere() and cmd_rerere(),
so this function is moved to rerere.c and declared non-static (and "extern")
in newly created rerere.h file.

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-10 00:26:29 -07:00
Miklos Vajna
1c7b76be7d Build in merge
Mentored-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-07 17:50:01 -07:00
Junio C Hamano
17d778e710 Merge branch 'dr/ceiling'
* dr/ceiling:
  Eliminate an unnecessary chdir("..")
  Add support for GIT_CEILING_DIRECTORIES
  Fold test-absolute-path into test-path-utils
  Implement normalize_absolute_path

Conflicts:

	cache.h
	setup.c
2008-07-07 02:17:23 -07:00
Miklos Vajna
51add76e92 Retire 'stupid' merge strategy
As pointed out by Linus, this strategy tries to take the best merge
base, but 'recursive' just does it better. If one needs something more
than 'resolve' then he/she should really use 'recursive' and not
'stupid'.

Cf. Message-ID: <alpine.LFD.1.10.0807030947360.18105@woody.linux-foundation.org>

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-05 10:43:46 -07:00