Commit Graph

21160 Commits

Author SHA1 Message Date
Thorvald Natvig
ccc5cdf764 Replace dir separator in symlinks
It seems quite a few windows utilities cannot handle '../' in symlinks, so
we replace every / with a \.

While at it, replace make_backslash_path with a thread-safe version.

Signed-off-by: Thorvald Natvig <slicer@users.sourceforge.net>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2009-10-27 01:07:23 +01:00
Johannes Schindelin
cd4896c3b6 Avoid TAGS/tags warning from GNU Make
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2009-10-22 19:04:17 +02:00
Junio C Hamano
8ed9ebe27a CRLF in info/grafts causes parse error
"Yann Dirson" <ydirson@linagora.com> writes:

> When creating an info/grafts under windows, one typically gets a CRLF file.
> Then:
>
> * gitk loudly complains about "bad graft data"
> * "git log > /dev/null" does not report any problem
> * "git log > foo" does report the problem on sdterr, but exit code is still 0
>
> Recreating the graft as a LF file (eg with "echo" or "printf") causes the
> graft to be properly interpreted.

I do not see any reason to forbid trailing CR at the end of the line (for
that matter, any trailing whitespaces) in the said file.

How about doing this?

 commit.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
2009-10-22 18:55:06 +02:00
Johannes Schindelin
127aa63757 git am: accept patches downloaded from GMane
GMane has this wonderful feature that you can download the raw mails,
but the mails do not fully conform to the mbox format, as they do not
start with a "From ..." line.

But they start with another tell tale we can easily detect.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2009-10-22 18:42:14 +02:00
Johannes Schindelin
194f0a1b47 Merge commit 'v1.6.5.1' into devel 2009-10-18 18:07:07 +02:00
Johannes Schindelin
2bc8c34d84 Merge commit 'origin/devel' into devel 2009-10-18 17:48:58 +02:00
Frank Li
62d2d6829c mingw.c: Use the O_BINARY flag to open files
On Windows, non-text files must be opened using the O_BINARY flag.
MinGW does this for us automatically, but Microsoft Visual C++
does not.  So let's be explicit.

Signed-off-by: Frank Li <lznuaa@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2009-10-18 17:48:42 +02:00
Frank Li
c124c96792 Define SNPRINTF_SIZE_CORR=1 for Microsoft Visual C++
The Microsoft C runtime's vsnprintf function does not add NUL at
the end of the buffer.

Further, Microsoft deprecated vsnprintf in favor of _vsnprintf, so
add a #define to that end.

Signed-off-by: Frank Li <lznuaa@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2009-10-18 17:47:40 +02:00
Johannes Schindelin
a2546af668 MinGW means that we have gcc, so we can add gcc-specific compiler options
These were suggested by Junio at some stage.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2009-10-18 17:46:13 +02:00
Johannes Schindelin
12b6e8cb65 compat/mingw.c: Fix declaration after instruction
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2009-10-18 17:46:12 +02:00
Johannes Schindelin
91b2237325 Fix a few old-style function declarations in compat/
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2009-10-18 17:46:11 +02:00
Johan 't Hart
f95b4f00a6 Windows: mark newly-created dot files by fopen() as hidden
Files starting with a dot are considered "hidden", i.e. you have to ask
explicitely to see them.  On Windows, this is not done automatically, as
Windows has its own mechanism.

We already mark dot directories created by mkdir() and dot files created
by open() as hidden, so let's do that with fopen(), too (but only if the
file was just created, not when it already exists).

Naturally, we make this behavior optional on core.hideDotFiles.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Acked-by: Johannes Sixt <j6t@kdbg.org>
2009-10-18 17:43:10 +02:00
Johannes Schindelin
5cdb2faf0e Windows: mark newly-created files whose name starts with a dot as hidden
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Acked-by: Johannes Sixt <j6t@kdbg.org>
2009-10-18 17:43:09 +02:00
Johannes Schindelin
c1b3bedfac Document the core.hideDotFiles variable
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Acked-by: Johannes Sixt <j6t@kdbg.org>
2009-10-18 17:42:32 +02:00
Johan 't Hart
250c0f4ea5 Make auto-hiding dot-files optional on Windows.
Although a file starting with a dot usually ought to be hidden,
there could be reasons users do not want it to happen automatically.

Original patch by Erik Faye-Lund.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Acked-by: Johannes Sixt <j6t@kdbg.org>
2009-10-18 17:42:31 +02:00
Johan 't Hart
33dc23c8d1 On Windows, mark directory hidden when starting with dot.
In Windows a file or directory starting with a dot is not
automatically hidden. So lets mark it as hidden when
such a directory is created.

This fixes msysGit issue 288.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Acked-by: Johannes Sixt <j6t@kdbg.org>
2009-10-18 17:42:29 +02:00
Johannes Schindelin
e8a0ecc3ac Fix style of multi-line comments
In git.git, we want multi-line comments between single /* and */
in a line.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2009-10-18 17:42:28 +02:00
Thorvald Natvig
043a43e7ec Symlink support
Add symlink support; with UAC, you may need administrator's privileges
to create symlinks, but you can at least read them.

As reparse points on Windows differentiate between file and directory
links, we just assume that file links are meant for the time being;
it might be very hard to determine the type before the target exists,
but it is thinkable to change the type on-the-fly.

A bridge to cross when we arrive there (read: something for somebody
to fix who actually has that problem).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2009-10-18 17:41:18 +02:00
Johannes Schindelin
ae3bedd5cd Skip tests requiring 'iconv' when that is not found
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2009-10-18 17:41:16 +02:00
Erik Faye-Lund
35f39b14ea send-email: accept absolute path even on Windows
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2009-10-18 17:41:15 +02:00
Johannes Schindelin
b7d572cbf2 Handle http.* config variables pointing to files gracefully on Windows
On Windows, we would like to be able to have a default http.sslCAinfo
that points to an MSys path (i.e. relative to the installation root of
Git).  As Git is a MinGW program, it has to handle the conversion
of the MSys path into a MinGW32 path itself.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2009-10-18 17:41:14 +02:00
Junio C Hamano
b142da2a5d GIT 1.6.5.1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
v1.6.5.1
2009-10-16 23:57:19 -07:00
Junio C Hamano
050dfc4535 Merge branch 'maint-1.6.4' into maint
* maint-1.6.4:
  grep: do not segfault when -f is used
2009-10-16 23:47:58 -07:00
Matt Kraai
cfe370c647 grep: do not segfault when -f is used
"git grep" would segfault if its -f option was used because it would
try to use an uninitialized strbuf, so initialize the strbuf.

Thanks to Johannes Sixt <j.sixt@viscovery.net> for the help with the
test cases.

Signed-off-by: Matt Kraai <kraai@ftbfs.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-10-16 23:47:47 -07:00
Shawn O. Pearce
b3118bdc91 sha1_file: Fix infinite loop when pack is corrupted
Some types of corruption to a pack may confuse the deflate stream
which stores an object.  In Andy's reported case a 36 byte region
of the pack was overwritten, leading to what appeared to be a valid
deflate stream that was trying to produce a result larger than our
allocated output buffer could accept.

Z_BUF_ERROR is returned from inflate() if either the input buffer
needs more input bytes, or the output buffer has run out of space.
Previously we only considered the former case, as it meant we needed
to move the stream's input buffer to the next window in the pack.

We now abort the loop if inflate() returns Z_BUF_ERROR without
consuming the entire input buffer it was given, or has filled
the entire output buffer but has not yet returned Z_STREAM_END.
Either state is a clear indicator that this loop is not working
as expected, and should not continue.

This problem cannot occur with loose objects as we open the entire
loose object as a single buffer and treat Z_BUF_ERROR as an error.

Reported-by: Andy Isaacson <adi@hexapodia.org>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Acked-by: Nicolas Pitre <nico@fluxnic.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-10-14 13:39:37 -07:00
Nicolas Pitre
583371af1f change throughput display units with fast links
Switch to MiB/s when the connection is fast enough (i.e. on a LAN).

Signed-off-by: Nicolas Pitre <nico@fluxnic.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-10-14 01:19:29 -07:00
Björn Steinbrink
d01a8e32fe clone: Supply the right commit hash to post-checkout when -b is used
When we use -b <branch>, we may checkout something else than what the
remote's HEAD references, but we still used remote_head to supply the
new ref value to the post-checkout hook, which is wrong.

So instead of using remote_head to find the value to be passed to the
post-checkout hook, we have to use our_head_points_at, which is always
correctly setup, even if -b is not used.

This also fixes a segfault when "clone -b <branch>" is used with a
remote repo that doesn't have a valid HEAD, as in such a case
remote_head is NULL, but we still tried to access it.

Reported-by: Devin Cofer <ranguvar@archlinux.us>
Signed-off-by: Björn Steinbrink <B.Steinbrink@gmx.de>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-10-14 01:19:15 -07:00
Johannes Sixt
c6dfb39944 remote-curl: add missing initialization of argv0_path
All programs, in particular also the stand-alone programs (non-builtins)
must call git_extract_argv0_path(argv[0]) in order to help builds that
derive the installation prefix at runtime, such as the MinGW build.
Without this call, the program segfaults (or raises an assertion
failure).

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Tested-by: Michael Wookey <michaelwookey@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-10-13 23:24:58 -07:00
Junio C Hamano
6ff9ae9f97 Merge branch 'maint-1.6.4' into maint
* maint-1.6.4:
  git-stash documentation: mention default options for 'list'
2009-10-13 01:01:04 -07:00
Miklos Vajna
0a0c342568 git-stash documentation: mention default options for 'list'
Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-10-12 16:16:36 -07:00
Johannes Sixt
c71fac52e4 Merge branch 'master' of git://repo.or.cz/alt-git 2009-10-12 08:15:31 +02:00
Junio C Hamano
78d553b7d7 GIT 1.6.5
Signed-off-by: Junio C Hamano <gitster@pobox.com>
v1.6.5
2009-10-10 00:05:19 -07:00
Simon Arlott
85886162f1 git-svn: hide find_parent_branch output in double quiet mode
Hide find_parent_branch logging when -qq is specified.
This eliminates more unnecessary output when run from cron, e.g.:

Found possible branch point:
http://undernet-ircu.svn.sourceforge.net/svnroot/undernet-ircu/ircu2/trunk =>
http://undernet-ircu.svn.sourceforge.net/svnroot/undernet-ircu/ircu2/branches/authz,
1919
Found branch parent: (authz) ea061d76aea985dc0208d36fa5e0b2249b698557
Following parent with do_switch
Successfully followed parent

Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Simon Arlott <simon@fire.lp0.eu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-10-10 00:00:40 -07:00
Jonathan Nieder
33405be34b Documentation: clone: clarify discussion of initial branch
When saying the initial branch is equal to the currently active
remote branch, it is probably intended that the branch heads
point to the same commit.  Maybe it would be more useful to a
new user to emphasize that the tree contents and history are the
same.

More important, probably, is that this new branch is set up so
that "git pull" merges changes from the corresponding remote
branch.  The next paragraph addresses that directly.  What the
reader needs to know to begin with is that (1) the initial branch
is your own; if you do not pull, it won't get updated, and that
(2) the initial branch starts out at the same commit as the
upstream.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-10-09 17:21:46 -07:00
Junio C Hamano
a17a9606e4 Merge branch 'rs/maint-archive-prefix'
* rs/maint-archive-prefix:
  Git archive and trailing "/" in prefix
2009-10-09 16:27:16 -07:00
Junio C Hamano
e12bfd86c1 Merge branch 'fc/mutt-alias'
* fc/mutt-alias:
  send-email: fix mutt regex for grouped aliases
2009-10-09 16:26:49 -07:00
Junio C Hamano
c2c865684b Merge branch 'ef/msvc-noreturn'
* ef/msvc-noreturn:
  add NORETURN_PTR for function pointers
  increase portability of NORETURN declarations
2009-10-09 16:26:35 -07:00
Junio C Hamano
302e99b79a Merge branch 'jk/reflog-date'
* jk/reflog-date:
  improve reflog date/number heuristic
2009-10-09 16:26:11 -07:00
Junio C Hamano
170a4814d3 Merge branch 'ch/am-header'
* ch/am-header:
  git-am: force egrep to use correct characters set
  git-am: fixed patch_format detection according to RFC2822
2009-10-09 16:25:40 -07:00
Björn Gustavsson
e1c1a0674b bash: add support for 'git replace'
Signed-off-by: Björn Gustavsson <bgustavsson@gmail.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-10-09 15:36:41 -07:00
Stephen Boyd
e0d7805954 completion: fix alias listings with newlines
Aliases with newlines have been a problem since commit 56fc25f (Bash
completion support for remotes in .git/config., 2006-11-05). The chance
of the problem occurring has been slim at best, until commit 518ef8f
(completion: Replace config --list with --get-regexp, 2009-09-11)
removed the case statement introduced by commit 56fc25f. Before removing
the case statement, most aliases with newlines would work unless they
were specially crafted as follows

[alias]
	foo = "log -1 --pretty='format:%s\nalias.error=broken'"

After removing the case statement, a more benign alias like

[alias]
	whowhat = "log -1 --pretty='format:%an <%ae>\n%s'"
	wont-complete = ...

would cause the completion to break badly.

For now, revert the removal of the case statement until someone comes up
with a better way to get keys from git-config.

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-10-09 15:00:40 -07:00
Stephen Boyd
427e586b19 completion: fix completion of git <TAB><TAB>
After commit 511a3fc (wrap git's main usage string., 2009-09-12), the
bash completion for git commands includes COMMAND and [ARGS] when it
shouldn't. Fix this by grepping more strictly for a line with git
commands. It's doubtful whether git will ever have commands starting
with anything besides numbers and letters so this should be fine. At
least by being stricter we'll know when we break the completion earlier.

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-10-09 15:00:24 -07:00
Ingmar Vanhassel
b6aaaa4470 import-tars: Add missing closing bracket
This fixes an obvious syntax error that snuck in commit 7e787953:

  syntax error at /home/ingmar/bin//git-import-tars line 143, near "/^$/ { "
  syntax error at /home/ingmar/bin//git-import-tars line 145, near "} else"
  syntax error at /home/ingmar/bin//git-import-tars line 152, near "}"

Signed-off-by: Ingmar Vanhassel <ingmar@exherbo.org>
Acked-and-Tested-by: Peter Krefting <peter@softwolves.pp.se>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-10-09 14:58:13 -07:00
Jonathan Nieder
989c530e7f racy-git.txt: explain nsec problem in more detail
Idealists may want USE_NSEC to be the default on Linux some day.
Point to a patch to better explain the requirements on
filesystem code for that to happen.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-10-09 14:56:32 -07:00
Jonathan Nieder
580cbb58a2 Documentation: clarify "working tree" definition
It is not necessarily obvious to a git novice what it means for a
filesystem tree to be equal to the HEAD.  Spell it out.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-10-09 14:54:55 -07:00
Jonathan Nieder
bb35f35e67 Documentation: clarify branch creation
The documentation seems to assume that the starting point for a new
branch is the tip of an existing (ordinary) branch, but that is not
the most common case.  More often, "git branch" is used to begin
a branch from a remote-tracking branch, a tag, or an interesting
commit (e.g. origin/pu^2).  Clarify the language so it can apply
to these cases.  Thanks to Sean Estabrooks for the wording.

Also add a pointer to the user's manual for the bewildered.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-10-09 14:54:15 -07:00
Jonathan Nieder
58d2c961b3 Documentation: branch: update --merged description
Update the documentation for --merged and --no-merged to explain
the meaning of the optional parameter introduced in commit 049716b
(branch --merged/--no-merged: allow specifying arbitrary commit,
2008-07-08).

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-10-09 14:50:21 -07:00
Jonathan Nieder
25dcc0d64b Documentation: clarify mergeoptions description
Sounds better this way, at least to my ears.  ("The syntax and
supported options of git merge" is a plural noun.  "the same"
instead of "equal" sounds less technical and seems to convey
the meaning better here.)

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-10-09 14:43:04 -07:00
Jonathan Nieder
0f8a02c640 Documentation: git fmt-merge-msg does not have to be a script
The fmt-merge-message builtin can be invoked as "git fmt-merge-msg" rather
than through the hard link in GIT_EXEC_PATH.  Although this is unlikely to
confuse most script writers, it should not hurt to make the documentation
a little clearer anyway.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-10-09 14:40:25 -07:00
Jonathan Nieder
162213d232 Describe DOCBOOK_XSL_172, ASCIIDOC_NO_ROFF options in Makefile
There is excellent documentation for these options in
Documentation/Makefile, but some users may never find it.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-10-09 14:38:14 -07:00