* Using VC build git (new patch)
From: Frank Li @ 2009-08-15 16:21 UTC (permalink / raw)
To: git, msysGit
[-- Attachment #1: Type: text/plain, Size: 63 bytes --]
New patch.
pull from git://repo.or.cz/tgit.git
branch vcpatch
[-- Attachment #2: 0001-Enable-Visual-Studio-2008-Build-Git.patch --]
[-- Type: application/octet-stream, Size: 52895 bytes --]
From 3136d3b72e199ad1484629e8ff4563a918cad953 Mon Sep 17 00:00:00 2001
From: Frank Li <lznuaa@gmail.com>
Date: Tue, 4 Aug 2009 23:53:38 +0800
Subject: [PATCH] Enable Visual Studio 2008 Build Git
Enable VC Build Git. Reuse many msysgit porting working.
Build Git need some external library, such zlib.
Please read Readme to get how to build git with VS2008
Signed-off-by: Frank Li <lznuaa@gmail.com>
---
builtin-fast-export.c | 1 +
compat/fnmatch/fnmatch.c | 2 +
compat/mingw.c | 68 ++-
compat/mingw.h | 21 +-
compat/regex/regex.c | 8 +-
compat/snprintf.c | 7 +-
compat/vcbuild/.gitignore | 3 +
compat/vcbuild/ReadMe | 13 +
compat/vcbuild/git/git.vcproj | 197 +++++
compat/vcbuild/include/dirent.h | 127 ++++
compat/vcbuild/include/unistd.h | 174 +++++
compat/vcbuild/libgit/libgit.vcproj | 1347 +++++++++++++++++++++++++++++++++++
compat/vcbuild/porting.c | 13 +
compat/vcbuild/sys/time.h | 21 +
compat/winansi.c | 8 +
git-compat-util.h | 2 +-
help.c | 5 +-
| 4 +-
run-command.c | 11 +-
run-command.h | 2 +-
setup.c | 2 +-
21 files changed, 2011 insertions(+), 25 deletions(-)
create mode 100644 compat/vcbuild/.gitignore
create mode 100644 compat/vcbuild/ReadMe
create mode 100644 compat/vcbuild/git/git.vcproj
create mode 100644 compat/vcbuild/include/dirent.h
create mode 100644 compat/vcbuild/include/unistd.h
create mode 100644 compat/vcbuild/include/utime.h
create mode 100644 compat/vcbuild/libgit/libgit.vcproj
create mode 100644 compat/vcbuild/porting.c
create mode 100644 compat/vcbuild/sys/param.h
create mode 100644 compat/vcbuild/sys/socket.h
create mode 100644 compat/vcbuild/sys/time.h
diff --git a/builtin-fast-export.c b/builtin-fast-export.c
index c48c18d..24a50ae 100644
--- a/builtin-fast-export.c
+++ b/builtin-fast-export.c
@@ -24,6 +24,7 @@ static const char *fast_export_usage[] = {
static int progress;
static enum { ABORT, VERBATIM, WARN, STRIP } signed_tag_mode = ABORT;
+#undef ERROR
static enum { ERROR, DROP, REWRITE } tag_of_filtered_mode = ABORT;
static int fake_missing_tagger;
diff --git a/compat/fnmatch/fnmatch.c b/compat/fnmatch/fnmatch.c
index 14feac7..4e3d8e7 100644
--- a/compat/fnmatch/fnmatch.c
+++ b/compat/fnmatch/fnmatch.c
@@ -16,6 +16,8 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+#include "git-compat-util.h"
+
#if HAVE_CONFIG_H
# include <config.h>
#endif
diff --git a/compat/mingw.c b/compat/mingw.c
index bed4178..4ff2e84 100644
--- a/compat/mingw.c
+++ b/compat/mingw.c
@@ -123,13 +123,19 @@ int mingw_open (const char *filename, int oflags, ...)
{
va_list args;
unsigned mode;
+ int fd;
+
va_start(args, oflags);
mode = va_arg(args, int);
va_end(args);
if (!strcmp(filename, "/dev/null"))
filename = "nul";
- int fd = open(filename, oflags, mode);
+#if defined(_MSC_VER)
+ fd = _open(filename, oflags|_O_BINARY, mode);
+#else
+ fd = open(filename, oflags, mode);
+#endif
if (fd < 0 && (oflags & O_CREAT) && errno == EACCES) {
DWORD attrs = GetFileAttributes(filename);
if (attrs != INVALID_FILE_ATTRIBUTES && (attrs & FILE_ATTRIBUTE_DIRECTORY))
@@ -274,7 +280,11 @@ int mkstemp(char *template)
char *filename = mktemp(template);
if (filename == NULL)
return -1;
+#if defined(_MSC_VER)
+ return _open(filename, _O_RDWR | _O_CREAT | _O_BINARY, 0600);
+#else
return open(filename, O_RDWR | O_CREAT, 0600);
+#endif
}
int gettimeofday(struct timeval *tv, void *tz)
@@ -580,10 +590,11 @@ static char **get_path_split(void)
static void free_path_split(char **path)
{
+ char **p = path;
+
if (!path)
return;
-
- char **p = path;
+
while (*p)
free(*p++);
free(path);
@@ -938,7 +949,6 @@ int mingw_rename(const char *pold, const char *pnew)
DWORD attrs, gle;
int tries = 0;
static const int delay[] = { 0, 1, 10, 20, 40 };
-
/*
* Try native rename() first to get errno right.
* It is based on MoveFile(), which cannot overwrite existing files.
@@ -1011,7 +1021,9 @@ static sig_handler_t timer_fn = SIG_DFL;
* But ticktack() interrupts the wait state after the timer's interval
* length to call the signal handler.
*/
-
+#if defined(_MSC_VER)
+#define __stdcall
+#endif
static __stdcall unsigned ticktack(void *dummy)
{
while (WaitForSingleObject(timer_event, timer_interval) == WAIT_TIMEOUT) {
@@ -1108,9 +1120,11 @@ int sigaction(int sig, struct sigaction *in, struct sigaction *out)
#undef signal
sig_handler_t mingw_signal(int sig, sig_handler_t handler)
{
+ sig_handler_t old;
+
if (sig != SIGALRM)
return signal(sig, handler);
- sig_handler_t old = timer_fn;
+ old = timer_fn;
timer_fn = handler;
return old;
}
@@ -1141,6 +1155,12 @@ int link(const char *oldpath, const char *newpath)
{
typedef BOOL WINAPI (*T)(const char*, const char*, LPSECURITY_ATTRIBUTES);
static T create_hard_link = NULL;
+
+#if defined(_MSC_VER)
+ errno = ENOSYS;
+ return -1;
+#endif
+
if (!create_hard_link) {
create_hard_link = (T) GetProcAddress(
GetModuleHandle("kernel32.dll"), "CreateHardLinkA");
@@ -1197,8 +1217,9 @@ struct dirent *mingw_readdir(DIR *dir)
if (dir->dd_handle == (long)INVALID_HANDLE_VALUE && dir->dd_stat == 0)
{
+ DWORD lasterr;
handle = FindFirstFileA(dir->dd_name, &buf);
- DWORD lasterr = GetLastError();
+ lasterr = GetLastError();
dir->dd_handle = (long)handle;
if (handle == INVALID_HANDLE_VALUE && (lasterr != ERROR_NO_MORE_FILES)) {
errno = err_win_to_posix(lasterr);
@@ -1230,4 +1251,37 @@ struct dirent *mingw_readdir(DIR *dir)
return (struct dirent*)&dir->dd_dir;
}
+#if defined(_MSC_VER)
+DIR *opendir(const char *name)
+{
+ int len;
+ DIR *p;
+ p=(DIR*)malloc(sizeof(DIR));
+ memset(p,0,sizeof(DIR));
+ strncpy(p->dd_name,name,PATH_MAX);
+ len=strlen(p->dd_name);
+ p->dd_name[len]='/';
+ p->dd_name[len+1]='*';
+
+ if(p==NULL)
+ return NULL;
+
+ p->dd_handle=_findfirst(p->dd_name,&p->dd_dta);
+
+ if(p->dd_handle == -1)
+ {
+ free(p);
+ return NULL;
+ }
+ return p;
+}
+int closedir(DIR *dir)
+{
+ _findclose(dir->dd_handle);
+ free(dir);
+ return 0;
+}
+#endif //_MSC_VER
+
#endif // !NO_MINGW_REPLACE_READDIR
+
diff --git a/compat/mingw.h b/compat/mingw.h
index c1859c5..0eb2bc7 100644
--- a/compat/mingw.h
+++ b/compat/mingw.h
@@ -171,14 +171,31 @@ int mingw_getpagesize(void);
/* Use mingw_lstat() instead of lstat()/stat() and
* mingw_fstat() instead of fstat() on Windows.
*/
+#undef off_t
#define off_t off64_t
+
+#ifdef _MSC_VER
+#define stat(x,y) mingw_lstat(x,y)
+#define stat _stat64
+#else
#define stat _stati64
+#endif
+
+#undef lseek
#define lseek _lseeki64
+
int mingw_lstat(const char *file_name, struct stat *buf);
int mingw_fstat(int fd, struct stat *buf);
+
+#undef fstat
#define fstat mingw_fstat
+
+#undef lstat
#define lstat mingw_lstat
+
+#ifndef _MSC_VER
#define _stati64(x,y) mingw_lstat(x,y)
+#endif
int mingw_utime(const char *file_name, const struct utimbuf *times);
#define utime mingw_utime
@@ -197,7 +214,9 @@ sig_handler_t mingw_signal(int sig, sig_handler_t handler);
/*
* ANSI emulation wrappers
*/
-
+#ifdef _MSC_VER
+#define __attribute__(x)
+#endif
int winansi_fputs(const char *str, FILE *stream);
int winansi_printf(const char *format, ...) __attribute__((format (printf, 1, 2)));
int winansi_fprintf(FILE *stream, const char *format, ...) __attribute__((format (printf, 2, 3)));
diff --git a/compat/regex/regex.c b/compat/regex/regex.c
index 5ea0075..a291543 100644
--- a/compat/regex/regex.c
+++ b/compat/regex/regex.c
@@ -20,6 +20,8 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
/* AIX requires this to be the first thing in the file. */
+#include "git-compat-util.h"
+
#if defined (_AIX) && !defined (REGEX_MALLOC)
#pragma alloca
#endif
@@ -4852,11 +4854,7 @@ regexec (preg, string, nmatch, pmatch, eflags)
from either regcomp or regexec. We don't use PREG here. */
size_t
-regerror (errcode, preg, errbuf, errbuf_size)
- int errcode;
- const regex_t *preg;
- char *errbuf;
- size_t errbuf_size;
+regerror (int errcode, const regex_t * preg, char * errbuf,size_t errbuf_size)
{
const char *msg;
size_t msg_size;
diff --git a/compat/snprintf.c b/compat/snprintf.c
index 6c0fb05..47b2b8a 100644
--- a/compat/snprintf.c
+++ b/compat/snprintf.c
@@ -6,7 +6,7 @@
* number of characters to write without the trailing NUL.
*/
#ifndef SNPRINTF_SIZE_CORR
-#if defined(__MINGW32__) && defined(__GNUC__) && __GNUC__ < 4
+#if defined(__MINGW32__) && defined(__GNUC__) && __GNUC__ < 4 || defined(_MSC_VER)
#define SNPRINTF_SIZE_CORR 1
#else
#define SNPRINTF_SIZE_CORR 0
@@ -14,6 +14,11 @@
#endif
#undef vsnprintf
+
+#if defined(_MSC_VER)
+#define vsnprintf _vsnprintf
+#endif
+
int git_vsnprintf(char *str, size_t maxsize, const char *format, va_list ap)
{
char *s;
diff --git a/compat/vcbuild/.gitignore b/compat/vcbuild/.gitignore
new file mode 100644
index 0000000..7796990
--- /dev/null
+++ b/compat/vcbuild/.gitignore
@@ -0,0 +1,3 @@
+Debug
+Release
+*.user
\ No newline at end of file
diff --git a/compat/vcbuild/ReadMe b/compat/vcbuild/ReadMe
new file mode 100644
index 0000000..47c089e
--- /dev/null
+++ b/compat/vcbuild/ReadMe
@@ -0,0 +1,13 @@
+The Steps of Build Git with VS2008
+
+1. Create VC Build Environment.
+
+ git clone git://repo.or.cz/gitbuild.git
+
+ gitbuild include VS solution file and library such as zlib.
+
+2. Get Submodule
+
+ git submodule update
+
+3. Open gitbuild\gitbuild.sln with VS2008. Then press F7.
\ No newline at end of file
diff --git a/compat/vcbuild/git/git.vcproj b/compat/vcbuild/git/git.vcproj
new file mode 100644
index 0000000..6f85de3
--- /dev/null
+++ b/compat/vcbuild/git/git.vcproj
@@ -0,0 +1,197 @@
+<?xml version="1.0" encoding="gb2312"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="git"
+ ProjectGUID="{E3E30E51-C5AD-407B-AB43-985E4111474A}"
+ RootNamespace="git"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="196613"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)\bin"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="1"
+ CharacterSet="0"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\..;..\..\..\..\zlib;..\..;..\;..\include;..\..\..\compat;..\..\..\compat\fnmatch;..\..\..\compat\regex;.\"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="wininet.lib ws2_32.lib "
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)\bin"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="1"
+ CharacterSet="0"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ EnableIntrinsicFunctions="true"
+ AdditionalIncludeDirectories="..\..\..;..\..\..\..\zlib;..\..;..\;..\include;..\..\..\compat;..\..\..\compat\fnmatch;..\..\..\compat\regex;.\"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="wininet.lib ws2_32.lib "
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath="..\..\..\git.c"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/compat/vcbuild/include/dirent.h b/compat/vcbuild/include/dirent.h
new file mode 100644
index 0000000..a6b6f4c
--- /dev/null
+++ b/compat/vcbuild/include/dirent.h
@@ -0,0 +1,127 @@
+/*
+ * DIRENT.H (formerly DIRLIB.H)
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is a part of the mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within the package.
+ *
+ */
+#ifndef _DIRENT_H_
+#define _DIRENT_H_
+
+/* All the headers include this file. */
+//#include <_mingw.h>
+
+#include <io.h>
+
+#define PATH_MAX 512
+
+#define __MINGW_NOTHROW
+
+#ifndef RC_INVOKED
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct dirent
+{
+ long d_ino; /* Always zero. */
+ unsigned short d_reclen; /* Always zero. */
+ unsigned short d_namlen; /* Length of name in d_name. */
+ char d_name[FILENAME_MAX]; /* File name. */
+};
+
+/*
+ * This is an internal data structure. Good programmers will not use it
+ * except as an argument to one of the functions below.
+ * dd_stat field is now int (was short in older versions).
+ */
+typedef struct
+{
+ /* disk transfer area for this dir */
+ struct _finddata_t dd_dta;
+
+ /* dirent struct to return from dir (NOTE: this makes this thread
+ * safe as long as only one thread uses a particular DIR struct at
+ * a time) */
+ struct dirent dd_dir;
+
+ /* _findnext handle */
+ long dd_handle;
+
+ /*
+ * Status of search:
+ * 0 = not started yet (next entry to read is first entry)
+ * -1 = off the end
+ * positive = 0 based index of next entry
+ */
+ int dd_stat;
+
+ /* given path for dir with search pattern (struct is extended) */
+ char dd_name[PATH_MAX+3];
+} DIR;
+
+DIR* __cdecl __MINGW_NOTHROW opendir (const char*);
+struct dirent* __cdecl __MINGW_NOTHROW readdir (DIR*);
+int __cdecl __MINGW_NOTHROW closedir (DIR*);
+void __cdecl __MINGW_NOTHROW rewinddir (DIR*);
+long __cdecl __MINGW_NOTHROW telldir (DIR*);
+void __cdecl __MINGW_NOTHROW seekdir (DIR*, long);
+
+
+/* wide char versions */
+
+struct _wdirent
+{
+ long d_ino; /* Always zero. */
+ unsigned short d_reclen; /* Always zero. */
+ unsigned short d_namlen; /* Length of name in d_name. */
+ wchar_t d_name[FILENAME_MAX]; /* File name. */
+};
+
+/*
+ * This is an internal data structure. Good programmers will not use it
+ * except as an argument to one of the functions below.
+ */
+typedef struct
+{
+ /* disk transfer area for this dir */
+ //struct _wfinddata_t dd_dta;
+
+ /* dirent struct to return from dir (NOTE: this makes this thread
+ * safe as long as only one thread uses a particular DIR struct at
+ * a time) */
+ struct _wdirent dd_dir;
+
+ /* _findnext handle */
+ long dd_handle;
+
+ /*
+ * Status of search:
+ * 0 = not started yet (next entry to read is first entry)
+ * -1 = off the end
+ * positive = 0 based index of next entry
+ */
+ int dd_stat;
+
+ /* given path for dir with search pattern (struct is extended) */
+ wchar_t dd_name[1];
+} _WDIR;
+
+
+
+_WDIR* __cdecl __MINGW_NOTHROW _wopendir (const wchar_t*);
+struct _wdirent* __cdecl __MINGW_NOTHROW _wreaddir (_WDIR*);
+int __cdecl __MINGW_NOTHROW _wclosedir (_WDIR*);
+void __cdecl __MINGW_NOTHROW _wrewinddir (_WDIR*);
+long __cdecl __MINGW_NOTHROW _wtelldir (_WDIR*);
+void __cdecl __MINGW_NOTHROW _wseekdir (_WDIR*, long);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* Not RC_INVOKED */
+
+#endif /* Not _DIRENT_H_ */
diff --git a/compat/vcbuild/include/unistd.h b/compat/vcbuild/include/unistd.h
new file mode 100644
index 0000000..0c06957
--- /dev/null
+++ b/compat/vcbuild/include/unistd.h
@@ -0,0 +1,174 @@
+#ifndef _UNISTD_
+#define _UNISTD_
+
+/*Configuration*/
+
+#define NO_PREAD
+#define NO_OPENSSL
+#define NO_LIBGEN_H
+#define NO_SYMLINK_HEAD
+#define NO_IPV6
+#define NO_SETENV
+#define NO_UNSETENV
+#define NO_STRCASESTR
+#define NO_STRLCPY
+#define NO_MEMMEM
+#define NO_C99_FORMAT
+#define NO_STRTOUMAX
+#define NO_MKDTEMP
+#define NO_MKSTEMPS
+
+#define RUNTIME_PREFIX
+#define NO_ST_BLOCKS_IN_STRUCT_STAT
+#define NO_NSEC
+#define USE_WIN32_MMAP
+#define USE_NED_ALLOCATOR
+
+#define NO_REGEX
+
+#define NO_SYS_SELECT_H
+#define NO_PTHEADS
+#define HAVE_STRING_H 1
+#define STDC_HEADERS
+#define NO_ICONV
+
+#define WINVER 0x0500
+#define _WIN32_WINNT 0x0500
+#define _WIN32_WINDOWS 0x0410
+#define _WIN32_IE 0x0700
+#define NTDDI_VERSION NTDDI_WIN2KSP1
+#define inline __inline
+#define __inline__ __inline
+
+#define SNPRINTF_RETURNS_BOGUS
+
+#define SHA1_HEADER "mozilla-sha1\\sha1.h"
+
+#define ETC_GITCONFIG "%HOME%"
+
+#define NO_PTHREADS
+#define NO_CURL
+
+
+#define va_copy va_start
+#define NO_STRTOUMAX
+#define REGEX_MALLOC
+
+
+
+
+/* Win32 define for porting git*/
+
+#ifndef _MODE_T_
+#define _MODE_T_
+typedef unsigned short _mode_t;
+
+#ifndef _NO_OLDNAMES
+typedef _mode_t mode_t;
+#endif
+#endif /* Not _MODE_T_ */
+
+#ifndef _SSIZE_T_
+#define _SSIZE_T_
+typedef long _ssize_t;
+
+#ifndef _OFF_T_
+#define _OFF_T_
+typedef long _off_t;
+
+#ifndef _NO_OLDNAMES
+typedef _off_t off_t;
+#endif
+#endif /* Not _OFF_T_ */
+
+
+#ifndef _NO_OLDNAMES
+typedef _ssize_t ssize_t;
+#endif
+#endif /* Not _SSIZE_T_ */
+
+typedef signed char int8_t;
+typedef unsigned char uint8_t;
+typedef short int16_t;
+typedef unsigned short uint16_t;
+typedef int int32_t;
+typedef unsigned uint32_t;
+typedef long long int64_t;
+typedef unsigned long long uint64_t;
+
+typedef long long intmax_t;
+typedef unsigned long long uintmax_t;
+
+typedef int64_t off64_t;
+
+#define STDOUT_FILENO 1
+#define STDERR_FILENO 2
+
+/* Some defines for _access nAccessMode (MS doesn't define them, but
+ * it doesn't seem to hurt to add them). */
+#define F_OK 0 /* Check for file existence */
+/* Well maybe it does hurt. On newer versions of MSVCRT, an access mode
+ of 1 causes invalid parameter error. */
+#define X_OK 0 /* MS access() doesn't check for execute permission. */
+#define W_OK 2 /* Check for write permission */
+#define R_OK 4 /* Check for read permission */
+
+#define _S_IFIFO 0x1000 /* FIFO */
+#define _S_IFCHR 0x2000 /* Character */
+#define _S_IFBLK 0x3000 /* Block: Is this ever set under w32? */
+#define _S_IFDIR 0x4000 /* Directory */
+#define _S_IFREG 0x8000 /* Regular */
+
+#define _S_IFMT 0xF000 /* File type mask */
+
+#define _S_IXUSR _S_IEXEC
+#define _S_IWUSR _S_IWRITE
+#define _S_IRUSR _S_IREAD
+#define _S_ISDIR(m) (((m) & _S_IFMT) == _S_IFDIR)
+
+#define S_IFIFO _S_IFIFO
+#define S_IFCHR _S_IFCHR
+#define S_IFBLK _S_IFBLK
+#define S_IFDIR _S_IFDIR
+#define S_IFREG _S_IFREG
+#define S_IFMT _S_IFMT
+#define S_IEXEC _S_IEXEC
+#define S_IWRITE _S_IWRITE
+#define S_IREAD _S_IREAD
+#define S_IRWXU _S_IRWXU
+#define S_IXUSR _S_IXUSR
+#define S_IWUSR _S_IWUSR
+#define S_IRUSR _S_IRUSR
+
+
+#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
+#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
+#define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
+
+//#define S_IWGRP _S_IWGRP
+
+
+#define GIT_EXEC_PATH "bin"
+#define GIT_VERSION "1.6"
+#define BINDIR "bin"
+#define PREFIX "."
+#define GIT_MAN_PATH "man"
+#define GIT_INFO_PATH "info"
+#define GIT_HTML_PATH "html"
+#define DEFAULT_GIT_TEMPLATE_DIR "templates"
+
+#define NO_STRLCPY
+#define NO_UNSETENV
+#define NO_SETENV
+
+#define strdup _strdup
+#define read _read
+#define close _close
+#define dup _dup
+#define dup2 _dup2
+#define strncasecmp _strnicmp
+#define strtoull _strtoui64
+
+//#define lseek _lseek
+//#define write vs_write
+#endif
\ No newline at end of file
diff --git a/compat/vcbuild/include/utime.h b/compat/vcbuild/include/utime.h
new file mode 100644
index 0000000..e69de29
diff --git a/compat/vcbuild/libgit/libgit.vcproj b/compat/vcbuild/libgit/libgit.vcproj
new file mode 100644
index 0000000..06dcdef
--- /dev/null
+++ b/compat/vcbuild/libgit/libgit.vcproj
@@ -0,0 +1,1347 @@
+<?xml version="1.0" encoding="gb2312"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="libgit"
+ ProjectGUID="{F6DEC8C3-B803-4A86-8848-430F08B499E3}"
+ RootNamespace="libgit"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="196613"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="4"
+ CharacterSet="0"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="..\..\..;..\..\..\..\zlib;..\..;..\;..\include;..\..\..\compat;..\..\..\compat\fnmatch;..\..\..\compat\regex;.\"
+ PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="4"
+ CharacterSet="0"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ EnableIntrinsicFunctions="true"
+ AdditionalIncludeDirectories="..\..\..;..\..\..\..\zlib;..\..;..\;..\include;..\..\..\compat;..\..\..\compat\fnmatch;..\..\..\compat\regex;.\"
+ PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath="..\porting.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\mozilla-sha1\sha1.c"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ <File
+ RelativePath="..\..\..\archive.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\attr.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\blob.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\branch.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\builtin.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\bundle.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\cache-tree.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\cache.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\color.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\commit.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\csum-file.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\decorate.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\delta.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\diff.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\diffcore.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\dir.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\exec_cmd.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\fetch-pack.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\fsck.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\git-compat-util.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\graph.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\grep.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\hash.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\help.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\http.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\levenshtein.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\list-objects.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\ll-merge.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\log-tree.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\mailmap.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\merge-recursive.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\notes.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\object.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\pack-refs.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\pack-revindex.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\pack.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\parse-options.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\patch-ids.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\pkt-line.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\progress.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\quote.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\reachable.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\reflog-walk.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\refs.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\remote.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\rerere.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\revision.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\run-command.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\send-pack.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\sha1-lookup.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\shortlog.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\sideband.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\sigchain.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\strbuf.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\string-list.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\tag.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\tar.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\thread-utils.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\transport.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\tree-walk.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\tree.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\unpack-trees.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\userdiff.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\utf8.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\walker.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\wt-status.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\xdiff-interface.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ </Filter>
+ <Filter
+ Name="compat"
+ >
+ <File
+ RelativePath="..\..\..\compat\basename.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\compat\cygwin.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\compat\fnmatch\fnmatch.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\compat\fnmatch\fnmatch.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\compat\fopen.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\compat\memmem.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\compat\mingw.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\compat\mingw.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\compat\mkdtemp.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\compat\mkstemps.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\compat\pread.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\compat\qsort.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\compat\regex\regex.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\compat\regex\regex.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\compat\setenv.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\compat\snprintf.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\compat\strcasestr.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\compat\strlcpy.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\compat\strtoumax.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\compat\unsetenv.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\compat\win32.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\compat\win32mmap.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\compat\winansi.c"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="git"
+ >
+ <File
+ RelativePath="..\..\..\abspath.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\alias.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\alloc.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\archive-tar.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\archive-zip.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\archive.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\attr.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\base85.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\bisect.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\blob.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\branch.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\builtin-add.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\builtin-annotate.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\builtin-apply.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\builtin-archive.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\builtin-bisect--helper.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\builtin-blame.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\builtin-branch.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\builtin-bundle.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\builtin-cat-file.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\builtin-check-attr.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\builtin-check-ref-format.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\builtin-checkout-index.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\builtin-checkout.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\builtin-clean.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\builtin-clone.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\builtin-commit-tree.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\builtin-commit.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\builtin-config.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\builtin-count-objects.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\builtin-describe.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\builtin-diff-files.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\builtin-diff-index.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\builtin-diff-tree.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\builtin-diff.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\builtin-fast-export.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\builtin-fetch--tool.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\builtin-fetch-pack.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\builtin-fetch.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\builtin-fmt-merge-msg.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\builtin-for-each-ref.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\builtin-fsck.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\builtin-gc.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\builtin-grep.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\builtin-help.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\builtin-init-db.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\builtin-log.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\builtin-ls-files.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\builtin-ls-remote.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\builtin-ls-tree.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\builtin-mailinfo.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\builtin-mailsplit.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\builtin-merge-base.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\builtin-merge-file.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\builtin-merge-ours.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\builtin-merge-recursive.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\builtin-merge.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\builtin-mktree.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\builtin-mv.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\builtin-name-rev.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\builtin-pack-objects.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\builtin-pack-refs.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\builtin-prune-packed.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\builtin-prune.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\builtin-push.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\builtin-read-tree.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\builtin-receive-pack.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\builtin-reflog.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\builtin-remote.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\builtin-rerere.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\builtin-reset.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\builtin-rev-list.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\builtin-rev-parse.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\builtin-revert.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\builtin-rm.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\builtin-send-pack.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\builtin-shortlog.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\builtin-show-branch.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\builtin-show-ref.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\builtin-stripspace.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\builtin-symbolic-ref.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\builtin-tag.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\builtin-tar-tree.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\builtin-unpack-objects.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\builtin-update-index.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\builtin-update-ref.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\builtin-upload-archive.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\builtin-verify-pack.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\builtin-verify-tag.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\builtin-write-tree.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\bundle.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\cache-tree.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\color.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\combine-diff.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\commit.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\config.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\connect.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\convert.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\copy.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\csum-file.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\ctype.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\date.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\decorate.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\diff-delta.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\diff-lib.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\diff-no-index.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\diff.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\diffcore-break.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\diffcore-delta.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\diffcore-order.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\diffcore-pickaxe.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\diffcore-rename.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\dir.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\editor.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\entry.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\environment.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\exec_cmd.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\fsck.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\graph.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\grep.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\hash.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\help.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\ident.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\levenshtein.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\list-objects.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\ll-merge.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lockfile.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\log-tree.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\mailmap.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\match-trees.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\merge-file.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\merge-recursive.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\merge-tree.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\name-hash.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\object.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\pack-check.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\pack-refs.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\pack-revindex.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\pack-write.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\pager.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\parse-options.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\patch-delta.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\patch-ids.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\path.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\pkt-line.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\preload-index.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\pretty.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\progress.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\quote.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\reachable.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\read-cache.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\reflog-walk.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\refs.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\remote.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\rerere.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\revision.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\run-command.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\server-info.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\setup.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\sha1-lookup.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\sha1_file.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\sha1_name.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\shallow.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\sideband.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\sigchain.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\strbuf.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\string-list.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\symlinks.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\tag.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\thread-utils.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\trace.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\transport.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\tree-diff.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\tree-walk.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\tree.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\unpack-trees.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\usage.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\userdiff.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\utf8.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\walker.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\wrapper.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\write_or_die.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\ws.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\wt-status.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\xdiff-interface.c"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="xdiff"
+ >
+ <File
+ RelativePath="..\..\..\xdiff\xdiff.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\xdiff\xdiffi.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\xdiff\xdiffi.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\xdiff\xemit.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\xdiff\xemit.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\xdiff\xinclude.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\xdiff\xmacros.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\xdiff\xmerge.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\xdiff\xpatience.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\xdiff\xprepare.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\xdiff\xprepare.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\xdiff\xtypes.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\xdiff\xutils.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\xdiff\xutils.h"
+ >
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/compat/vcbuild/porting.c b/compat/vcbuild/porting.c
new file mode 100644
index 0000000..f9bd82d
--- /dev/null
+++ b/compat/vcbuild/porting.c
@@ -0,0 +1,13 @@
+#include "stdio.h"
+#include "STDARG.H"
+#include <string.h>
+#include "dirent.h"
+#include "unistd.h"
+
+int strcasecmp (const char *s1, const char *s2)
+{
+ int size1=strlen(s1);
+ int sisz2=strlen(s2);
+
+ return _strnicmp(s1,s2,sisz2>size1?sisz2:size1);
+}
\ No newline at end of file
diff --git a/compat/vcbuild/sys/param.h b/compat/vcbuild/sys/param.h
new file mode 100644
index 0000000..e69de29
diff --git a/compat/vcbuild/sys/socket.h b/compat/vcbuild/sys/socket.h
new file mode 100644
index 0000000..e69de29
diff --git a/compat/vcbuild/sys/time.h b/compat/vcbuild/sys/time.h
new file mode 100644
index 0000000..6ed82c0
--- /dev/null
+++ b/compat/vcbuild/sys/time.h
@@ -0,0 +1,21 @@
+#ifndef _UTIME_H_
+#define _UTIME_H_
+/*
+ * Structure used by _utime function.
+ */
+struct _utimbuf
+{
+ time_t actime; /* Access time */
+ time_t modtime; /* Modification time */
+};
+
+#ifndef _NO_OLDNAMES
+/* NOTE: Must be the same as _utimbuf above. */
+struct utimbuf
+{
+ time_t actime;
+ time_t modtime;
+};
+#endif /* Not _NO_OLDNAMES */
+
+#endif
diff --git a/compat/winansi.c b/compat/winansi.c
index 9217c24..6091138 100644
--- a/compat/winansi.c
+++ b/compat/winansi.c
@@ -3,7 +3,11 @@
*/
#include <windows.h>
+#ifdef _MSC_VER
+#include <stdio.h>
+#else
#include "../git-compat-util.h"
+#endif
/*
Functions to be wrapped:
@@ -310,9 +314,13 @@ static int winansi_vfprintf(FILE *stream, const char *format, va_list list)
if (!console)
goto abort;
+#ifndef _MSC_VER
va_copy(cp, list);
len = vsnprintf(small_buf, sizeof(small_buf), format, cp);
va_end(cp);
+#else
+ len= sizeof(small_buf) ;
+#endif
if (len > sizeof(small_buf) - 1) {
buf = malloc(len + 1);
diff --git a/git-compat-util.h b/git-compat-util.h
index 9f941e4..3b683e6 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -87,7 +87,7 @@
#include <assert.h>
#include <regex.h>
#include <utime.h>
-#ifndef __MINGW32__
+#if !defined(__MINGW32__) && !defined(_MSC_VER)
#include <sys/wait.h>
#include <sys/poll.h>
#include <sys/socket.h>
diff --git a/help.c b/help.c
index 6c46d8b..a311241 100644
--- a/help.c
+++ b/help.c
@@ -126,8 +126,8 @@ static int is_executable(const char *name)
!S_ISREG(st.st_mode))
return 0;
-#ifdef __MINGW32__
- /* cannot trust the executable bit, peek into the file instead */
+#if defined(__MINGW32__) || defined(_MSC_VER)
+{ /* cannot trust the executable bit, peek into the file instead */
char buf[3] = { 0 };
int n;
int fd = open(name, O_RDONLY);
@@ -140,6 +140,7 @@ static int is_executable(const char *name)
st.st_mode |= S_IXUSR;
close(fd);
}
+}
#endif
return st.st_mode & S_IXUSR;
}
--git a/pager.c b/pager.c
index 4921843..28122c5 100644
--- a/pager.c
+++ b/pager.c
@@ -9,7 +9,7 @@
static int spawned_pager;
-#ifndef __MINGW32__
+#if !defined(__MINGW32__) && !defined(_MSC_VER)
static void pager_preexec(void)
{
/*
@@ -70,7 +70,7 @@ void setup_pager(void)
pager_argv[2] = pager;
pager_process.argv = pager_argv;
pager_process.in = -1;
-#ifndef __MINGW32__
+#if !defined(__MINGW32__) && !defined(_MSC_VER)
pager_process.preexec_cb = pager_preexec;
#endif
if (start_command(&pager_process))
diff --git a/run-command.c b/run-command.c
index ff3d8e2..1ea1c16 100644
--- a/run-command.c
+++ b/run-command.c
@@ -67,7 +67,7 @@ int start_command(struct child_process *cmd)
trace_argv_printf(cmd->argv, "trace: run_command:");
-#ifndef __MINGW32__
+#if !defined(__MINGW32__) && !defined(_MSC_VER)
fflush(NULL);
cmd->pid = fork();
if (!cmd->pid) {
@@ -123,6 +123,7 @@ int start_command(struct child_process *cmd)
exit(127);
}
#else
+{
int s0 = -1, s1 = -1, s2 = -1; /* backups of stdin, stdout, stderr */
const char **sargv = cmd->argv;
char **env = environ;
@@ -186,6 +187,7 @@ int start_command(struct child_process *cmd)
dup2(s1, 1), close(s1);
if (s2 >= 0)
dup2(s2, 2), close(s2);
+}
#endif
if (cmd->pid < 0) {
@@ -292,7 +294,8 @@ int run_command_v_opt_cd_env(const char **argv, int opt, const char *dir, const
return run_command(&cmd);
}
-#ifdef __MINGW32__
+#if defined(__MINGW32__) || defined(_MSC_VER)
+#define __stdcall
static __stdcall unsigned run_thread(void *data)
{
struct async *async = data;
@@ -308,7 +311,7 @@ int start_async(struct async *async)
return error("cannot create pipe: %s", strerror(errno));
async->out = pipe_out[0];
-#ifndef __MINGW32__
+#if !defined(__MINGW32__) && !defined(_MSC_VER)
/* Flush stdio before fork() to avoid cloning buffers */
fflush(NULL);
@@ -337,7 +340,7 @@ int start_async(struct async *async)
int finish_async(struct async *async)
{
-#ifndef __MINGW32__
+#if !defined(__MINGW32__) && !defined(_MSC_VER)
int ret = 0;
if (wait_or_whine(async->pid))
diff --git a/run-command.h b/run-command.h
index e345502..57a707b 100644
--- a/run-command.h
+++ b/run-command.h
@@ -79,7 +79,7 @@ struct async {
int (*proc)(int fd, void *data);
void *data;
int out; /* caller reads from here and closes it */
-#ifndef __MINGW32__
+#if !defined(__MINGW32__) && !defined(_MSC_VER)
pid_t pid;
#else
HANDLE tid;
diff --git a/setup.c b/setup.c
index e3781b6..14e3ca7 100644
--- a/setup.c
+++ b/setup.c
@@ -41,7 +41,7 @@ const char *prefix_path(const char *prefix, int len, const char *path)
const char *prefix_filename(const char *pfx, int pfx_len, const char *arg)
{
static char path[PATH_MAX];
-#ifndef __MINGW32__
+#if !defined(__MINGW32__) && !defined(_MSC_VER)
if (!pfx || !*pfx || is_absolute_path(arg))
return arg;
memcpy(path, pfx, pfx_len);
--
1.6.4.msysgit.0
^ permalink raw reply related
* [PATCH] Makefile: Add NEEDS_CRYPTO_WITH_SSL
From: Brian Gernhardt @ 2009-08-15 16:46 UTC (permalink / raw)
To: Git List; +Cc: Junio C Hamano
The Makefile comment for NEEDS_SSL_WITH_CRYPTO says to define it "if
you need -lcrypto with -lssl (Darwin)." However, what it actually
does is add -lssl when you use -lcrypto and not the other way around.
However, libcrypto contains a majority of the ERR_* functions from
OpenSSL (at least on OS X) so we need it both ways.
So, add NEEDS_CRYPTO_WITH_SSL which adds -lcrypto to the OpenSSL link
flags and clarify the difference between it and NEEDS_SSL_WITH_CRYPTO.
---
After adding BLK_SHA1 to my config.mak, git-imap-send started giving me link
errors:
Undefined symbols:
"_ERR_get_error", referenced from:
_ssl_socket_perror in imap-send.o
"_ERR_error_string", referenced from:
_ssl_socket_perror in imap-send.o
Some investigation led me to the fact that BLK_SHA1 removes LIB_4_CRYPTO from
EXTLIBS. That let me find the missing functions in libcrypto. At first I
considered making NEEDS_SSL_WITH_CRYPTO add -lcrypto to the SSL build flags
but decided to go this route in case there are platforms that need it one way
around and not the other.
I've enabled this build option by default on Darwin but nowhere else. If you
can't build git-imap-send (with SSL) after enabling BLK_SHA1, your platform
may need this flag as well.
Makefile | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/Makefile b/Makefile
index f94fe05..bc745fb 100644
--- a/Makefile
+++ b/Makefile
@@ -99,7 +99,9 @@ all::
# on non-x86 architectures (e.g. PowerPC), while the OpenSSL version (default
# choice) has very fast version optimized for i586.
#
-# Define NEEDS_SSL_WITH_CRYPTO if you need -lcrypto with -lssl (Darwin).
+# Define NEEDS_CRYPTO_WITH_SSL if you need -lcrypto when using -lssl (Darwin).
+#
+# Define NEEDS_SSL_WITH_CRYPTO if you need -lssl when using -lcrypto (Darwin).
#
# Define NEEDS_LIBICONV if linking with libc is not enough (Darwin).
#
@@ -714,6 +716,7 @@ ifeq ($(uname_S),SCO_SV)
TAR = gtar
endif
ifeq ($(uname_S),Darwin)
+ NEEDS_CRYPTO_WITH_SSL = YesPlease
NEEDS_SSL_WITH_CRYPTO = YesPlease
NEEDS_LIBICONV = YesPlease
ifeq ($(shell expr "$(uname_R)" : '[15678]\.'),2)
@@ -1023,6 +1026,9 @@ ifndef NO_OPENSSL
else
OPENSSL_LINK =
endif
+ ifdef NEEDS_CRYPTO_WITH_SSL
+ OPENSSL_LINK += -lcrypto
+ endif
else
BASIC_CFLAGS += -DNO_OPENSSL
MOZILLA_SHA1 = 1
--
1.6.4.244.ge5cd0
^ permalink raw reply related
* Re: Using VC build git (new patch)
From: Johannes Schindelin @ 2009-08-15 16:57 UTC (permalink / raw)
To: Frank Li; +Cc: git, msysGit
In-Reply-To: <1976ea660908150921n516178dbs2ce024ed729e2e02@mail.gmail.com>
Hi,
On Sun, 16 Aug 2009, Frank Li wrote:
> New patch.
A single monster patch?
Hmm.
Please understand that I will not review that unless it is split up into
nice little and reviewable chunks.
This diffstat does not let me expect well-defined changes, either, sorry:
builtin-fast-export.c | 1 +
compat/fnmatch/fnmatch.c | 2 +
compat/mingw.c | 68 ++-
compat/mingw.h | 21 +-
compat/regex/regex.c | 8 +-
compat/snprintf.c | 7 +-
compat/vcbuild/.gitignore | 3 +
compat/vcbuild/ReadMe | 13 +
compat/vcbuild/git/git.vcproj | 197 +++++
compat/vcbuild/include/dirent.h | 127 ++++
compat/vcbuild/include/unistd.h | 174 +++++
compat/vcbuild/libgit/libgit.vcproj | 1347 +++++++++++++++++++++++++++++++++++
compat/vcbuild/porting.c | 13 +
compat/vcbuild/sys/time.h | 21 +
compat/winansi.c | 8 +
git-compat-util.h | 2 +-
help.c | 5 +-
pager.c | 4 +-
run-command.c | 11 +-
run-command.h | 2 +-
setup.c | 2 +-
21 files changed, 2011 insertions(+), 25 deletions(-)
It still modifies mingw.c and mingw.h, even if it has been strongly
suggested to leave those alone.
It touches all kinds of files that appear to be completely unrelated to
Microsoft Visual C++.
Remember: breaking things for existing users (and changing something that
works for them quite well readily risks that) is not an option.
And the commit message does not even explain half of it...
Ciao,
Dscho
^ permalink raw reply
* Re: Using VC build git (new patch)
From: Johannes Schindelin @ 2009-08-15 17:29 UTC (permalink / raw)
To: Frank Li; +Cc: git, msysGit
In-Reply-To: <alpine.DEB.1.00.0908151851280.8306@pacific.mpi-cbg.de>
Hi,
On Sat, 15 Aug 2009, Johannes Schindelin wrote:
> A single monster patch?
>
> Hmm.
>
> Please understand that I will not review that unless it is split up into
> nice little and reviewable chunks.
Well, I try to improve.
So I had a look at your patch. The changes fall naturally into one of the
following categories:
- decl-after-statement fixes
- missing #include "git-compat-util.h"
- converting a K&R style function definition to modern C
- #undef's only needed for Microsoft Visual C++
- the addition of O_BINARY in the file modes
- disabling link() (why?)
- double-#define'ing stat (which puzzles me greatly)
- dummy #define'ing of a few compiler attributes
- adding _MSVC to a conditional to avoid #define'ing
SNPRINTF_SIZE_CORR yourself
- #define'ing several symbols without leading underscore to the
MS-specific version with a leading underscore
- implementing strcasecmp() in a misnamed file
- "fixing" the return value of winansi_vfprintf for Microsoft
Visual C++ (I think this fix is wrong)
- correctly adding a Visual C++-specific conditional to
git-compat-util.h, pager.c, run-command.c, run-command.h,
setup.c and help.c, although the latter five could use some
refactoring into git-compat-util.h
Maybe there is also room to change the MinGW-conditional into a
NO_TRUSTABLE_FILEMODE one
- adding several headers missing from Visual C++'s installation
- adding _huge_ .vcproj files (can they not be smaller?)
As you can see, there is a pretty natural way to split that huge patch
into chunks that most people on these lists can review easily, and that
would actually be a pleasure to look at.
Even better, there are a few fixes (the first three, if you ask me), which
are not even Windows-specific.
Further, I would like to suggest adding a header file compat/msvc.h which
contains all the #undef's and #define's necessary only for Visual C++, and
which can be #include'd from git-compat-util.h, to better separate your
work from the other platforms (who do not want those changes). That
should avoid those unwanted changes to mingw.c and mingw.h. You just have
to make sure that msvc.h is #include'd before mingw.h.
With these comments, I look forward to your next iteration.
Ciao,
Dscho
^ permalink raw reply
* git-svn bug report: %20 in http:// should translate to a space ' ' automatically
From: Mike Smullin @ 2009-08-15 17:48 UTC (permalink / raw)
To: Eric Wong; +Cc: git
Hello,
This one took me over an hour to figure out with the help of doener in
#git on irc.freenode.net:
(10:11:15) jeanrussou: i am using git-svn clone to checkout individual
directories from an svn repo as separate .git repos on my local hdd.
some of the git-svn clone attempts get all of svn repo history, this one
gets only the last commit. an svn log of the same path returns a history
of at least 5 commits. i only have the most recent one in my git log
after git svn clone. any idea why?
...
(10:18:37) charon: jeanrussou: git-svn only tracks svn rename/copy
operations that are "visible" to it, i.e., happen entirely within the
paths cloned
(10:18:53) charon: jeanrussou: try 'svn log -v' to see if the directory
was moved
(10:18:54) jeanrussou: charon: yes, i did move the path. is there a
workaround? can i tell git-svn the original path before the move, or
something?
(10:23:46) doener: jeanrussou: so what's the situation you have? Cloning
repo/foo and repo/foo/bar was repo/goo in the past?
(10:23:56) doener: jeanrussou: or cloning repo/foo which was repo/bar in
the past?
(10:24:59) jeanrussou: in the beginning there was
http://repo/projects/Client%20Name/Project, then over time it became
http://repo/projects/archive/Client%20Name/Project. i am now attempting
git-svn clone on the latter url
(10:25:28) jeanrussou: there were no changes to the project after it
went into archive
(10:25:36) jeanrussou: i believe this is why it appears to only be
grabbing the last commit (which was the move)
(10:25:49) doener: jeanrussou: if that was a direct rename from one to
the other, git-svn should be able to follow that
... (trying -T, also svn+ssh://) ... finally the cause is found ...
(11:27:49) jeanrussou: i wrap it in double-quotes and replace %20 with a
space ' ' and it works
(11:31:40) jeanrussou: oh if i just replace %20 with a space the http://
url works too
(11:31:48) doener: *lol*
(11:31:57) jeanrussou: dangit
(11:32:20) jeanrussou: thanks doener
(11:32:23) jeanrussou: u rock
(11:32:25) doener: you're welcome
(11:33:10) doener: too bad that the bug reports I found didn't have the
space issue, would likely have saved some time ;-)
(11:33:38) jeanrussou: ya we should make one
(11:34:01) jeanrussou: that would be cool if git-svn could unescape the
url encodings for http:// paths
(11:34:17) doener: well, the path could contain a literal %20
(11:34:46) doener: not very common, but I guess the "give me the plain
path, please" approach of git-svn is ok
(11:35:39) jeanrussou: ya i could see that with svn+ssh:// and file://
but with http:// its going over WebDAV and i'd have to read the RFCs but
it might even be an HTTP thing about accessing URLs that % is not valid
in URLs
(11:36:37) doener: yeah, those need to be escaped as %25 (IIRC). And
it's kinda weird that the one without -T works
(11:36:49) jeanrussou: o ya definitely. that too
(11:36:56) doener: so yeah, a bug report might be the right thing
(11:36:57) jeanrussou: thats what threw me off. i thought the url was
working because of that
(11:37:14) jeanrussou: okay cool lets see if i can find the git bug tracker
Hope this helps! :)
--
Respectfully,
Mike Smullin
Senior Web Systems Director
Smullin Design and Development, LLC
http://www.smullindesign.com
http://www.linkedin.com/in/mikesmullin
2112 E. Frontier St.
Eagle Mountain, Utah 84005
United States
toll-free: +1 800-819-7431
mobile: +1 801-652-5849
skype: smullindesign
^ permalink raw reply
* Re: git-svn bug report: %20 in http:// should translate to a space ' ' automatically
From: Björn Steinbrink @ 2009-08-15 18:16 UTC (permalink / raw)
To: Mike Smullin; +Cc: Eric Wong, git
In-Reply-To: <4A86F4DA.5090605@smullindesign.com>
On 2009.08.15 11:48:10 -0600, Mike Smullin wrote:
> Hello,
>
> This one took me over an hour to figure out with the help of doener
> in #git on irc.freenode.net:
[IRC log omitted]
To wrap that up:
1) git svn clone http://host/repo/path%20with%20spaces/foo/bar/goo
Works, but see below.
2) git svn clone -Tgoo http://host/repo/path%20with%20spaces/foo/bar
Fails.
3) git svn clone -Tgoo "http://host/repo/path with spaces/foo/bar"
Works.
In Mike's case, there was a rename from foo/goo to foo/bar/goo. 1) fails
to follow that rename, 2) just completely fails and 3) works and follows
the rename.
Cloning via http:// didn't provide any interesting error messages, but
cloning via svn+ssh:// showed:
For 1)
W: Ignoring error from SVN, path probably does not exist: (160013):
Filesystem has no item: File not found: revision 100, path
'/path with spaces/foo/bar"
For 2)
W: Ignoring error from SVN, path probably does not exist: (160013):
Filesystem has no item: File not found: revision 100, path
'/path%20with%20spaces/foo/bar"
So 2) somehow has the spaces escaped there, but 1) doesn't.
I guess that 1) has it right, and the rename detection just doesn't work
because the old name is outside of "url" for the svn-remote. And 2)
somehow gets it wrong, likely double-escaping the spaces or so. (I have
no idea...)
My totally uneducated guess is that git-svn fails to unescaped the path
when it splits it into the higher-level part for "url" and the rest of
it for "fetch".
HTH
Björn
^ permalink raw reply
* Re: [PATCH] add -p: do not attempt to coalesce mode changes
From: Junio C Hamano @ 2009-08-15 18:19 UTC (permalink / raw)
To: Thomas Rast; +Cc: Jeff King, Kirill Smelkov, git
In-Reply-To: <200908151635.24341.trast@student.ethz.ch>
Thomas Rast <trast@student.ethz.ch> writes:
> Hmm. I briefly considered worrying about futureproofing, but then
> decided it wasn't worth it since we also rely on
> coalesce_overlapping_hunks only being run over the hunks of a single
> file.
Thanks, all.
^ permalink raw reply
* Re: [PATCH] block-sha1/sha1.c: silence compiler complaints by casting void* to uintptr_t
From: Linus Torvalds @ 2009-08-15 18:43 UTC (permalink / raw)
To: Junio C Hamano
Cc: Brandon Casey, Johannes Schindelin, nico, git, Brandon Casey
In-Reply-To: <7v63cp22cc.fsf@alter.siamese.dyndns.org>
On Fri, 14 Aug 2009, Junio C Hamano wrote:
>
> From: Brandon Casey <drafnel@gmail.com>
> Date: Fri, 14 Aug 2009 17:52:15 -0500
> Subject: [PATCH] block-sha1/sha1.c: silence compiler complaints by casting void * to char *
>
> Some compilers produce errors when arithmetic is attempted on pointers to
> void. We want computations done on byte addresses, so cast them to char *
> to work them around.
>
> Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Unnecessary outer parentheses, but ack anyway.
Linus
^ permalink raw reply
* [JGIT PATCH] Fix update of the refs cache when updating via a symbolic ref
From: Robin Rosenberg @ 2009-08-15 18:43 UTC (permalink / raw)
To: spearce; +Cc: git, stefan.lay, Robin Rosenberg
The branch pointed to by HEAD was lost in the refs cache, i.e. the
HEAD Ref was inserted into the cache with the the peeled ref as
key instead of HEAD. Then when asking for the peeled ref name HEAD
was returned.
This only happened when the ref name was a loose ref and not in
packed-refs at all, hence we test with an unborn branch, though an
existing loose (only) ref would show the same problem.
See http://bugs.eclipse.org/285991
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
---
.../tst/org/spearce/jgit/lib/RefUpdateTest.java | 61 ++++++++++++++++++++
.../src/org/spearce/jgit/lib/RefDatabase.java | 2 +-
2 files changed, 62 insertions(+), 1 deletions(-)
I'm not posting the patch to bugzilla since this is bug in JGit and not EGit.
-- robin
diff --git a/org.spearce.jgit.test/tst/org/spearce/jgit/lib/RefUpdateTest.java b/org.spearce.jgit.test/tst/org/spearce/jgit/lib/RefUpdateTest.java
index 8df8c2a..655e54e 100644
--- a/org.spearce.jgit.test/tst/org/spearce/jgit/lib/RefUpdateTest.java
+++ b/org.spearce.jgit.test/tst/org/spearce/jgit/lib/RefUpdateTest.java
@@ -298,6 +298,67 @@ public void testUpdateRefNoChange() throws IOException {
}
/**
+ * Test case originating from
+ * <a href="http://bugs.eclipse.org/285991">bug 285991</a>
+ *
+ * Make sure the in memory cache is updated properly after
+ * update of symref. This one did not fail because the
+ * ref was packed due to implementation issues.
+ *
+ * @throws Exception
+ */
+ public void testRefsCacheAfterUpdate() throws Exception {
+ // Do not use the defalt repo for this case.
+ Map<String, Ref> allRefs = db.getAllRefs();
+ ObjectId oldValue = db.resolve("HEAD");
+ ObjectId newValue = db.resolve("HEAD^");
+ // first make HEAD refer to loose ref
+ RefUpdate updateRef = db.updateRef(Constants.HEAD);
+ updateRef.setForceUpdate(true);
+ updateRef.setNewObjectId(newValue);
+ Result update = updateRef.update();
+ assertEquals(Result.FORCED, update);
+
+ // now update that ref
+ updateRef = db.updateRef(Constants.HEAD);
+ updateRef.setForceUpdate(true);
+ updateRef.setNewObjectId(oldValue);
+ update = updateRef.update();
+ assertEquals(Result.FAST_FORWARD, update);
+ allRefs = db.getAllRefs();
+ assertEquals("refs/heads/master", allRefs.get("refs/heads/master").getName());
+ assertEquals("refs/heads/master", allRefs.get("refs/heads/master").getOrigName());
+ assertEquals("refs/heads/master", allRefs.get("HEAD").getName());
+ assertEquals("HEAD", allRefs.get("HEAD").getOrigName());
+ }
+
+ /**
+ * Test case originating from
+ * <a href="http://bugs.eclipse.org/285991">bug 285991</a>
+ *
+ * Make sure the in memory cache is updated properly after
+ * update of symref.
+ *
+ * @throws Exception
+ */
+ public void testRefsCacheAfterUpdateLoosOnly() throws Exception {
+ // Do not use the defalt repo for this case.
+ Map<String, Ref> allRefs = db.getAllRefs();
+ ObjectId oldValue = db.resolve("HEAD");
+ db.writeSymref(Constants.HEAD, "refs/heads/newref");
+ RefUpdate updateRef = db.updateRef(Constants.HEAD);
+ updateRef.setForceUpdate(true);
+ updateRef.setNewObjectId(oldValue);
+ Result update = updateRef.update();
+ assertEquals(Result.NEW, update);
+ allRefs = db.getAllRefs();
+ assertEquals("refs/heads/newref", allRefs.get("HEAD").getName());
+ assertEquals("HEAD", allRefs.get("HEAD").getOrigName());
+ assertEquals("refs/heads/newref", allRefs.get("refs/heads/newref").getName());
+ assertEquals("refs/heads/newref", allRefs.get("refs/heads/newref").getOrigName());
+ }
+
+ /**
* Try modify a ref, but get wrong expected old value
*
* @throws IOException
diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/RefDatabase.java b/org.spearce.jgit/src/org/spearce/jgit/lib/RefDatabase.java
index f7751c4..ba4b654 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/lib/RefDatabase.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/RefDatabase.java
@@ -140,7 +140,7 @@ RefUpdate newUpdate(final String name) throws IOException {
void stored(final String origName, final String name, final ObjectId id, final long time) {
synchronized (this) {
- looseRefs.put(name, new Ref(Ref.Storage.LOOSE, origName, name, id));
+ looseRefs.put(name, new Ref(Ref.Storage.LOOSE, name, name, id));
looseRefsMTime.put(name, time);
setModified();
}
--
1.6.4.115.gc0eb0
^ permalink raw reply related
* Simplify '--prett=xyz' options
From: Linus Torvalds @ 2009-08-15 19:01 UTC (permalink / raw)
To: Junio C Hamano, Git Mailing List
I keep on thinking that I can write
git log --format:'%aN: %s'
instead of using the long-form "--pretty=format:xyz' thing. And each time,
I curse myself for being stupid for forgetting the proper format.
And I'm tired of being stupid. So this patch makes me smart and
forward-thinking instead.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
---
Now I just need a patch to make me athletic and handsome.
commit.h | 1 +
pretty.c | 26 ++++++++++++++++----------
revision.c | 2 ++
3 files changed, 19 insertions(+), 10 deletions(-)
diff --git a/commit.h b/commit.h
index ba9f638..cc4229b 100644
--- a/commit.h
+++ b/commit.h
@@ -68,6 +68,7 @@ struct rev_info; /* in revision.h, it circularly uses enum cmit_fmt */
extern char *reencode_commit_message(const struct commit *commit,
const char **encoding_p);
extern void get_commit_format(const char *arg, struct rev_info *);
+extern int try_get_commit_format(const char *arg, struct rev_info *);
extern void format_commit_message(const struct commit *commit,
const void *format, struct strbuf *sb,
enum date_mode dmode);
diff --git a/pretty.c b/pretty.c
index e5328da..97d36c5 100644
--- a/pretty.c
+++ b/pretty.c
@@ -19,7 +19,7 @@ static void save_user_format(struct rev_info *rev, const char *cp, int is_tforma
rev->commit_format = CMIT_FMT_USERFORMAT;
}
-void get_commit_format(const char *arg, struct rev_info *rev)
+int try_get_commit_format(const char *arg, struct rev_info *rev)
{
int i;
static struct cmt_fmt_map {
@@ -36,14 +36,9 @@ void get_commit_format(const char *arg, struct rev_info *rev)
{ "oneline", 1, CMIT_FMT_ONELINE },
};
- rev->use_terminator = 0;
- if (!arg || !*arg) {
- rev->commit_format = CMIT_FMT_DEFAULT;
- return;
- }
if (!prefixcmp(arg, "format:") || !prefixcmp(arg, "tformat:")) {
save_user_format(rev, strchr(arg, ':') + 1, arg[0] == 't');
- return;
+ return 1;
}
for (i = 0; i < ARRAY_SIZE(cmt_fmts); i++) {
if (!strncmp(arg, cmt_fmts[i].n, cmt_fmts[i].cmp_len) &&
@@ -51,15 +46,26 @@ void get_commit_format(const char *arg, struct rev_info *rev)
if (cmt_fmts[i].v == CMIT_FMT_ONELINE)
rev->use_terminator = 1;
rev->commit_format = cmt_fmts[i].v;
- return;
+ return 1;
}
}
if (strchr(arg, '%')) {
save_user_format(rev, arg, 1);
- return;
+ return 1;
}
- die("invalid --pretty format: %s", arg);
+ return 0;
+}
+
+void get_commit_format(const char *arg, struct rev_info *rev)
+{
+ rev->use_terminator = 0;
+ if (!arg || !*arg) {
+ rev->commit_format = CMIT_FMT_DEFAULT;
+ return;
+ }
+ if (!try_get_commit_format(arg, rev))
+ die("invalid --pretty format: %s", arg);
}
/*
diff --git a/revision.c b/revision.c
index 9f5dac5..181593f 100644
--- a/revision.c
+++ b/revision.c
@@ -1192,6 +1192,8 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg
} else if (!strcmp(arg, "--children")) {
revs->children.name = "children";
revs->limited = 1;
+ } else if (!strncmp(arg, "--", 2) && try_get_commit_format(arg+2, revs)) {
+ revs->verbose_header = 1;
} else {
int opts = diff_opt_parse(&revs->diffopt, argv, argc);
if (!opts)
^ permalink raw reply related
* Re: Simplify '--prett=xyz' options
From: Thomas Rast @ 2009-08-15 19:19 UTC (permalink / raw)
To: Linus Torvalds; +Cc: Junio C Hamano, Git Mailing List
In-Reply-To: <alpine.LFD.2.01.0908151156510.3162@localhost.localdomain>
Linus Torvalds wrote:
>
> I keep on thinking that I can write
>
> git log --format:'%aN: %s'
>
> instead of using the long-form "--pretty=format:xyz' thing. And each time,
> I curse myself for being stupid for forgetting the proper format.
>
> And I'm tired of being stupid. So this patch makes me smart and
> forward-thinking instead.
But we already have --format="%aN: %s" since these two commits:
commit 36407548a2825462a91b456755412a65fd611fc0
Author: Nanako Shiraishi <nanako3@lavabit.com>
Date: Tue Feb 24 18:59:15 2009 +0900
Give short-hands to --pretty=tformat:%formatstring
Allow --pretty="%h %s" (and --format="%h %s") as shorthand for an often
used option --pretty=tformat:"%h %s".
Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
commit 3a4c1a5e212357c3df030b6713c75466694c2e77
Author: Nanako Shiraishi <nanako3@lavabit.com>
Date: Tue Feb 24 18:59:14 2009 +0900
Add --format that is a synonym to --pretty
Some people prefer to call the pretty-print styles "format", and get
annoyed to see "git log --format=short" fail. Introduce it as a synonym
to --pretty so that both can be used.
Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Granted, it makes it equivalent to --pretty=tformat:foo, but isn't
tformat the better choice in many cases?
--
Thomas Rast
trast@{inf,student}.ethz.ch
^ permalink raw reply
* Re: Simplify '--prett=xyz' options
From: Linus Torvalds @ 2009-08-15 19:50 UTC (permalink / raw)
To: Thomas Rast; +Cc: Junio C Hamano, Git Mailing List
In-Reply-To: <200908152119.56606.trast@student.ethz.ch>
On Sat, 15 Aug 2009, Thomas Rast wrote:
>
> But we already have --format="%aN: %s" since these two commits:
Yeah. Junio pointed that out.
We also have --oneline, which I actually like (but it doesn't work like
--pretty=oneline - it also enables --abbrev-commit). But then we don't
have --fuller (which is what I usually want to use when I want to see
committer info).
And "format" takes ':' when with --pretty=, but '=' when alone. Which is
what made me not notice that it worked due to silly semantic changes.And
the confusion with tformat vs format is fundamental.
> Granted, it makes it equivalent to --pretty=tformat:foo, but isn't
> tformat the better choice in many cases?
Not really. Look at what happens with
git log --stat --pretty=format:%s
and then try tformat instead. 'tformat' is broken, as is our current
--format=%s.
In other words, all of that crud is totally illogical, and our "short
versions" (--oneline and --format=) were done entirely incorrectly (well,
--oneline probably has the _right_ semantics, and --pretty=oneline is just
wrong, but whatever).
Sadly, we can't fix those things well.
But here's a fixed version of my patch that gets rid of some problems.
And our current --format= thing really _is_ fundamentaly broken, as shown
by my example above. Making it work like 'tformat' was a bug. With this,
you can say
git log --tformat=%s
if you want the stupid tformat semantics.
[ Junio, I fixed that, so this is strictly "version 3" of the patch. Now
"--format=x" works like "--pretty=format:x" and if you want tformat
semantics, you need to say "--tformat=x")
That's why the test-cases got modified with this patch - we were
actually _testing_ for that idiotic behavior of --pretty=format:x being
different from --format=x ]
I would like to also make "--pretty=oneline" have the same abbrev-commit
semantics as "--oneline" has, but I didn't actually do that change.
Linus
---
commit.h | 1 +
pretty.c | 42 +++++++++++++++++++++++++++++-------------
revision.c | 9 +++++++--
t/t4202-log.sh | 14 +++++++-------
4 files changed, 44 insertions(+), 22 deletions(-)
diff --git a/commit.h b/commit.h
index ba9f638..cc4229b 100644
--- a/commit.h
+++ b/commit.h
@@ -68,6 +68,7 @@ struct rev_info; /* in revision.h, it circularly uses enum cmit_fmt */
extern char *reencode_commit_message(const struct commit *commit,
const char **encoding_p);
extern void get_commit_format(const char *arg, struct rev_info *);
+extern int try_get_commit_format(const char *arg, struct rev_info *);
extern void format_commit_message(const struct commit *commit,
const void *format, struct strbuf *sb,
enum date_mode dmode);
diff --git a/pretty.c b/pretty.c
index e5328da..1a76320 100644
--- a/pretty.c
+++ b/pretty.c
@@ -19,7 +19,7 @@ static void save_user_format(struct rev_info *rev, const char *cp, int is_tforma
rev->commit_format = CMIT_FMT_USERFORMAT;
}
-void get_commit_format(const char *arg, struct rev_info *rev)
+int try_get_commit_format(const char *arg, struct rev_info *rev)
{
int i;
static struct cmt_fmt_map {
@@ -36,30 +36,46 @@ void get_commit_format(const char *arg, struct rev_info *rev)
{ "oneline", 1, CMIT_FMT_ONELINE },
};
- rev->use_terminator = 0;
- if (!arg || !*arg) {
- rev->commit_format = CMIT_FMT_DEFAULT;
- return;
+ if (!prefixcmp(arg, "format")) {
+ if (arg[6] == ':' || arg[6] == '=') {
+ save_user_format(rev, arg+7, 0);
+ return 1;
+ }
}
- if (!prefixcmp(arg, "format:") || !prefixcmp(arg, "tformat:")) {
- save_user_format(rev, strchr(arg, ':') + 1, arg[0] == 't');
- return;
+ if (!prefixcmp(arg, "tformat")) {
+ if (arg[7] == ':' || arg[7] == '=') {
+ save_user_format(rev, arg+8, 1);
+ return 1;
+ }
}
+
for (i = 0; i < ARRAY_SIZE(cmt_fmts); i++) {
if (!strncmp(arg, cmt_fmts[i].n, cmt_fmts[i].cmp_len) &&
!strncmp(arg, cmt_fmts[i].n, strlen(arg))) {
if (cmt_fmts[i].v == CMIT_FMT_ONELINE)
rev->use_terminator = 1;
rev->commit_format = cmt_fmts[i].v;
- return;
+ return 1;
}
}
- if (strchr(arg, '%')) {
- save_user_format(rev, arg, 1);
+
+ return 0;
+}
+
+void get_commit_format(const char *arg, struct rev_info *rev)
+{
+ rev->use_terminator = 0;
+ if (!arg || !*arg) {
+ rev->commit_format = CMIT_FMT_DEFAULT;
return;
}
-
- die("invalid --pretty format: %s", arg);
+ if (!try_get_commit_format(arg, rev)) {
+ if (strchr(arg, '%')) {
+ save_user_format(rev, arg, 0);
+ return;
+ }
+ die("invalid --pretty format: %s", arg);
+ }
}
/*
diff --git a/revision.c b/revision.c
index 9f5dac5..bdace8b 100644
--- a/revision.c
+++ b/revision.c
@@ -1123,7 +1123,7 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg
} else if (!strcmp(arg, "--pretty")) {
revs->verbose_header = 1;
get_commit_format(arg+8, revs);
- } else if (!prefixcmp(arg, "--pretty=") || !prefixcmp(arg, "--format=")) {
+ } else if (!prefixcmp(arg, "--pretty=")) {
revs->verbose_header = 1;
get_commit_format(arg+9, revs);
} else if (!strcmp(arg, "--oneline")) {
@@ -1194,8 +1194,13 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg
revs->limited = 1;
} else {
int opts = diff_opt_parse(&revs->diffopt, argv, argc);
- if (!opts)
+ if (!opts) {
+ if (!strncmp(arg, "--", 2) && try_get_commit_format(arg+2, revs)) {
+ revs->verbose_header = 1;
+ return 1;
+ }
unkv[(*unkc)++] = arg;
+ }
return opts;
}
diff --git a/t/t4202-log.sh b/t/t4202-log.sh
index 48e0088..2f1a5a5 100755
--- a/t/t4202-log.sh
+++ b/t/t4202-log.sh
@@ -44,13 +44,6 @@ test_expect_success 'pretty' '
test_cmp expect actual
'
-printf "sixth\nfifth\nfourth\nthird\nsecond\ninitial\n" > expect
-test_expect_success 'pretty (tformat)' '
-
- git log --pretty="tformat:%s" > actual &&
- test_cmp expect actual
-'
-
test_expect_success 'pretty (shortcut)' '
git log --pretty="%s" > actual &&
@@ -63,6 +56,13 @@ test_expect_success 'format' '
test_cmp expect actual
'
+printf "sixth\nfifth\nfourth\nthird\nsecond\ninitial\n" > expect
+test_expect_success 'pretty (tformat)' '
+
+ git log --pretty="tformat:%s" > actual &&
+ test_cmp expect actual
+'
+
cat > expect << EOF
804a787 sixth
394ef78 fifth
^ permalink raw reply related
* Re: Linus' sha1 is much faster!
From: Bryan Donlan @ 2009-08-15 20:02 UTC (permalink / raw)
To: Pádraig Brady
Cc: Bug-coreutils, Linus Torvalds, Git Mailing List, Brandon Casey,
Junio C Hamano, Nicolas Pitre
In-Reply-To: <4A85F270.20703@draigBrady.com>
2009/8/14 Pádraig Brady <P@draigbrady.com>:
> I've noticed before that coreutils hashing utils
> were a little behind in performance, but was prompted
> to look at it again when I noticed the recently
> updated sha1 implementation in git:
> http://git.kernel.org/?p=git/git.git;a=history;f=block-sha1;h=d3121f7;hb=pu
>
> Testing that with the attached program which I wrote
> in a couple of mins to try and match sha1sum's system calls
> shows that it's around 33% faster, as shown below:
>
> $ gcc $(rpm -q --qf="%{OPTFLAGS}\n" coreutils) linus-sha1.c sha1.c -o linus-sha1
>
> $ time ./linus-sha1 300MB_file
> df1e19e245fee4f53087b50ef953ca2c8d1644d7 300MB_file
> real 0m2.742s
> user 0m2.516s
> sys 0m0.206s
>
> $ time ~/git/coreutils/src/sha1sum 300MB_file
> df1e19e245fee4f53087b50ef953ca2c8d1644d7 300MB_file
>
> real 0m4.166s
> user 0m3.846s
> sys 0m0.298s
>
> So, could we use that code in coreutils?
> Think of all the dead fish it would save.
coreutils is licensed under GPLv3, and git under GPLv2 (only), so
you'd need permission from all contributors to the implementation in
order to relicense under GPLv3. A quick grep of the history suggests
these contributors to be:
Brandon Casey <drafnel@gmail.com>
Junio C Hamano <gitster@pobox.com>
Linus Torvalds <torvalds@linux-foundation.org>
Nicolas Pitre <nico@cam.org>
(adding these people to the CC list)
Additionally, it was originally based on the code in
mozilla-sha1/sha1.c, but that contains a license grant allowing it to
be used under GPLv2 /or later/, so if GPLv3 relicensing is enough it
shouldn't be necessary to get in contact with the original author.
However if the FSF requires copyright assignment to accept the new
implementation, it will be necessary to track down contributors to the
original mozilla-sha1/sha1.c as well.
Note that I'm not a lawyer, so there might be other roadblocks etc to
this as well, etc :)
^ permalink raw reply
* Re: Linus' sha1 is much faster!
From: John Tapsell @ 2009-08-15 20:12 UTC (permalink / raw)
To: Bryan Donlan
Cc: Pádraig Brady, Bug-coreutils, Linus Torvalds,
Git Mailing List, Brandon Casey, Junio C Hamano, Nicolas Pitre
In-Reply-To: <3e8340490908151302y33a97d50t38ad0a8a788f1cee@mail.gmail.com>
2009/8/15 Bryan Donlan <bdonlan@gmail.com>:
> coreutils is licensed under GPLv3, and git under GPLv2 (only), so
> you'd need permission from all contributors to the implementation in
> order to relicense under GPLv3. A quick grep of the history suggests
> these contributors to be:
X11 also requires a fast SHA1 implementation. It uses this to check
if two pixmaps are the same. So it would be really nice to relicense
under a liberal enough license that xorg can use it.
John
^ permalink raw reply
* Re: Simplify '--prett=xyz' options
From: Junio C Hamano @ 2009-08-15 20:16 UTC (permalink / raw)
To: Linus Torvalds; +Cc: Thomas Rast, Git Mailing List
In-Reply-To: <alpine.LFD.2.01.0908151236250.3162@localhost.localdomain>
Linus Torvalds <torvalds@linux-foundation.org> writes:
> On Sat, 15 Aug 2009, Thomas Rast wrote:
>
>> Granted, it makes it equivalent to --pretty=tformat:foo, but isn't
>> tformat the better choice in many cases?
>
> Not really. Look at what happens with
>
> git log --stat --pretty=format:%s
>
> and then try tformat instead. 'tformat' is broken, as is our current
> --format=%s.
>
> In other words, all of that crud is totally illogical, and our "short
> versions" (--oneline and --format=) were done entirely incorrectly (well,
> --oneline probably has the _right_ semantics, and --pretty=oneline is just
> wrong, but whatever).
If you try that without --stat, i.e.
$ git log -4 --pretty=format:%s | cat -e
$ git log -4 --pretty=tformat:%s | cat -e
I suspect you may then find that --pretty=format (not --pretty=tformat) is
broken.
^ permalink raw reply
* Re: Simplify '--prett=xyz' options
From: Johannes Schindelin @ 2009-08-15 20:22 UTC (permalink / raw)
To: Linus Torvalds; +Cc: Junio C Hamano, Git Mailing List
In-Reply-To: <alpine.LFD.2.01.0908151156510.3162@localhost.localdomain>
Hi,
On Sat, 15 Aug 2009, Linus Torvalds wrote:
>
> I keep on thinking that I can write
>
> git log --format:'%aN: %s'
You mean as opposed to "--format=%aN:\ %s" (which works)?
> Now I just need a patch to make me athletic and handsome.
I thought that already happened? /me remembers seeing a youtube video
with you in speedos.
> diff --git a/revision.c b/revision.c
> index 9f5dac5..181593f 100644
> --- a/revision.c
> +++ b/revision.c
> @@ -1192,6 +1192,8 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg
> } else if (!strcmp(arg, "--children")) {
> revs->children.name = "children";
> revs->limited = 1;
> + } else if (!strncmp(arg, "--", 2) && try_get_commit_format(arg+2, revs)) {
prefixcmp?
Ciao,
Dscho
^ permalink raw reply
* Re: Linus' sha1 is much faster!
From: Linus Torvalds @ 2009-08-15 20:23 UTC (permalink / raw)
To: John Tapsell
Cc: Bryan Donlan, Pádraig Brady, Bug-coreutils, Git Mailing List,
Brandon Casey, Junio C Hamano, Nicolas Pitre
In-Reply-To: <43d8ce650908151312o6a43416el27965c4b0ab8d83d@mail.gmail.com>
On Sat, 15 Aug 2009, John Tapsell wrote:
> 2009/8/15 Bryan Donlan <bdonlan@gmail.com>:
> > coreutils is licensed under GPLv3, and git under GPLv2 (only), so
> > you'd need permission from all contributors to the implementation in
> > order to relicense under GPLv3. A quick grep of the history suggests
> > these contributors to be:
>
> X11 also requires a fast SHA1 implementation. It uses this to check
> if two pixmaps are the same. So it would be really nice to relicense
> under a liberal enough license that xorg can use it.
I'm personally ok with retaining the mozilla-sha1 license.
There's not really anything _remaining_ of the mozilla code, but hey, I
started from it. In retrospect I probably should have started from the PPC
asm code that already did the blocking sanely - but that's a "20/20
hindsight" kind of thing.
Plus hey, the mozilla code being a horrid pile of crud was why I was so
convinced that I could improve on things. So that's a kind of source for
it, even if it's more about the motivational side than any actual
remaining code ;)
That said, I don't know if the MPL is ok for X11. I've not looked at
compatibility issues with MPL. For git, we could just ignore the MPL,
since the GPLv2 was acceptable regardless of it.
Linus
^ permalink raw reply
* Re: Simplify '--prett=xyz' options
From: Linus Torvalds @ 2009-08-15 20:36 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Thomas Rast, Git Mailing List
In-Reply-To: <7viqgoestz.fsf@alter.siamese.dyndns.org>
On Sat, 15 Aug 2009, Junio C Hamano wrote:
>
> If you try that without --stat, i.e.
>
> $ git log -4 --pretty=format:%s | cat -e
> $ git log -4 --pretty=tformat:%s | cat -e
>
> I suspect you may then find that --pretty=format (not --pretty=tformat) is
> broken.
I disagree. The real brokenness is that we don't have any way to say "I
want no newline at all after the format", and then having this mixup with
the whole "terminator" thing - sometimes it's "between commits" (which is
_correct_ any time you have stat info or something), and sometimes it's
"after header" (which is almost always incorrect).
For an example of this, try to do a one-line format that shows the
diffstat on the same line. IOW, what you really want is something like
git log -4 --shortstat --format=%s%NOTERM
but you can't do it at all right now - and defaulting to the "tformat"
thing is actually _worse_.
So I do agree that "format" is broken and confused. I just think that
"tformat" is EVEN MORE broken and confused, it just happens to fix that
one form of brokenness that "format" has.
Notice how "CMIT_FMT_ONELINE" use the "use_terminator" (like tformat), but
then does things right (unlike tformat). In particular, it's this one:
pp_header(fmt, abbrev, dmode, encoding, commit, &msg, sb);
if (fmt != CMIT_FMT_ONELINE && !subject) {
strbuf_addch(sb, '\n');
}
..
/* Make sure there is an EOLN for the non-oneline case */
if (fmt != CMIT_FMT_ONELINE)
strbuf_addch(sb, '\n');
and notice how we have no way to edit those from the "format" descriptors.
Linus
^ permalink raw reply
* Re: Linus' sha1 is much faster!
From: Linus Torvalds @ 2009-08-15 20:54 UTC (permalink / raw)
To: John Tapsell
Cc: Paul Kocher, Bryan Donlan, Bug-coreutils, Brandon Casey,
Junio C Hamano, Nicolas Pitre, Pádraig Brady,
Git Mailing List
In-Reply-To: <alpine.LFD.2.01.0908151315400.3162@localhost.localdomain>
On Sat, 15 Aug 2009, Linus Torvalds wrote:
>
> That said, I don't know if the MPL is ok for X11. I've not looked at
> compatibility issues with MPL. For git, we could just ignore the MPL,
> since the GPLv2 was acceptable regardless of it.
If MPL isn't ok for X11, then we'd need to make sure that even the
silliest Mozilla crud has been rewritten. There really isn't much, but
hey, the _history_ is based on the mozilla code, and who knows - the
'blk_SHA_CTX' struct has things like the fields in the same order as the
Mozilla equivalent, for all those historical reasons.
(Heh. Looking at that, I probably should move the 'size' field first,
since that would have different alignment rules, and the struct would be
more tightly packed that way, and initialize better).
Afaik, none of the actual code remains (the mozilla SHA1 thing did the
wrong thing for performance even for just the final bytes, and did those a
byte at a time etc, so I rewrote even the trivial SHA1_Final parts).
Of course, maybe the Mozilla people would be interested in taking my
faster version, and say that the new-BSD license is ok, and make everybody
happy. The only listed author for the Mozilla SHA1 is Paul Kocher. I added
him to the Cc.
Paul, for your information, we're talking about a faster rewritten "mostly
portable" SHA1 routines that you can find at
http://git.kernel.org/?p=git/git.git;a=tree;f=block-sha1;hb=pu
(follow the "blob" pointers to see sha1.c and sha1.h). I don't know if
you're active with Mozilla/Firefox or whether you even care, but you seem
to be the logical choice of person to ask.
Linus
^ permalink raw reply
* Re: Simplify '--prett=xyz' options
From: Avery Pennarun @ 2009-08-15 21:05 UTC (permalink / raw)
To: Linus Torvalds; +Cc: Junio C Hamano, Thomas Rast, Git Mailing List
In-Reply-To: <alpine.LFD.2.01.0908151324380.3162@localhost.localdomain>
On Sat, Aug 15, 2009 at 4:36 PM, Linus
Torvalds<torvalds@linux-foundation.org> wrote:
> On Sat, 15 Aug 2009, Junio C Hamano wrote:
>> If you try that without --stat, i.e.
>>
>> $ git log -4 --pretty=format:%s | cat -e
>> $ git log -4 --pretty=tformat:%s | cat -e
>>
>> I suspect you may then find that --pretty=format (not --pretty=tformat) is
>> broken.
>
> I disagree. The real brokenness is that we don't have any way to say "I
> want no newline at all after the format", and then having this mixup with
> the whole "terminator" thing - sometimes it's "between commits" (which is
> _correct_ any time you have stat info or something), and sometimes it's
> "after header" (which is almost always incorrect).
I'm guessing that "after header" was just an implementation error. It
was presumably intended to be "after commit", so that the only
difference between format and tformat is the presence or absence of
the very last terminator.
Maybe the correct fix is just to make tformat not broken?
Avery
^ permalink raw reply
* Re: jc/shortstatus
From: Junio C Hamano @ 2009-08-15 21:23 UTC (permalink / raw)
To: Jeff King; +Cc: git
In-Reply-To: <7v8whltrqj.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
> A few points I haven't managed to think about, decide, nor test, are:
>
> - What should its exit code be? Should it be consistent with the
> traditional "git status" at least when no paths are given, signallying
> failure when nothing is staged for committing, so that ancient out of
> tree scripts people may have written would not break too badly when we
> make the switch?
>
> - What should its default mode of output be? Do people prefer "svn st"
> style short-format output, or should we stay verbose and explanatory?
>
> - Is it handling corner cases correctly? e.g. Does it operate correctly
> when run from a subdirectory? How should it handle submodules? Before
> the initial commit? Use of colors?
Just a quick status update, lest others waste too much time staring at the
series I posted last night.
- Leading and trailing comments (e.g. "On branch foo", "Initial commit",
"# No changes", ...) were missing.
- Did not honor -v to show "diff --cached".
- Subdirectory behaviour (status.relativepath configuration) was broken.
I have a version that fixes the above, and exits 0 when there is no error
(i.e. does not exit non-zero on clean index). There are existing tests
that expect "git status" erroring out on clean index and there are some
that depends on "git status paths..." to show preview of a partial commit,
which needed to be replaced with "git commit --dry-run", but as far as I
can tell, I've took care of them all.
I am still feeling uneasy about the exit status change (the test scripts
are sources of how people who script around git take their inspirations
after all), but I'll send the result out for a review later without
changing that back to "exit failure when there is nothing to commit".
^ permalink raw reply
* Re: Simplify '--prett=xyz' options
From: Linus Torvalds @ 2009-08-15 21:29 UTC (permalink / raw)
To: Avery Pennarun; +Cc: Junio C Hamano, Thomas Rast, Git Mailing List
In-Reply-To: <32541b130908151405j661cde8fh9783e91cebf1e398@mail.gmail.com>
On Sat, 15 Aug 2009, Avery Pennarun wrote:
>
> I'm guessing that "after header" was just an implementation error. It
> was presumably intended to be "after commit", so that the only
> difference between format and tformat is the presence or absence of
> the very last terminator.
>
> Maybe the correct fix is just to make tformat not broken?
I do agree. 'tformat' is broken. But my point was more that 'tformat' was
introduced for all the wrong reasons (ie that 'format' was broken, and
then instead of fixing 'format', people introduced 'tformat' with a
_different_ brokenness).
Linus
^ permalink raw reply
* Re: Simplify '--prett=xyz' options
From: Linus Torvalds @ 2009-08-15 21:39 UTC (permalink / raw)
To: Thomas Rast; +Cc: Junio C Hamano, Git Mailing List
In-Reply-To: <alpine.LFD.2.01.0908151236250.3162@localhost.localdomain>
On Sat, 15 Aug 2009, Linus Torvalds wrote:
>
> I would like to also make "--pretty=oneline" have the same abbrev-commit
> semantics as "--oneline" has, but I didn't actually do that change.
Here's a patch if anybody cares.
It basically replaces the tests that do
cut -b42-
or
sed -e "s/^.\{41\}//"
(to get just the subject) with
sed -e "s/^[0-9a-f]* //"
instead (which is an already pre-existing pattern that some other tests
used).
The patch itself was trivial. The only question is whether the semantic
change is ok (it certainly makes _sense_, it's just silly how "--oneline"
is different from "--pretty=oneline").
This patch obviously depends on the previous one, since it just removes
the special-casing of "--oneline" (it now falls out automatically from the
"if you can't recognize the flag, see if it's a format flag" logic, and is
no longer a special case).
The 'format/tformat' misdesigns I've not touched.
Linus
---
pretty.c | 4 +++-
revision.c | 4 ----
t/t3413-rebase-hook.sh | 2 +-
t/t5510-fetch.sh | 2 +-
t/t6009-rev-list-parent.sh | 2 +-
t/t9108-git-svn-glob.sh | 4 ++--
t/t9109-git-svn-multi-glob.sh | 6 +++---
7 files changed, 11 insertions(+), 13 deletions(-)
diff --git a/pretty.c b/pretty.c
index 1a76320..6d0fa60 100644
--- a/pretty.c
+++ b/pretty.c
@@ -52,8 +52,10 @@ int try_get_commit_format(const char *arg, struct rev_info *rev)
for (i = 0; i < ARRAY_SIZE(cmt_fmts); i++) {
if (!strncmp(arg, cmt_fmts[i].n, cmt_fmts[i].cmp_len) &&
!strncmp(arg, cmt_fmts[i].n, strlen(arg))) {
- if (cmt_fmts[i].v == CMIT_FMT_ONELINE)
+ if (cmt_fmts[i].v == CMIT_FMT_ONELINE) {
rev->use_terminator = 1;
+ rev->abbrev_commit = 1;
+ }
rev->commit_format = cmt_fmts[i].v;
return 1;
}
diff --git a/revision.c b/revision.c
index bdace8b..b7f047a 100644
--- a/revision.c
+++ b/revision.c
@@ -1126,10 +1126,6 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg
} else if (!prefixcmp(arg, "--pretty=")) {
revs->verbose_header = 1;
get_commit_format(arg+9, revs);
- } else if (!strcmp(arg, "--oneline")) {
- revs->verbose_header = 1;
- get_commit_format("oneline", revs);
- revs->abbrev_commit = 1;
} else if (!strcmp(arg, "--graph")) {
revs->topo_order = 1;
revs->rewrite_parents = 1;
diff --git a/t/t3413-rebase-hook.sh b/t/t3413-rebase-hook.sh
index 098b755..2f14c5c 100755
--- a/t/t3413-rebase-hook.sh
+++ b/t/t3413-rebase-hook.sh
@@ -19,7 +19,7 @@ test_expect_success setup '
test_tick &&
git commit -m side &&
git checkout master &&
- git log --pretty=oneline --abbrev-commit --graph --all &&
+ git log --oneline --graph --all &&
git branch test side
'
diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh
index d13c806..62a45c0 100755
--- a/t/t5510-fetch.sh
+++ b/t/t5510-fetch.sh
@@ -168,7 +168,7 @@ test_expect_success 'bundle 1 has only 3 files ' '
test_expect_success 'unbundle 2' '
cd "$D/bundle" &&
git fetch ../bundle2 master:master &&
- test "tip" = "$(git log -1 --pretty=oneline master | cut -b42-)"
+ test "tip" = "$(git log -1 --pretty=oneline master | sed 's/^[0-9a-f]* //')"
'
test_expect_success 'bundle does not prerequisite objects' '
diff --git a/t/t6009-rev-list-parent.sh b/t/t6009-rev-list-parent.sh
index c8a96a9..9a90ce8 100755
--- a/t/t6009-rev-list-parent.sh
+++ b/t/t6009-rev-list-parent.sh
@@ -24,7 +24,7 @@ test_expect_success setup '
commit three &&
commit four &&
- git log --pretty=oneline --abbrev-commit
+ git log --oneline
'
test_expect_success 'one is ancestor of others and should not be shown' '
diff --git a/t/t9108-git-svn-glob.sh b/t/t9108-git-svn-glob.sh
index d732d31..4d386f2 100755
--- a/t/t9108-git-svn-glob.sh
+++ b/t/t9108-git-svn-glob.sh
@@ -48,7 +48,7 @@ test_expect_success 'test refspec globbing' '
"tags/*/src/a:refs/remotes/tags/*" &&
git svn multi-fetch &&
git log --pretty=oneline refs/remotes/tags/end | \
- sed -e "s/^.\{41\}//" > output.end &&
+ sed -e "s/^[0-9a-f]* //" > output.end &&
test_cmp expect.end output.end &&
test "`git rev-parse refs/remotes/tags/end~1`" = \
"`git rev-parse refs/remotes/branches/start`" &&
@@ -82,7 +82,7 @@ test_expect_success 'test left-hand-side only globbing' '
test `git rev-parse refs/remotes/two/tags/end~3` = \
`git rev-parse refs/remotes/two/branches/start` &&
git log --pretty=oneline refs/remotes/two/tags/end | \
- sed -e "s/^.\{41\}//" > output.two &&
+ sed -e "s/^[0-9a-f]* //" > output.two &&
test_cmp expect.two output.two
'
diff --git a/t/t9109-git-svn-multi-glob.sh b/t/t9109-git-svn-multi-glob.sh
index c318f9f..da93cf1 100755
--- a/t/t9109-git-svn-multi-glob.sh
+++ b/t/t9109-git-svn-multi-glob.sh
@@ -48,7 +48,7 @@ test_expect_success 'test refspec globbing' '
"tags/*/src/a:refs/remotes/tags/*" &&
git svn multi-fetch &&
git log --pretty=oneline refs/remotes/tags/end | \
- sed -e "s/^.\{41\}//" > output.end &&
+ sed -e "s/^[0-9a-f]* //" > output.end &&
test_cmp expect.end output.end &&
test "`git rev-parse refs/remotes/tags/end~1`" = \
"`git rev-parse refs/remotes/branches/v1/start`" &&
@@ -82,7 +82,7 @@ test_expect_success 'test left-hand-side only globbing' '
test `git rev-parse refs/remotes/two/tags/end~3` = \
`git rev-parse refs/remotes/two/branches/v1/start` &&
git log --pretty=oneline refs/remotes/two/tags/end | \
- sed -e "s/^.\{41\}//" > output.two &&
+ sed -e "s/^[0-9a-f]* //" > output.two &&
test_cmp expect.two output.two
'
cat > expect.four <<EOF
@@ -131,7 +131,7 @@ test_expect_success 'test another branch' '
test `git rev-parse refs/remotes/four/tags/next~2` = \
`git rev-parse refs/remotes/four/branches/v2/start` &&
git log --pretty=oneline refs/remotes/four/tags/next | \
- sed -e "s/^.\{41\}//" > output.four &&
+ sed -e "s/^[0-9a-f]* //" > output.four &&
test_cmp expect.four output.four
'
^ permalink raw reply related
* Re: git-svn bug report: %20 in http:// should translate to a space ' ' automatically
From: Tony Finch @ 2009-08-15 22:37 UTC (permalink / raw)
To: Björn Steinbrink; +Cc: Mike Smullin, Eric Wong, git
In-Reply-To: <20090815181637.GC19833@atjola.homenet>
[-- Attachment #1: Type: TEXT/PLAIN, Size: 374 bytes --]
On Sat, 15 Aug 2009, Björn Steinbrink wrote:
>
> 3) git svn clone -Tgoo "http://host/repo/path with spaces/foo/bar"
>
> Works.
Spaces are not permitted in URLs so this should be treated as a syntax
error.
Tony.
--
f.anthony.n.finch <dot@dotat.at> http://dotat.at/
GERMAN BIGHT HUMBER: SOUTHWEST 5 TO 7. MODERATE OR ROUGH. SQUALLY SHOWERS.
MODERATE OR GOOD.
^ permalink raw reply
* [PATCH 0/9] "git status" that is not "git commit --dry-run"
From: Junio C Hamano @ 2009-08-15 22:39 UTC (permalink / raw)
To: git
Here is an update relative to 7637868 (wt-status: collect untracked files
in a separate "collect" phase, 2009-08-10) that has been queued in 'next'.
[PATCH 1/9] and [PATCH 2/9] are the same from last night's fixes.
[PATCH 3/9] through [PATCH 6/9] introduce a new "git status" with
different semantics for 1.7.0 under a tentative name "git stat". They
will be squashed into one commit in the final round, as 4, 5, and 6 are
fix-ups, but are keft separate for easier review.
The new "git status" handles paths differently from the traditional
one. It used to be the preview of "git commit paths...", IOW,
"show what would happen if we try to make a partial commit of only
these paths". The new "git status" only limits the paths the output
talks about and is not a preview of anything at all anymore.
Another semantic change is that its exit status no longer says if
there is something to be committed in the index. We used to exit with
non-zero status if there is nothing to commit.
[PATCH 7/9] introduces a short format output.
The last two patches make the new "git status" official. They will be
squashed together into one commit in the final round, but are kept
separate for reviewability.
Junio C Hamano (9):
Documentation/git-commit.txt: describe --dry-run
git commit --dry-run -v: show diff in color when asked
git stat: the beginning
git stat: honor relative paths setting
git stat: show traditional status headers and trailers as well
git stat: pathspec limits, unlike traditional "git status"
git stat -s: short status output
git status: not "commit --dry-run" anymore
git-status: adjust tests
Documentation/git-commit.txt | 13 ++-
Documentation/git-status.txt | 79 +++++++++++++++++---
Makefile | 1 +
builtin-commit.c | 172 +++++++++++++++++++++++++++++++++++++-----
t/t6040-tracking-info.sh | 2 +-
t/t7060-wtstatus.sh | 8 +-
t/t7506-status-submodule.sh | 6 +-
t/t7508-status.sh | 12 ++-
wt-status.c | 10 ++-
wt-status.h | 1 +
10 files changed, 255 insertions(+), 49 deletions(-)
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox