Commit Graph

13242 Commits

Author SHA1 Message Date
Steffen Prohaska
565861de3b spawn-pipe.c: Remove unnecessary cast
Signed-off-by: Steffen Prohaska <prohaska@zib.de>
2007-11-21 20:05:49 +01:00
Steffen Prohaska
ad941f2336 exec_cmd.c: Add cast that is needed for Posix execvp
Signed-off-by: Steffen Prohaska <prohaska@zib.de>
2007-11-21 20:05:47 +01:00
Steffen Prohaska
af18e7d9d3 Fix prototypes for mingw_execve and mingw_execvp to match Posix
This changes the prototypes to match
http://www.opengroup.org/onlinepubs/7990989775/xsh/exec.html

Note, spawnvpe uses a different type for argv and envp
than execve.  So at some point we need to cast.  This
commit shifts the cast into the compat functions.  From
the outside, execve and execvp match Posix.

Signed-off-by: Steffen Prohaska <prohaska@zib.de>
2007-11-21 20:05:43 +01:00
Steffen Prohaska
66417d164e Add ifdef __MINGW32__ to avoid warning about unused "progress"
Signed-off-by: Steffen Prohaska <prohaska@zib.de>
2007-11-21 20:05:41 +01:00
Steffen Prohaska
32dead9686 Use getpagesize() from git-compat-util.h
Signed-off-by: Steffen Prohaska <prohaska@zib.de>
2007-11-18 12:10:21 +01:00
Steffen Prohaska
5e23af17e4 Remove unnecessary decl of sync()
Signed-off-by: Steffen Prohaska <prohaska@zib.de>
2007-11-18 12:10:08 +01:00
Steffen Prohaska
51355b1ede remove git_install_prefix()
git_install_prefix() is no longer needed.  Relocatable
paths are searched relative to git_exec_dir().

This commit removes git_install_prefix().

Signed-off-by: Steffen Prohaska <prohaska@zib.de>
2007-11-18 12:09:52 +01:00
Steffen Prohaska
e9d8b9207e help: search html documentation relativ to git_exec_dir()
Global gitconfig and templates are searched relativ
to git_exec_dir() to make the installation relocatable.

This commit changes help to do the same for finding
the html documentation.

Signed-off-by: Steffen Prohaska <prohaska@zib.de>
2007-11-18 12:09:42 +01:00
Steffen Prohaska
0699304102 Use relative paths to make installation relocatable
mingw uses relative paths for template_dir and ETC_GITCONFIG
to make an installation relocatable.  Relative paths will
be expanded relative to git_exec_dir().  This mechanism is
now included in official git.git.

We used a different mechanism to create a relocatable
installation.  We used to prefix absolute Unix paths with
the installation prefix, derived from the path of git.exe.

This commit reverts our implementation to match mingw.

Part of the change are reverts of the following commits,
which are no longer needed:
4e8904080d
0fbe22da39.
636116b8a7.

Signed-off-by: Steffen Prohaska <prohaska@zib.de>
2007-11-18 12:09:33 +01:00
Steffen Prohaska
fcdd78c3c3 Merge commit 'mingw/master' into work/merge-mingw-master
Conflicts:

	git-compat-util.h
	help.c
	pager.c

Signed-off-by: Steffen Prohaska <prohaska@zib.de>
2007-11-17 12:17:45 +01:00
Johannes Sixt
7828980b8c Revert "sum.exe is available from GNUWin32 (CoreUtils)."
This reverts commit efe7309073.
This "sum.exe" knows it better and writes CRLF line endings. Hmpf.
2007-11-17 00:01:59 +01:00
Johannes Sixt
2d12ef8d57 Merge branch 'js/mingw-fallouts' 2007-11-16 23:14:51 +01:00
Johannes Sixt
3dffb74b2c Use start_command() and finish_command() to run the pager.
This gets rid of a call to spawnvpe_pipe() (and Windows-specific cwait()).
2007-11-16 22:54:27 +01:00
Johannes Sixt
ff1c27fb4e Revert "Protect {tree} from being expanded by the shell."
This reverts commit bff909b882.
git-tag is now a builtin and does not need the extra escaping anymore.
2007-11-16 08:59:41 +01:00
Johannes Sixt
157737a3d9 stat.exe is available from GNUWin32 (CoreUtils). 2007-11-16 08:59:39 +01:00
Johannes Sixt
efe7309073 sum.exe is available from GNUWin32 (CoreUtils). 2007-11-16 08:59:37 +01:00
Johannes Sixt
a8cf9a4ac1 Remove unnecessary dd function.
The test now uses test-genrandom instead of dd if=/dev/random.
2007-11-16 08:59:29 +01:00
Steffen Prohaska
16df3f7e4c Merge commit 'mingw/master' into work/merge-mingw-master
Remove getpagesize() from sha1_file.c because is it now
included in git-compat-util.h.

Conflicts:

	Makefile
	compat/mingw.c
	git-compat-util.h

Signed-off-by: Steffen Prohaska <prohaska@zib.de>
2007-11-16 07:33:14 +01:00
Nicolas Pitre
5f9ffff308 rehabilitate some t5302 tests on 32-bit off_t machines
Commit 8ed2fca458 was a bit draconian in
skipping certain tests which should be perfectly valid even on platform
with a 32-bit off_t.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-15 21:18:07 -08:00
Johannes Sixt
e8586bac15 Revert "Work around missing EISDIR errno values."
This reverts the remaining part of commit
ff61d9fc99.
2007-11-15 22:27:14 +01:00
Johannes Sixt
fab21181f4 Implement a wrapper of the open() function.
The wrapper does two things:
- Requests to open /dev/null are redirected to open the nul pseudo file.
- A request to open a file that currently exists as a directory, then
  Windows's open fails with EACCES; this is changed to EISDIR.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
2007-11-15 22:27:09 +01:00
Johannes Sixt
a5ac001acc upload-pack: rely on finish_command() and finish_async()
We don't need explicitly handle the processes anymore.
2007-11-15 21:30:08 +01:00
Johannes Sixt
6ee8b07d4c Merge branch 'master' of git://repo.or.cz/alt-git 2007-11-15 21:03:07 +01:00
Johannes Sixt
7f0e39faa2 Allow ETC_GITCONFIG to be a relative path.
If ETC_GITCONFIG is not an absolute path, interpret it relative to
--exec-dir. This makes the installed binaries relocatable because the
prefix is not compiled-in.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-14 15:18:39 -08:00
Johannes Sixt
506b17b136 Introduce git_etc_gitconfig() that encapsulates access of ETC_GITCONFIG.
In a subsequent patch the path to the system-wide config file will be
computed. This is a preparation for that change. It turns all accesses
of ETC_GITCONFIG into function calls. There is no change in behavior.

As a consequence, config.c is the only file that needs the definition of
ETC_GITCONFIG. Hence, -DETC_GITCONFIG is removed from the CFLAGS and a
special build rule for config.c is introduced. As a side-effect, changing
the defintion of ETC_GITCONFIG (e.g. in config.mak) does not trigger a
complete rebuild anymore.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-14 15:18:39 -08:00
Johannes Sixt
a47d181380 Allow a relative builtin template directory.
In order to make git relocatable (i.e. not have the prefix compiled-in)
the template directory must depend on the location where this git instance
is found, which is GIT_EXEC_DIR.

The exec path is prepended only if the compiled-in default template
directory is to be used and that is relative. Any relative directories
that are specified via environment variable or the --exec-dir switch are
taken as is.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-14 15:18:39 -08:00
Johannes Schindelin
4723ee992c Close files opened by lock_file() before unlinking.
This is needed on Windows since open files cannot be unlinked.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-14 15:18:39 -08:00
Johannes Sixt
2488df84a2 builtin run_command: do not exit with -1.
There are shells that do not correctly detect an exit code of -1 as a
failure. We simply truncate the status code to the lower 8 bits.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-14 15:18:39 -08:00
Johannes Sixt
80bbe72b76 Move #include <sys/select.h> and <sys/ioctl.h> to git-compat-util.h.
... since all system headers are pulled in via git-compat-util.h

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-14 15:18:39 -08:00
Johannes Sixt
85dadc3894 Use is_absolute_path() in sha1_file.c.
There are some places that test for an absolute path. Use the helper
function to ease porting.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-14 15:18:39 -08:00
Johannes Sixt
25482a3c0c Skip t3902-quoted.sh if the file system does not support funny names.
Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-14 15:18:39 -08:00
Johannes Sixt
8ed2fca458 t5302-pack-index: Skip tests of 64-bit offsets if necessary.
There are platforms where off_t is not 64 bits wide. In this case many tests
are doomed to fail. Let's skip them.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-14 15:18:39 -08:00
Johannes Sixt
41ec097aea t7501-commit.sh: Not all seds understand option -i
Use mv instead.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-14 15:18:39 -08:00
Johannes Sixt
63405283c3 t5300-pack-object.sh: Split the big verify-pack test into smaller parts.
This makes it easier to spot which of the tests failed.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-14 15:18:39 -08:00
Junio C Hamano
039bc64e88 core.excludesfile clean-up
There are inconsistencies in the way commands currently handle
the core.excludesfile configuration variable.  The problem is
the variable is too new to be noticed by anything other than
git-add and git-status.

 * git-ls-files does not notice any of the "ignore" files by
   default, as it predates the standardized set of ignore files.
   The calling scripts established the convention to use
   .git/info/exclude, .gitignore, and later core.excludesfile.

 * git-add and git-status know about it because they call
   add_excludes_from_file() directly with their own notion of
   which standard set of ignore files to use.  This is just a
   stupid duplication of code that need to be updated every time
   the definition of the standard set of ignore files is
   changed.

 * git-read-tree takes --exclude-per-directory=<gitignore>,
   not because the flexibility was needed.  Again, this was
   because the option predates the standardization of the ignore
   files.

 * git-merge-recursive uses hardcoded per-directory .gitignore
   and nothing else.  git-clean (scripted version) does not
   honor core.* because its call to underlying ls-files does not
   know about it.  git-clean in C (parked in 'pu') doesn't either.

We probably could change git-ls-files to use the standard set
when no excludes are specified on the command line and ignore
processing was asked, or something like that, but that will be a
change in semantics and might break people's scripts in a subtle
way.  I am somewhat reluctant to make such a change.

On the other hand, I think it makes perfect sense to fix
git-read-tree, git-merge-recursive and git-clean to follow the
same rule as other commands.  I do not think of a valid use case
to give an exclude-per-directory that is nonstandard to
read-tree command, outside a "negative" test in the t1004 test
script.

This patch is the first step to untangle this mess.

The next step would be to teach read-tree, merge-recursive and
clean (in C) to use setup_standard_excludes().

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-14 15:08:04 -08:00
Junio C Hamano
f5f6cb87de Merge branch 'sp/fetch-fix'
* sp/fetch-fix:
  git-fetch: avoid local fetching from alternate (again)
  rev-list: Introduce --quiet to avoid /dev/null redirects
  run-command: Support sending stderr to /dev/null
  git-fetch: Always fetch tags if the object they reference exists
2007-11-14 14:26:04 -08:00
Junio C Hamano
b2e163272c Merge branch 'bs/maint-commit-options'
* bs/maint-commit-options:
  git-commit: Add tests for invalid usage of -a/--interactive with paths
  git-commit.sh: Fix usage checks regarding paths given when they do not make sense
2007-11-14 14:25:46 -08:00
Junio C Hamano
43f36901c5 Merge branch 'rv/maint-index-commit'
* rv/maint-index-commit:
  Make GIT_INDEX_FILE apply to git-commit
2007-11-14 14:25:33 -08:00
Junio C Hamano
9f165805f3 Merge branch 'bs/maint-t7005'
* bs/maint-t7005:
  t7005-editor.sh: Don't invoke real vi when it is in GIT_EXEC_PATH
2007-11-14 14:25:19 -08:00
Junio C Hamano
c78a24986d Merge branch 'jc/maint-add-sync-stat'
* jc/maint-add-sync-stat:
  t2200: test more cases of "add -u"
  git-add: make the entry stat-clean after re-adding the same contents
  ce_match_stat, run_diff_files: use symbolic constants for readability

Conflicts:

	builtin-add.c
2007-11-14 14:15:40 -08:00
Junio C Hamano
ef4de8357d Merge branch 'mh/retag'
* mh/retag:
  Add tests for git tag
  Reuse previous annotation when overwriting a tag
2007-11-14 14:06:09 -08:00
Junio C Hamano
5e389c430d Merge branch 'jc/stash-create'
* jc/stash-create:
  git-stash: Fix listing stashes
  git-merge: no reason to use cpio anymore
  Revert "rebase: allow starting from a dirty tree."
  rebase: allow starting from a dirty tree.
  stash: implement "stash create"
2007-11-14 14:05:47 -08:00
Junio C Hamano
55571f7861 Merge branch 'bg/format-patch-N'
* bg/format-patch-N:
  Rearrange git-format-patch synopsis to improve clarity.
  format-patch: Test --[no-]numbered and format.numbered
  format-patch: Add configuration and off switch for --numbered
2007-11-14 14:04:25 -08:00
Junio C Hamano
03edb0a753 Merge branch 'np/progress'
* np/progress:
  nicer display of thin pack completion
  make display of total transferred fully accurate
  remove dead code from the csum-file interface
  git-fetch: be even quieter.
  make display of total transferred more accurate
  sideband.c: ESC is spelled '\033' not '\e' for portability.
  fix display overlap between remote and local progress
2007-11-14 14:04:19 -08:00
Junio C Hamano
dcb83ec18d Merge branch 'js/rebase-detached'
* js/rebase-detached:
  rebase: fix "rebase --continue" breakage
  rebase: operate on a detached HEAD
2007-11-14 14:04:06 -08:00
Junio C Hamano
37ec2b4c26 Merge branch 'rs/pretty'
* rs/pretty:
  Fix preprocessor logic that determines the availablity of strchrnul().
  Simplify strchrnul() compat code
  --format=pretty: avoid calculating expensive expansions twice
  add strbuf_adddup()
  --pretty=format: parse commit message only once
  --pretty=format: on-demand format expansion
  Add strchrnul()
2007-11-14 14:03:50 -08:00
Junio C Hamano
4356736571 Merge branch 'rr/cvsexportcommit-w'
* rr/cvsexportcommit-w:
  cvsexportcommit: Add switch to specify CVS workdir
2007-11-14 14:03:40 -08:00
Junio C Hamano
e318f60723 Merge branch 'gh/cvsimport-user'
* gh/cvsimport-user:
  git-cvsimport: fix handling of user name when it is not set in CVSROOT
2007-11-14 14:03:27 -08:00
Sergei Organov
93cbbd7121 user-manual: minor rewording for clarity.
Junio screwed up when applying the previous round of the patch;
rewording from "previous" to "old" does make the description
clearer.

Also revert the rewording from head to branch.  The description
is talking about the branch's tip commit and using the word head
is clearer.

Based on input from Sergei and Bruce.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-14 12:08:15 -08:00
Junio C Hamano
fb5fd01148 Merge branch 'maint'
* maint:
  git-clean: honor core.excludesfile
  Documentation: Fix man page breakage with DocBook XSL v1.72
  git-remote.txt: fix typo
  core-tutorial.txt: Fix argument mistake in an example.
  replace reference to git-rm with git-reset in git-commit doc
  Grammar fixes for gitattributes documentation
  Don't allow fast-import tree delta chains to exceed maximum depth
  revert/cherry-pick: allow starting from dirty work tree.
  t/t3404: fix test for a bogus todo file.

Conflicts:

	fast-import.c
2007-11-14 03:37:18 -08:00