]> git.ipfire.org Git - thirdparty/git.git/log
thirdparty/git.git
15 years agoRefactor "tracking statistics" code used by "git checkout"
Junio C Hamano [Wed, 2 Jul 2008 07:51:18 +0000 (00:51 -0700)] 
Refactor "tracking statistics" code used by "git checkout"

People seem to like "Your branch is ahead by N commit" report made by
"git checkout", but the interface into the statistics function was a bit
clunky.  This splits the function into three parts:

 * The core "commit counting" function that takes "struct branch" and
   returns number of commits to show if we are ahead, behind or forked;

 * Convenience "stat formating" function that takes "struct branch" and
   formats the report into a given strbuf, using the above function;

 * "checkout" specific function that takes "branch_info" (type that is
   internal to checkout implementation), calls the above function and
   print the formatted result.

in the hope that the former two can be more easily reusable.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit-send-email: Do not attempt to STARTTLS more than once
Thomas Rast [Wed, 2 Jul 2008 22:11:31 +0000 (00:11 +0200)] 
git-send-email: Do not attempt to STARTTLS more than once

With the previous TLS patch, send-email would attempt to STARTTLS at
the beginning of every mail, despite reusing the last connection.  We
simply skip further encryption checks after successful TLS initiation.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'j6t/mingw'
Junio C Hamano [Thu, 3 Jul 2008 04:57:52 +0000 (21:57 -0700)] 
Merge branch 'j6t/mingw'

* j6t/mingw: (38 commits)
  compat/pread.c: Add a forward declaration to fix a warning
  Windows: Fix ntohl() related warnings about printf formatting
  Windows: TMP and TEMP environment variables specify a temporary directory.
  Windows: Make 'git help -a' work.
  Windows: Work around an oddity when a pipe with no reader is written to.
  Windows: Make the pager work.
  When installing, be prepared that template_dir may be relative.
  Windows: Use a relative default template_dir and ETC_GITCONFIG
  Windows: Compute the fallback for exec_path from the program invocation.
  Turn builtin_exec_path into a function.
  Windows: Use a customized struct stat that also has the st_blocks member.
  Windows: Add a custom implementation for utime().
  Windows: Add a new lstat and fstat implementation based on Win32 API.
  Windows: Implement a custom spawnve().
  Windows: Implement wrappers for gethostbyname(), socket(), and connect().
  Windows: Work around incompatible sort and find.
  Windows: Implement asynchronous functions as threads.
  Windows: Disambiguate DOS style paths from SSH URLs.
  Windows: A rudimentary poll() emulation.
  Windows: Implement start_command().
  ...

15 years agoMerge branch 'maint'
Junio C Hamano [Thu, 3 Jul 2008 04:57:50 +0000 (21:57 -0700)] 
Merge branch 'maint'

* maint:
  Fix describe --tags --long so it does not segfault

15 years agoMerge branch 'js/maint-clone-insteadof' into maint
Junio C Hamano [Thu, 3 Jul 2008 04:32:44 +0000 (21:32 -0700)] 
Merge branch 'js/maint-clone-insteadof' into maint

* js/maint-clone-insteadof:
  clone: respect the settings in $HOME/.gitconfig and /etc/gitconfig
  clone: respect url.insteadOf setting in global configs

15 years agoMerge branch 'jk/maint-fetch-ref-hier' into maint
Junio C Hamano [Thu, 3 Jul 2008 04:32:44 +0000 (21:32 -0700)] 
Merge branch 'jk/maint-fetch-ref-hier' into maint

* jk/maint-fetch-ref-hier:
  fetch: give a hint to the user when local refs fail to update
  fetch: report local storage errors in status table

15 years agoMerge branch 'jc/maint-reset' into maint
Junio C Hamano [Thu, 3 Jul 2008 04:32:44 +0000 (21:32 -0700)] 
Merge branch 'jc/maint-reset' into maint

* jc/maint-reset:
  Allow "git-reset path" when unambiguous

15 years agoFix describe --tags --long so it does not segfault
Shawn O. Pearce [Thu, 3 Jul 2008 02:32:45 +0000 (02:32 +0000)] 
Fix describe --tags --long so it does not segfault

If we match a lightweight (non-annotated tag) as the name to
output and --long was requested we do not have a tag, nor do
we have a tagged object to display.  Instead we must use the
object we were passed as input for the long format display.

Reported-by: Mark Burton <markb@ordern.com>
Backtraced-by: Mikael Magnusson <mikachu@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit fetch-pack: do not complain about "no common commits" in an empty repo
Johannes Schindelin [Wed, 2 Jul 2008 17:06:56 +0000 (18:06 +0100)] 
git fetch-pack: do not complain about "no common commits" in an empty repo

If the repo is empty, it is obvious that there are no common commits
when fetching from _anywhere_.

So there is no use in saying it in that case, and it can even be
annoying.  Therefore suppress the message unilaterally if the repository
is empty prior to the fetch.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoDocumentation: Point to gitcli(7) from git(1)
Brian Gernhardt [Wed, 2 Jul 2008 14:13:35 +0000 (10:13 -0400)] 
Documentation: Point to gitcli(7) from git(1)

Signed-off-by: Brian Gernhardt <benji@silverinsanity.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoUpdate draft release notes for 1.6.0
Junio C Hamano [Wed, 2 Jul 2008 00:21:12 +0000 (17:21 -0700)] 
Update draft release notes for 1.6.0

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogitcli: Document meaning of --cached and --index
Nanako Shiraishi [Tue, 1 Jul 2008 14:02:40 +0000 (23:02 +0900)] 
gitcli: Document meaning of --cached and --index

We saw this explanation repeated on the mailing list a few times.  Even
though the description of individual options to particular commands are
explained in their manual pages, the reason behind choosing which is which
has not been clearly explained in any of the documentation.

Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoDocumentation formatting and cleanup
Jonathan Nieder [Mon, 30 Jun 2008 18:56:34 +0000 (13:56 -0500)] 
Documentation formatting and cleanup

Following what appears to be the predominant style, format
names of commands and commandlines both as `teletype text`.

While we're at it, add articles ("a" and "the") in some
places, italicize the name of the command in the manual page
synopsis line, and add a comma or two where it seems appropriate.

Signed-off-by: Jonathan Nieder <jrnieder@uchicago.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoDocumentation: be consistent about "git-" versus "git "
Jonathan Nieder [Mon, 30 Jun 2008 06:09:04 +0000 (01:09 -0500)] 
Documentation: be consistent about "git-" versus "git "

Since the git-* commands are not installed in $(bindir), using
"git-command <parameters>" in examples in the documentation is
not a good idea. On the other hand, it is nice to be able to
refer to each command using one hyphenated word. (There is no
escaping it, anyway: man page names cannot have spaces in them.)

This patch retains the dash in naming an operation, command,
program, process, or action. Complete command lines that can
be entered at a shell (i.e., without options omitted) are
made to use the dashless form.

The changes consist only of replacing some spaces with hyphens
and vice versa. After a "s/ /-/g", the unpatched and patched
versions are identical.

Signed-off-by: Jonathan Nieder <jrnieder@uchicago.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoDocumentation: prepare to be consistent about "git-" versus "git "
Jonathan Nieder [Mon, 30 Jun 2008 22:17:07 +0000 (17:17 -0500)] 
Documentation: prepare to be consistent about "git-" versus "git "

With the dashed forms of git commands not in $(bindir), we have
to change many instances of "git-command" to "git command". Also,
for consistency it is at times appropriate to make the opposite
change. In some cases, the change is not so simple as changing one
character.

This patch gets rid of some of those cases by rewrapping lines.

Signed-off-by: Jonathan Nieder <jrnieder@uchicago.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit-daemon(1): don't assume git-daemon is in /usr/bin
Jonathan Nieder [Mon, 30 Jun 2008 22:15:57 +0000 (17:15 -0500)] 
git-daemon(1): don't assume git-daemon is in /usr/bin

In the example inetd.conf lines in git-daemon(1), it was
assumed that `git-daemon` resides in the user's /usr/bin.
With this patch, we only assume `git` is in /usr/bin.

The stronger assumption fails in the default installation
nowadays.

Signed-off-by: Jonathan Nieder <jrnieder@uchicago.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoDocumentation: complicate example of "man git-command"
Jonathan Nieder [Mon, 30 Jun 2008 22:10:25 +0000 (17:10 -0500)] 
Documentation: complicate example of "man git-command"

The manual page for the command invoked as "git clone" is named
git-clone(1), and similarly for the rest of the git commands.
Make sure our first example of this in tutorials makes it clear
that it is the first two words of a command line that make up the
command's name (that is: for example, the effect of "git svn
dcommit" is described in git-svn(1)).

Signed-off-by: Jonathan Nieder <jrnieder@uchicago.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agowhitespace fix in Documentation/git-repack.txt
Jonathan Nieder [Mon, 30 Jun 2008 22:05:15 +0000 (17:05 -0500)] 
whitespace fix in Documentation/git-repack.txt

Change leading spaces to tabs to match the rest of the file.

Signed-off-by: Jonathan Nieder <jrnieder@uchicago.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoDocumentation: fix links to tutorials and other new manual pages
Jonathan Nieder [Mon, 30 Jun 2008 22:01:21 +0000 (17:01 -0500)] 
Documentation: fix links to tutorials and other new manual pages

With the conversion of HTML documentation to man pages

tutorial.html -> gittutorial (7)
tutorial-2.html -> gittutorial-2 (7)
cvs-migration.html -> gitcvs-migration (7)
diffcore.html -> gitdiffcore (7)
repository-layout.html -> gitrepository-layout (5)
hooks.html -> githooks (5)
glossary.html -> gitglossary (7)
core-tutorial.html -> gitcore-tutorial (7)

and the automatic update of references to these pages,
a little debris was left behind. We clear it away.

Signed-off-by: Jonathan Nieder <jrnieder@uchicago.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge maint in
Junio C Hamano [Wed, 2 Jul 2008 00:19:34 +0000 (17:19 -0700)] 
Merge maint in

15 years agoStart draft release notes for 1.5.6.2
Junio C Hamano [Wed, 2 Jul 2008 00:09:21 +0000 (17:09 -0700)] 
Start draft release notes for 1.5.6.2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoFix 'git show' on signed tag of signed tag of commit
Thomas Rast [Tue, 1 Jul 2008 09:47:04 +0000 (11:47 +0200)] 
Fix 'git show' on signed tag of signed tag of commit

The cmd_show loop resolves tags by showing them, then pointing the
object to the 'tagged' member.  However, this object is not fully
initialized; it only contains the SHA1.  (This resulted in a segfault
if there were two levels of tags.)  We apply parse_object to get a
full object.

Noticed by Kalle Olavi Niemitalo on IRC.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'ph/mergetool'
Junio C Hamano [Tue, 1 Jul 2008 23:22:42 +0000 (16:22 -0700)] 
Merge branch 'ph/mergetool'

* ph/mergetool:
  Remove the use of '--' in merge program invocation

15 years agoMerge branch 'js/apply-recount'
Junio C Hamano [Tue, 1 Jul 2008 23:22:39 +0000 (16:22 -0700)] 
Merge branch 'js/apply-recount'

* js/apply-recount:
  Allow git-apply to recount the lines in a hunk (AKA recountdiff)

15 years agoMerge branch 'jc/checkdiff'
Junio C Hamano [Tue, 1 Jul 2008 23:22:35 +0000 (16:22 -0700)] 
Merge branch 'jc/checkdiff'

* jc/checkdiff:
  Fix t4017-diff-retval for white-space from wc
  Update sample pre-commit hook to use "diff --check"
  diff --check: detect leftover conflict markers
  Teach "diff --check" about new blank lines at end
  checkdiff: pass diff_options to the callback
  check_and_emit_line(): rename and refactor
  diff --check: explain why we do not care whether old side is binary

15 years agoMerge branch 'kb/send-email-fifo'
Junio C Hamano [Tue, 1 Jul 2008 23:22:29 +0000 (16:22 -0700)] 
Merge branch 'kb/send-email-fifo'

* kb/send-email-fifo:
  git-send-email: Accept fifos as well as files

15 years agoMerge branch 'tr/send-email-ssl'
Junio C Hamano [Tue, 1 Jul 2008 23:22:25 +0000 (16:22 -0700)] 
Merge branch 'tr/send-email-ssl'

* tr/send-email-ssl:
  git-send-email: prevent undefined variable warnings if no encryption is set
  git-send-email: add support for TLS via Net::SMTP::SSL

15 years agoMerge branch 'js/maint-clone-insteadof'
Junio C Hamano [Tue, 1 Jul 2008 23:22:22 +0000 (16:22 -0700)] 
Merge branch 'js/maint-clone-insteadof'

* js/maint-clone-insteadof:
  clone: respect the settings in $HOME/.gitconfig and /etc/gitconfig
  clone: respect url.insteadOf setting in global configs

15 years agoMerge branch 'jc/maint-reset'
Junio C Hamano [Tue, 1 Jul 2008 23:22:19 +0000 (16:22 -0700)] 
Merge branch 'jc/maint-reset'

* jc/maint-reset:
  Allow "git-reset path" when unambiguous

15 years agoMerge branch 'jk/maint-fetch-ref-hier'
Junio C Hamano [Tue, 1 Jul 2008 23:22:14 +0000 (16:22 -0700)] 
Merge branch 'jk/maint-fetch-ref-hier'

* jk/maint-fetch-ref-hier:
  fetch: give a hint to the user when local refs fail to update
  fetch: report local storage errors in status table

15 years agoMerge branch 'dz/apply-again'
Junio C Hamano [Tue, 1 Jul 2008 23:22:10 +0000 (16:22 -0700)] 
Merge branch 'dz/apply-again'

* dz/apply-again:
  git-apply: handle a patch that touches the same path more than once better

15 years agoMerge branch 'np/pack-default'
Junio C Hamano [Tue, 1 Jul 2008 23:22:07 +0000 (16:22 -0700)] 
Merge branch 'np/pack-default'

* np/pack-default:
  pack.indexversion config option now defaults to 2
  repack.usedeltabaseoffset config option now defaults to "true"

15 years agoMerge branch 'jc/dashless' (early part)
Junio C Hamano [Tue, 1 Jul 2008 22:21:52 +0000 (15:21 -0700)] 
Merge branch 'jc/dashless' (early part)

* 'jc/dashless' (early part):
  Prepare execv_git_cmd() for removal of builtins from the filesystem
  git-shell: accept "git foo" form

15 years agoMerge branch 'nd/dashless'
Junio C Hamano [Tue, 1 Jul 2008 22:21:40 +0000 (15:21 -0700)] 
Merge branch 'nd/dashless'

* nd/dashless:
  Keep some git-* programs in $(bindir)
  Move all dashed-form commands to libexecdir

15 years agoMerge branch 'maint'
Junio C Hamano [Mon, 30 Jun 2008 07:44:19 +0000 (00:44 -0700)] 
Merge branch 'maint'

* maint:
  doc/rev-parse: clarify reflog vs --until for specifying revisions

15 years agoAdd test results directory to t/.gitignore
Brian Gernhardt [Sun, 29 Jun 2008 20:47:56 +0000 (16:47 -0400)] 
Add test results directory to t/.gitignore

We don't need test results to be committed if we're fixing a test.

Signed-off-by: Brian Gernhardt <benji@silverinsanity.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agofetch: give a hint to the user when local refs fail to update
Jeff King [Fri, 27 Jun 2008 04:01:41 +0000 (00:01 -0400)] 
fetch: give a hint to the user when local refs fail to update

There are basically two categories of update failures for
local refs:

  1. problems outside of git, like disk full, bad
     permissions, etc.

  2. D/F conflicts on tracking branch ref names

In either case, there should already have been an error
message. In case '1', hopefully enough information has
already been given that the user can fix it. In the case of
'2', we can hint that the user can clean up their tracking
branch area by using 'git remote prune'.

Note that we don't actually know _which_ case we have, so
the user will receive the hint in case 1, as well. In this
case the suggestion won't do any good, but hopefully the
user is smart enough to figure out that it's just a hint.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agodoc/rev-parse: clarify reflog vs --until for specifying revisions
Jeff King [Mon, 30 Jun 2008 03:27:45 +0000 (23:27 -0400)] 
doc/rev-parse: clarify reflog vs --until for specifying revisions

The rev-parse manpage introduces the branch@{date} syntax,
and mentions the reflog specifically. However, new users may
not be familiar with the distinction between the reflog and
the commit date, so let's help them out with a "you may be
interested in --until" pointer.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoUpdate draft release notes for 1.6.0
Junio C Hamano [Sun, 29 Jun 2008 20:34:26 +0000 (13:34 -0700)] 
Update draft release notes for 1.6.0

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoDocumentation: don't assume git-sh-setup and git-parse-remote are in PATH
jrnieder@uchicago.edu [Sun, 29 Jun 2008 16:10:20 +0000 (11:10 -0500)] 
Documentation: don't assume git-sh-setup and git-parse-remote are in PATH

When git-parse-remote and git-sh-setup are not installed in
$(bindir) anymore, the shell script library won't be found on
user's $PATH in general.

Signed-off-by: Jonathan Nieder <jrnieder@uchicago.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agot9700: skip when Test::More is not available
Junio C Hamano [Sun, 29 Jun 2008 20:21:42 +0000 (13:21 -0700)] 
t9700: skip when Test::More is not available

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoclone: respect the settings in $HOME/.gitconfig and /etc/gitconfig
Johannes Schindelin [Fri, 27 Jun 2008 12:55:23 +0000 (13:55 +0100)] 
clone: respect the settings in $HOME/.gitconfig and /etc/gitconfig

After initializing the config in the newly-created repository, we
need to unset GIT_CONFIG so that the global configs are read again.

Noticed by Pieter de Bie.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoFix t4017-diff-retval for white-space from wc
Brian Gernhardt [Sun, 29 Jun 2008 20:49:06 +0000 (16:49 -0400)] 
Fix t4017-diff-retval for white-space from wc

Signed-off-by: Brian Gernhardt <benji@silverinsanity.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'maint'
Junio C Hamano [Sun, 29 Jun 2008 04:08:35 +0000 (21:08 -0700)] 
Merge branch 'maint'

* maint:
  git-svn: don't sanitize remote names in config
  git-svn: avoid filling up the disk with temp files.
  git cat-file: Fix memory leak in batch mode
  fix git config example syntax
  avoid off-by-one error in run_upload_archive

15 years agogit-svn: don't sanitize remote names in config
Eric Wong [Sun, 29 Jun 2008 03:40:32 +0000 (20:40 -0700)] 
git-svn: don't sanitize remote names in config

The original sanitization code was just taken from the
remotes2config.sh shell script in contrib.

Credit to Avery Pennarun for noticing this mistake, and Junio
for clarifying the rules for config section names:

Junio C Hamano wrote in <7vfxr23s6m.fsf@gitster.siamese.dyndns.org>:

> In
>
>  [foo "bar"] baz = value
>
> foo and baz must be config.c::iskeychar() (and baz must be isalpha()), but
> "bar" can be almost anything.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoshow_stats(): fix stats width calculation
Olivier Marin [Fri, 27 Jun 2008 00:18:48 +0000 (02:18 +0200)] 
show_stats(): fix stats width calculation

Before this patch, name_width becomes negative or null for width values
less than 15 and name_width values greater than 25 (default: 50). This
leads to output random data.

This patch checks for minimal width and name_width values.

Signed-off-by: Olivier Marin <dkr@freesurf.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoDocumentation: remove {show,whatchanged}.difftree config options
Olivier Marin [Fri, 27 Jun 2008 00:17:55 +0000 (02:17 +0200)] 
Documentation: remove {show,whatchanged}.difftree config options

This removes, from the documentation and the bash completion script, the
two config options that were introduced by the git-whatchanged.sh script
and lost in the C rewrite. Today, we can use aliases as an alternative.

Signed-off-by: Olivier Marin <dkr@freesurf.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit-svn: avoid filling up the disk with temp files.
Avery Pennarun [Sat, 28 Jun 2008 23:33:56 +0000 (19:33 -0400)] 
git-svn: avoid filling up the disk with temp files.

Commit ffe256f9bac8a40ff751a9341a5869d98f72c285 ("git-svn: Speed up fetch")
introduced changes that create a temporary file for each object fetched by
svn.  These files should be deleted automatically, but perl apparently
doesn't do this until the process exits (or perhaps when its garbage
collector runs).

This means that on a large fetch, especially with lots of branches, we
sometimes fill up /tmp completely, which prevents the next temp file from
being written completely.  This is aggravated by the fact that a new temp
file is created for each updated file, even if that update produces a file
identical to one already in git.  Thus, it can happen even if there's lots
of disk space to store the finished repository.

We weren't adequately checking for write errors, so this would result in an
invalid file getting committed, which caused git-svn to fail later with an
invalid checksum.

This patch adds a check to syswrite() so similar problems don't lead to
corruption in the future.  It also unlink()'s each temp file explicitly
when we're done with it, so the disk doesn't need to fill up.

Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
Tested-by: Björn Steinbrink <B.Steinbrink@gmx.de>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit cat-file: Fix memory leak in batch mode
Björn Steinbrink [Sun, 29 Jun 2008 01:21:25 +0000 (03:21 +0200)] 
git cat-file: Fix memory leak in batch mode

When run in batch mode, git cat-file never frees the memory for the blob
contents it is printing. This quickly adds up and causes git-svn to be
hardly usable for imports of large svn repos, because it uses cat-file in
batch mode and cat-file's memory usage easily reaches several hundred MB
without any good reason.

Signed-off-by: Björn Steinbrink <B.Steinbrink@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit-send-email: prevent undefined variable warnings if no encryption is set
Thomas Rast [Thu, 26 Jun 2008 21:03:21 +0000 (23:03 +0200)] 
git-send-email: prevent undefined variable warnings if no encryption is set

With the previous patch, not configuring any encryption (either on or
off) would leave $smtp_encryption undefined.  We simply set it to the
empty string in that case.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agofix git config example syntax
Joey Hess [Sat, 28 Jun 2008 20:02:47 +0000 (16:02 -0400)] 
fix git config example syntax

git-config expects a space, not '=' between option and value.

Also, quote the value since it contains globs, which some shells will not
pass through unchanged, or will abort if the glob doesn't expand.

Signed-off-by: Joey Hess <joey@kitenet.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoavoid off-by-one error in run_upload_archive
Jochen Voss [Sat, 28 Jun 2008 16:04:24 +0000 (17:04 +0100)] 
avoid off-by-one error in run_upload_archive

Make sure that buf has enough space to store the trailing \0 of
the command line argument, too.

Signed-off-by: Jochen Voss <voss@seehuhn.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoGIT-VERSION-GEN: do not fail if a 'HEAD' file exists in the working copy
Lea Wiemann [Sat, 28 Jun 2008 17:13:29 +0000 (19:13 +0200)] 
GIT-VERSION-GEN: do not fail if a 'HEAD' file exists in the working copy

Signed-off-by: Lea Wiemann <LeWiemann@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoAllow git-apply to recount the lines in a hunk (AKA recountdiff)
Johannes Schindelin [Fri, 27 Jun 2008 17:43:09 +0000 (18:43 +0100)] 
Allow git-apply to recount the lines in a hunk (AKA recountdiff)

Sometimes, the easiest way to fix up a patch is to edit it directly, even
adding or deleting lines.  Now, many people are not as divine as certain
benevolent dictators as to update the hunk headers correctly at the first
try.

So teach the tool to do it for us.

[jc: with tests]

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agocommit-tree: lift completely arbitrary limit of 16 parents
Johannes Schindelin [Fri, 27 Jun 2008 12:24:47 +0000 (13:24 +0100)] 
commit-tree: lift completely arbitrary limit of 16 parents

There is no really good reason to have a merge with more than 16
parents, but we have a history of giving our users rope.

Combined with the fact that there was no good reason for that
arbitrary limit in the first place, here is an all-too-easy to fix.

Kind of wished-for by Len Brown.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoshrink git-shell by avoiding redundant dependencies
Dmitry Potapov [Fri, 27 Jun 2008 20:46:42 +0000 (00:46 +0400)] 
shrink git-shell by avoiding redundant dependencies

A lot of modules that have nothing to do with git-shell functionality
were linked in, bloating git-shell more than 8 times.

This patch cuts off redundant dependencies by:
1. providing stubs for three functions that make no sense for git-shell;
2. moving quote_path_fully from environment.c to quote.c to make the
   later self sufficient;
3. moving make_absolute_path into a new separate file.

The following numbers have been received with the default optimization
settings on master using GCC 4.1.2:

Before:
   text    data     bss     dec     hex filename
 143915    1348   93168  238431   3a35f git-shell

After:
   text    data     bss     dec     hex filename
  17670     788    8232   26690    6842 git-shell

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agohelp: check early if we have a command, if not try a documentation topic
Christian Couder [Sat, 28 Jun 2008 04:35:03 +0000 (06:35 +0200)] 
help: check early if we have a command, if not try a documentation topic

Before this patch, something like "git help tutorial" did not work,
people had to use "git help gittutorial" which is not very intuitive.

This patch uses the "is_git_command" function to test early if the
argument passed to "git help" is a git command, and if this is not the
case then we prefix the argument with "git" instead of "git-".

This way, things like "git help tutorial" or "git help glossary" will
work fine.

The little downside of this patch is that the "is_git_command" is a
little bit slow.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit-apply: handle a patch that touches the same path more than once better
Don Zickus [Fri, 27 Jun 2008 18:39:12 +0000 (14:39 -0400)] 
git-apply: handle a patch that touches the same path more than once better

When working with a lot of people who backport patches all day long, every
once in a while I get a patch that modifies the same file more than once
inside the same patch.  git-apply either fails if the second change relies
on the first change or silently drops the first change if the second change
is independent.

The silent part is the scary scenario for us.  Also this behaviour is
different from the patch-utils.

I have modified git-apply to create a table of the filenames of files it
modifies such that if a later patch chunk modifies a file in the table it
will buffer the previously changed file instead of reading the original file
from disk.

Logic has been put in to handle creations/deletions/renames/copies.  All the
relevant tests of git-apply succeed.

A new test has been added to cover the cases I addressed.

The fix is relatively straight-forward.

Signed-off-by: Don Zickus <dzickus@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agofetch: report local storage errors in status table
Jeff King [Fri, 27 Jun 2008 03:59:50 +0000 (23:59 -0400)] 
fetch: report local storage errors in status table

Previously, if there was an error while storing a local
tracking ref, the low-level functions would report an error,
but fetch's status output wouldn't indicate any problem.
E.g., imagine you have an old "refs/remotes/origin/foo/bar" but
upstream has deleted "foo/bar" in favor of a new branch
"foo". You would get output like this:

  error: there are still refs under 'refs/remotes/origin/foo'
  From $url_of_repo
   * [new branch]      foo        -> origin/foo

With this patch, the output takes into account the status of
updating the local ref:

  error: there are still refs under 'refs/remotes/origin/foo'
  From $url_of_repo
   ! [new branch]      foo        -> origin/foo  (unable to update local ref)

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoclone: respect url.insteadOf setting in global configs
Johannes Schindelin [Fri, 27 Jun 2008 12:56:05 +0000 (13:56 +0100)] 
clone: respect url.insteadOf setting in global configs

When we call "git clone" with a url that has a rewrite rule in either
$HOME/.gitconfig or /etc/gitconfig, the URL can be different from
what the command line expects it to be.

So, let's use the URL as the remote structure has it, not the literal
string from the command line.

Noticed by Pieter de Bie.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Acked-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoDocument the double-dash "rev -- path" disambiguator
Junio C Hamano [Thu, 26 Jun 2008 05:16:37 +0000 (22:16 -0700)] 
Document the double-dash "rev -- path" disambiguator

This is a very well established command line convention that old residents
of the git mailing list knew by heart and nobody even thought about
documenting it explicitly, which was not very nice.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoUpdate sample pre-commit hook to use "diff --check"
Junio C Hamano [Thu, 26 Jun 2008 23:08:05 +0000 (16:08 -0700)] 
Update sample pre-commit hook to use "diff --check"

Now "diff --check" can detect not just whitespace errors but also notices
leftover conflict marker lines, we can use it in the sample pre-commit
hook script.

These days the object layer knows about the empty tree object without
actually having one in the repository, so we can run the test even for the
initial commit.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agodiff --check: detect leftover conflict markers
Junio C Hamano [Thu, 26 Jun 2008 22:37:21 +0000 (15:37 -0700)] 
diff --check: detect leftover conflict markers

This teaches "diff --check" to detect and complain if the change
adds lines that look like leftover conflict markers.

We should be able to remove the old Perl script used in the sample
pre-commit hook and modernize the script with this facility.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoTeach "diff --check" about new blank lines at end
Junio C Hamano [Thu, 26 Jun 2008 22:36:59 +0000 (15:36 -0700)] 
Teach "diff --check" about new blank lines at end

When a patch adds new blank lines at the end, "git apply --whitespace"
warns.  This teaches "diff --check" to do the same.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agocheckdiff: pass diff_options to the callback
Junio C Hamano [Thu, 26 Jun 2008 22:36:34 +0000 (15:36 -0700)] 
checkdiff: pass diff_options to the callback

This way, we could later use more information from the diff_options.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoDon't use dash commands (git-foo) in tutorial-2
Ted Percival [Thu, 26 Jun 2008 13:22:19 +0000 (23:22 +1000)] 
Don't use dash commands (git-foo) in tutorial-2

Signed-off-by: Ted Percival <ted@midg3t.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agotest-lib.sh: show git init output when in verbose mode
Lea Wiemann [Thu, 26 Jun 2008 18:35:19 +0000 (20:35 +0200)] 
test-lib.sh: show git init output when in verbose mode

Signed-off-by: Lea Wiemann <LeWiemann@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agocheck_and_emit_line(): rename and refactor
Junio C Hamano [Thu, 26 Jun 2008 22:35:21 +0000 (15:35 -0700)] 
check_and_emit_line(): rename and refactor

The function name was too bland and not explicit enough as to what it is
checking.  Split it into two, and call the one that checks if there is a
whitespace breakage "ws_check()", and call the other one that checks and
emits the line after color coding "ws_check_emit()".

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agodiff --check: explain why we do not care whether old side is binary
Junio C Hamano [Thu, 26 Jun 2008 22:34:54 +0000 (15:34 -0700)] 
diff --check: explain why we do not care whether old side is binary

All other codepaths refrain from running textual diff when either the old
or the new side is binary, but this function only checks the new side.  I
was almost going to change it to check both, but that would be a bad
change.  Explain why to prevent future mistakes.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'maint'
Junio C Hamano [Fri, 27 Jun 2008 01:12:47 +0000 (18:12 -0700)] 
Merge branch 'maint'

* maint:
  GIT 1.5.5.5
  GIT 1.5.4.6
  git-shell: accept "git foo" form
  diff --check: do not discard error status upon seeing a good line

15 years agoMerge branch 'maint-1.5.5' into maint
Junio C Hamano [Fri, 27 Jun 2008 01:08:51 +0000 (18:08 -0700)] 
Merge branch 'maint-1.5.5' into maint

* maint-1.5.5:
  GIT 1.5.5.5
  GIT 1.5.4.6
  git-shell: accept "git foo" form

Conflicts:

GIT-VERSION-GEN
RelNotes

15 years agoGIT 1.5.5.5 v1.5.5.5
Junio C Hamano [Fri, 27 Jun 2008 00:16:50 +0000 (17:16 -0700)] 
GIT 1.5.5.5

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'maint-1.5.4' into maint-1.5.5
Junio C Hamano [Fri, 27 Jun 2008 00:14:03 +0000 (17:14 -0700)] 
Merge branch 'maint-1.5.4' into maint-1.5.5

* maint-1.5.4:
  GIT 1.5.4.6
  git-shell: accept "git foo" form

Conflicts:

GIT-VERSION-GEN
RelNotes

15 years agoGIT 1.5.4.6 v1.5.4.6
Junio C Hamano [Fri, 27 Jun 2008 00:11:21 +0000 (17:11 -0700)] 
GIT 1.5.4.6

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit-shell: accept "git foo" form
Junio C Hamano [Sun, 2 Dec 2007 06:16:19 +0000 (22:16 -0800)] 
git-shell: accept "git foo" form

This is a backport of 0a47dc110e042b5bcc63dc94c8d517e67efe9306
to 'maint' to be included in 1.5.6.2 so that older server side
can accept dashless form of request when clients are updated.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agodiff --check: do not discard error status upon seeing a good line
Junio C Hamano [Thu, 26 Jun 2008 20:16:33 +0000 (13:16 -0700)] 
diff --check: do not discard error status upon seeing a good line

"git diff --check" should return non-zero when there was any whitespace
error but the code only paid attention to the error status of the last
new line in the patch.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoimprove for-each-ref test script
Jeff King [Thu, 26 Jun 2008 08:08:41 +0000 (04:08 -0400)] 
improve for-each-ref test script

Previously, we did a sanity check by doing for-each-ref
using each possible format atom. However, we never checked
the actual output produced by that atom, which recently let
an obvious bug go undetected for some time.

While we're at it, also clean up a few '!' into
test_must_fail.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoAdd 'git-p4.allowSubmit' to git-p4
Jing Xue [Sun, 22 Jun 2008 18:12:39 +0000 (14:12 -0400)] 
Add 'git-p4.allowSubmit' to git-p4

I'm working with a perforce repo using git-p4. There are some config
files which I need to change locally according to my environment. I'm
using a 'local' git branch to park these changes. And I want to avoid
accidentally checking them into p4 just by doing "git p4 submit"
mindlessly without realizing which branch I'm actually on.

This patch adds a new git config, 'git-p4.allowSubmit', which is a
whitelist of branch names. "git p4 submit" will only allow submissions
from local branches on the list. Useful for preventing inadvertently
submitting from a strictly local branch.

For backward compatibility, if this config is not set at all,
submissions from all branches are allowed.

Signed-off-by: Jing Xue <jingxue@digizenstudio.com>
Acked-By: Simon Hausmann <simon@lst.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoStart draft release notes for 1.6.0
Junio C Hamano [Thu, 26 Jun 2008 07:13:37 +0000 (00:13 -0700)] 
Start draft release notes for 1.6.0

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agocompat/pread.c: Add a forward declaration to fix a warning
Steffen Prohaska [Sat, 17 Nov 2007 19:48:14 +0000 (20:48 +0100)] 
compat/pread.c: Add a forward declaration to fix a warning

read_in_full()'s is used in compat/pread.c.  read_in_full() is
declared in cache.h. But we can't include cache.h because too
many macros are defined there.  Using read_in_full() without
including cache.h is dangerous because we wouldn't recognize if
its prototyp changed.  gcc issues a warning about that.

This commit adds a forward declaration to git-compat-util.h.
git-compat-util.h is included by compat/pread.c _and_ cache.h.
Hence, changes in cache.h would be detected.

Signed-off-by: Steffen Prohaska <prohaska@zib.de>
Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
15 years agoWindows: Fix ntohl() related warnings about printf formatting
Steffen Prohaska [Sat, 17 Nov 2007 18:16:53 +0000 (19:16 +0100)] 
Windows: Fix ntohl() related warnings about printf formatting

On Windows, ntohl() returns unsigned long.  On Unix it returns
uint32_t.  This makes choosing a suitable printf format string
hard.

This commit introduces a mingw specific helper function
git_ntohl() that casts to unsigned int before returning.  This
makes gcc's printf format check happy.  It should be safe because
we expect ntohl to use 32-bit numbers.

Signed-off-by: Steffen Prohaska <prohaska@zib.de>
Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
15 years agoWindows: TMP and TEMP environment variables specify a temporary directory.
Johannes Sixt [Sun, 22 Jun 2008 09:35:21 +0000 (11:35 +0200)] 
Windows: TMP and TEMP environment variables specify a temporary directory.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
15 years agoWindows: Make 'git help -a' work.
Johannes Sixt [Mon, 14 Jan 2008 13:05:33 +0000 (14:05 +0100)] 
Windows: Make 'git help -a' work.

git help -a scans the PATH for git commands. On Windows it failed for two
reasons:

- The PATH separator is ';', not ':' on Windows.

- stat() does not set the executable bit.

We now open the file and guess whether it is executable.

The result of the guess is good enough for the list of git commands, but
it is of no use for a general stat() implementation because (1) it is a
guess, (2) the user has no way to influence the outcome (via chmod or
similar), and (3) it would reduce stat() performance by an unacceptable
amount. Therefore, this strategy is a special-case local to help.c.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
15 years agoWindows: Work around an oddity when a pipe with no reader is written to.
Johannes Sixt [Fri, 17 Aug 2007 16:40:36 +0000 (18:40 +0200)] 
Windows: Work around an oddity when a pipe with no reader is written to.

On Windows, write() is implemented using WriteFile(). After the reader
closed its end of the pipe, the first WriteFile() returns
ERROR_BROKEN_PIPE (which translates to EPIPE), subsequent WriteFile()s
return ERROR_NO_DATA, which is translated to EINVAL.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
15 years agoWindows: Make the pager work.
Johannes Sixt [Sat, 8 Dec 2007 20:28:41 +0000 (21:28 +0100)] 
Windows: Make the pager work.

Since we have neither fork() nor exec(), we have to spawn the pager and
feed it with the program's output.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
15 years agoWhen installing, be prepared that template_dir may be relative.
Johannes Sixt [Tue, 1 Jan 2008 21:15:21 +0000 (22:15 +0100)] 
When installing, be prepared that template_dir may be relative.

Since the Makefile in the template/ subdirectory is only used to install
the templates, we do not simply pass down the setting of template_dir
when it is relative, but construct the intended destination in a new
variable: A relative template_dir is relative to gitexecdir.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
15 years agoWindows: Use a relative default template_dir and ETC_GITCONFIG
Johannes Sixt [Fri, 30 Nov 2007 21:28:38 +0000 (22:28 +0100)] 
Windows: Use a relative default template_dir and ETC_GITCONFIG

With this definition the templates and system config file will be found
irrespective of the installation location.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
15 years agoWindows: Compute the fallback for exec_path from the program invocation.
Johannes Sixt [Wed, 11 Apr 2007 14:02:45 +0000 (16:02 +0200)] 
Windows: Compute the fallback for exec_path from the program invocation.

Since on Windows the user is fairly free where to install programs, we
cannot rely on a hard-coded path. We use the program name to derive the
installation directory and use that as exec_path.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
15 years agoTurn builtin_exec_path into a function.
Johannes Sixt [Wed, 11 Apr 2007 13:26:08 +0000 (15:26 +0200)] 
Turn builtin_exec_path into a function.

builtin_exec_path returns the hard-coded installation path, which is used
as the ultimate fallback to look for git commands. Making it into a function
enables us in a follow-up patch to return a computed value instead of just
a constant string.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
15 years agoWindows: Use a customized struct stat that also has the st_blocks member.
Johannes Sixt [Mon, 12 Nov 2007 11:52:41 +0000 (12:52 +0100)] 
Windows: Use a customized struct stat that also has the st_blocks member.

Windows's struct stat does not have a st_blocks member. Since we already
have our own stat/lstat/fstat implementations, we can just as well use
a customized struct stat. This patch introduces just that, and also fills
in the st_blocks member. On the other hand, we don't provide members that
are never used.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
15 years agoWindows: Add a custom implementation for utime().
Johannes Sixt [Fri, 7 Sep 2007 11:05:00 +0000 (13:05 +0200)] 
Windows: Add a custom implementation for utime().

This is a necessary pendant to our lstat implementation: MSVCRT's
implementations of lstat and utime do some adjustments if daylight
saving time is in effect, but our lstat implementation doesn't do these
adjustments and report the correct UTC time.  With this implementation
we omit the adjustments in utime() as well and always write UTC.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
15 years agoWindows: Add a new lstat and fstat implementation based on Win32 API.
Marius Storm-Olsen [Mon, 3 Sep 2007 18:40:26 +0000 (20:40 +0200)] 
Windows: Add a new lstat and fstat implementation based on Win32 API.

This gives us a significant speedup when adding, committing and stat'ing files.
Also, since Windows doesn't really handle symlinks, we let stat just uses lstat.
We also need to replace fstat, since our implementation and the standard stat()
functions report slightly different timestamps, possibly due to timezones.

We simply report UTC in our implementation, and do our FILETIME to time_t
conversion based on the document at http://support.microsoft.com/kb/167296.

With Moe's repo structure (100K files in 100 dirs, containing 2-4 bytes)
    mkdir bummer && cd bummer; for ((i=0;i<100;i++)); do
      mkdir $i && pushd $i;
        for ((j=0;j<1000;j++)); do echo "$j" >$j; done;
      popd;
    done

We get the following performance boost:

    With normal lstat & stat  Custom lstat/fstat
    ------------------------  ------------------------
    Command: git init         Command: git init
    ------------------------  ------------------------
    real    0m 0.047s          real   0m 0.063s
    user    0m 0.031s          user   0m 0.015s
    sys     0m 0.000s          sys    0m 0.015s
    ------------------------  ------------------------
    Command: git add .        Command: git add .
    ------------------------  ------------------------
    real    0m19.390s         real    0m12.031s       1.6x
    user    0m 0.015s         user    0m 0.031s
    sys     0m 0.030s         sys     0m 0.000s
    ------------------------  ------------------------
    Command: git commit -a..  Command: git commit -a..
    ------------------------  ------------------------
    real    0m30.812s         real    0m16.875s       1.8x
    user    0m 0.015s         user    0m 0.015s
    sys     0m 0.000s         sys     0m 0.015s
    ------------------------  ------------------------
    3x Command: git-status    3x Command: git-status
    ------------------------  ------------------------
    real    0m11.860s         real    0m 5.266s       2.2x
    user    0m 0.015s         user    0m 0.015s
    sys     0m 0.015s         sys     0m 0.015s

    real    0m11.703s         real    0m 5.234s
    user    0m 0.015s         user    0m 0.015s
    sys     0m 0.000s         sys     0m 0.000s

    real    0m11.672s         real    0m 5.250s
    user    0m 0.031s         user    0m 0.015s
    sys     0m 0.000s         sys     0m 0.000s
    ------------------------  ------------------------
    Command: git commit...    Command: git commit...
    (single file)             (single file)
    ------------------------  ------------------------
    real    0m14.234s         real    0m 7.735s       1.8x
    user    0m 0.015s         user    0m 0.031s
    sys     0m 0.000s         sys     0m 0.000s

Signed-off-by: Marius Storm-Olsen <mstormo_git@storm-olsen.com>
Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
15 years agoWindows: Implement a custom spawnve().
Johannes Sixt [Sat, 24 Nov 2007 21:49:16 +0000 (22:49 +0100)] 
Windows: Implement a custom spawnve().

The problem with Windows's own implementation is that it tries to be
clever when a console program is invoked from a GUI application: In this
case it sometimes automatically allocates a new console window. As a
consequence, the IO channels of the spawned program are directed to the
console, but the invoking application listens on channels that are now
directed to nowhere.

In this implementation we use the lowlevel facilities of CreateProcess(),
which offers a flag to tell the system not to open a console. As a side
effect, only stdin, stdout, and stderr channels will be accessible from
C programs that are spawned. Other channels (file handles, pipe handles,
etc.) are still inherited by the spawned program, but it doesn't get
enough information to access them.

Johannes Schindelin integrated path quoting and unified the various
*execv* and *spawnv* helpers. Eric Raible suggested to also quote '{'.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
15 years agoWindows: Implement wrappers for gethostbyname(), socket(), and connect().
Johannes Sixt [Wed, 26 Dec 2007 12:51:18 +0000 (13:51 +0100)] 
Windows: Implement wrappers for gethostbyname(), socket(), and connect().

gethostbyname() is the first function that calls into the Winsock library,
and it is wrapped only to initialize the library.

socket() is wrapped for two reasons:
- Windows's socket() creates things that are like low-level file handles,
  and they must be converted into file descriptors first.
- And these handles cannot be used with plain ReadFile()/WriteFile()
  because they are opened for "overlapped IO". We have to use WSASocket()
  to create non-overlapped IO sockets.

connect() must be wrapped because Windows's connect() expects the low-level
sockets, not file descriptors, and we must first unwrap the file descriptor
before we can pass it on to Windows's connect().

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
15 years agoWindows: Work around incompatible sort and find.
Johannes Sixt [Fri, 30 Nov 2007 21:06:30 +0000 (22:06 +0100)] 
Windows: Work around incompatible sort and find.

If the PATH lists the Windows system directories before the MSYS
directories, Windows's own incompatible sort and find commands would be
picked up. We implement these commands as functions and call the real
tools by absolute path.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
15 years agoWindows: Implement asynchronous functions as threads.
Johannes Sixt [Sat, 8 Dec 2007 21:19:14 +0000 (22:19 +0100)] 
Windows: Implement asynchronous functions as threads.

In upload-pack we must explicitly close the output channel of rev-list.
(On Unix, the channel is closed automatically because process that runs
rev-list terminates.)

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
15 years agoWindows: Disambiguate DOS style paths from SSH URLs.
Johannes Sixt [Fri, 30 Nov 2007 21:51:10 +0000 (22:51 +0100)] 
Windows: Disambiguate DOS style paths from SSH URLs.

If on Windows a path is specified as C:/path, then this is also a valid
SSH URL. To disambiguate between the two interpretations we take an URL
that looks like a path with a drive letter as a local URL.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
15 years agoWindows: A rudimentary poll() emulation.
Johannes Sixt [Sat, 1 Dec 2007 21:00:56 +0000 (22:00 +0100)] 
Windows: A rudimentary poll() emulation.

This emulation of poll() is by far not general. It assumes that the
fds that are to be waited for are connected to pipes. The pipes are
polled in a loop until data becomes available in at least one of them.
If only a single fd is waited for, the implementation actually does
not wait at all, but assumes that a subsequent read() will block.

In order not to needlessly burn CPU time, the CPU is yielded to other
processes before the next round in the poll loop using Sleep(0). Note that
any sleep timeout greater than zero will reduce the efficiency by a
magnitude.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
15 years agoupdate-hook-example: optionally allow non-fast-forward
Dmitry Potapov [Wed, 25 Jun 2008 23:14:31 +0000 (03:14 +0400)] 
update-hook-example: optionally allow non-fast-forward

Sometimes it is desirable to have non-fast-forward branches in a
shared repository. A typical example of that is the 'pu' branch.
This patch extends the format of allowed-users and allow-groups
files by using the '+' sign at the beginning as the mark that
non-fast-forward pushes are permitted to the branch.

Signed-off-by: Dmitry Potapov <dpotapov@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit-send-email: add support for TLS via Net::SMTP::SSL
Thomas Rast [Wed, 25 Jun 2008 19:42:43 +0000 (21:42 +0200)] 
git-send-email: add support for TLS via Net::SMTP::SSL

We do this by handing over the Net::SMTP instance to Net::SMTP::SSL,
which avoids Net::SMTP::TLS and its weird error checking.  This trick
is due to Brian Evins.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>