git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] A few minor MinGW changes
@ 2009-05-23  8:04 Steffen Prohaska
  2009-05-23  8:04 ` [PATCH 1/5] MinGW: Scan for \r in addition to \n when reading shbang lines Steffen Prohaska
  0 siblings, 1 reply; 6+ messages in thread
From: Steffen Prohaska @ 2009-05-23  8:04 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, Johannes Schindelin, Johannes Sixt, Steffen Prohaska

Here are a few simple commits that are included in the msysgit
release but not in git.git.

        Steffen

Johannes Schindelin (4):
  MinGW: the path separator to split GITPERLLIB is ';' on Win32
  MinGW: use POSIX signature of waitpid()
  MinGW: Add a simple getpass()
  MinGW: Fix compiler warning in merge-recursive

Peter Harris (1):
  MinGW: Scan for \r in addition to \n when reading shbang lines

 Makefile                  |    4 +++-
 builtin-merge-recursive.c |    5 +++--
 compat/mingw.c            |   19 +++++++++++++++++--
 compat/mingw.h            |    4 +++-
 4 files changed, 26 insertions(+), 6 deletions(-)

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/5] MinGW: Scan for \r in addition to \n when reading shbang lines
  2009-05-23  8:04 [PATCH 0/5] A few minor MinGW changes Steffen Prohaska
@ 2009-05-23  8:04 ` Steffen Prohaska
  2009-05-23  8:04   ` [PATCH 2/5] MinGW: the path separator to split GITPERLLIB is ';' on Win32 Steffen Prohaska
  0 siblings, 1 reply; 6+ messages in thread
From: Steffen Prohaska @ 2009-05-23  8:04 UTC (permalink / raw)
  To: Junio C Hamano
  Cc: git, Johannes Schindelin, Johannes Sixt, Peter Harris,
	Steffen Prohaska

From: Peter Harris <git@peter.is-a-geek.org>

\r is common on Windows, so we should handle it gracefully.

Signed-off-by: Steffen Prohaska <prohaska@zib.de>
---
 compat/mingw.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/compat/mingw.c b/compat/mingw.c
index cdeda1d..b723c4d 100644
--- a/compat/mingw.c
+++ b/compat/mingw.c
@@ -525,8 +525,8 @@ static const char *parse_interpreter(const char *cmd)
 	if (buf[0] != '#' || buf[1] != '!')
 		return NULL;
 	buf[n] = '\0';
-	p = strchr(buf, '\n');
-	if (!p)
+	p = buf + strcspn(buf, "\r\n");
+	if (!*p)
 		return NULL;
 
 	*p = '\0';
-- 
1.6.3.1.54.g99dd

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/5] MinGW: the path separator to split GITPERLLIB is ';' on Win32
  2009-05-23  8:04 ` [PATCH 1/5] MinGW: Scan for \r in addition to \n when reading shbang lines Steffen Prohaska
@ 2009-05-23  8:04   ` Steffen Prohaska
  2009-05-23  8:04     ` [PATCH 3/5] MinGW: use POSIX signature of waitpid() Steffen Prohaska
  0 siblings, 1 reply; 6+ messages in thread
From: Steffen Prohaska @ 2009-05-23  8:04 UTC (permalink / raw)
  To: Junio C Hamano
  Cc: git, Johannes Schindelin, Johannes Sixt, Johannes Schindelin,
	Steffen Prohaska

From: Johannes Schindelin <johannes.schindelin@gmx.de>

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Steffen Prohaska <prohaska@zib.de>
---
 Makefile |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/Makefile b/Makefile
index 26d180c..7166760 100644
--- a/Makefile
+++ b/Makefile
@@ -225,6 +225,7 @@ ETC_GITCONFIG = etc/gitconfig
 endif
 lib = lib
 # DESTDIR=
+pathsep = :
 
 # default configuration for gitweb
 GITWEB_CONFIG = gitweb_config.perl
@@ -813,6 +814,7 @@ ifneq (,$(findstring CYGWIN,$(uname_S)))
 	UNRELIABLE_FSTAT = UnfortunatelyYes
 endif
 ifneq (,$(findstring MINGW,$(uname_S)))
+	pathsep = ;
 	NO_PREAD = YesPlease
 	NO_OPENSSL = YesPlease
 	NO_CURL = YesPlease
@@ -1268,7 +1270,7 @@ $(patsubst %.perl,%,$(SCRIPT_PERL)): % : %.perl
 	sed -e '1{' \
 	    -e '	s|#!.*perl|#!$(PERL_PATH_SQ)|' \
 	    -e '	h' \
-	    -e '	s=.*=use lib (split(/:/, $$ENV{GITPERLLIB} || "@@INSTLIBDIR@@"));=' \
+	    -e '	s=.*=use lib (split(/$(pathsep)/, $$ENV{GITPERLLIB} || "@@INSTLIBDIR@@"));=' \
 	    -e '	H' \
 	    -e '	x' \
 	    -e '}' \
-- 
1.6.3.1.54.g99dd

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 3/5] MinGW: use POSIX signature of waitpid()
  2009-05-23  8:04   ` [PATCH 2/5] MinGW: the path separator to split GITPERLLIB is ';' on Win32 Steffen Prohaska
@ 2009-05-23  8:04     ` Steffen Prohaska
  2009-05-23  8:04       ` [PATCH 4/5] MinGW: Add a simple getpass() Steffen Prohaska
  0 siblings, 1 reply; 6+ messages in thread
From: Steffen Prohaska @ 2009-05-23  8:04 UTC (permalink / raw)
  To: Junio C Hamano
  Cc: git, Johannes Schindelin, Johannes Sixt, Johannes Schindelin,
	Steffen Prohaska

From: Johannes Schindelin <johannes.schindelin@gmx.de>

Git's source code expects waitpid() to return a signed int status.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Steffen Prohaska <prohaska@zib.de>
---
 compat/mingw.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/compat/mingw.h b/compat/mingw.h
index 762eb14..b1156b8 100644
--- a/compat/mingw.h
+++ b/compat/mingw.h
@@ -109,7 +109,7 @@ static inline int mingw_unlink(const char *pathname)
 }
 #define unlink mingw_unlink
 
-static inline int waitpid(pid_t pid, unsigned *status, unsigned options)
+static inline int waitpid(pid_t pid, int *status, unsigned options)
 {
 	if (options == 0)
 		return _cwait(status, pid, 0);
-- 
1.6.3.1.54.g99dd

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 4/5] MinGW: Add a simple getpass()
  2009-05-23  8:04     ` [PATCH 3/5] MinGW: use POSIX signature of waitpid() Steffen Prohaska
@ 2009-05-23  8:04       ` Steffen Prohaska
  2009-05-23  8:04         ` [PATCH 5/5] MinGW: Fix compiler warning in merge-recursive Steffen Prohaska
  0 siblings, 1 reply; 6+ messages in thread
From: Steffen Prohaska @ 2009-05-23  8:04 UTC (permalink / raw)
  To: Junio C Hamano
  Cc: git, Johannes Schindelin, Johannes Sixt, Johannes Schindelin,
	Steffen Prohaska

From: Johannes Schindelin <johannes.schindelin@gmx.de>

We need getpass() to activate curl on MinGW.  Although the default
Makefile currently has 'NO_CURL = YesPlease', msysgit releases do
provide curl support, so getpass() is used.

[spr: - edited commit message.
      - squashed commit that provides getpass() declaration.]

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Steffen Prohaska <prohaska@zib.de>
---
 compat/mingw.c |   15 +++++++++++++++
 compat/mingw.h |    2 ++
 2 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/compat/mingw.c b/compat/mingw.c
index b723c4d..e190fdd 100644
--- a/compat/mingw.c
+++ b/compat/mingw.c
@@ -1156,3 +1156,18 @@ int link(const char *oldpath, const char *newpath)
 	}
 	return 0;
 }
+
+char *getpass(const char *prompt)
+{
+	struct strbuf buf = STRBUF_INIT;
+
+	fputs(prompt, stderr);
+	for (;;) {
+		char c = _getch();
+		if (c == '\r' || c == '\n')
+			break;
+		strbuf_addch(&buf, c);
+	}
+	fputs("\n", stderr);
+	return strbuf_detach(&buf, NULL);
+}
diff --git a/compat/mingw.h b/compat/mingw.h
index b1156b8..4c50f5b 100644
--- a/compat/mingw.h
+++ b/compat/mingw.h
@@ -38,6 +38,8 @@ struct passwd {
 	char *pw_dir;
 };
 
+extern char *getpass(const char *prompt);
+
 struct pollfd {
 	int fd;           /* file descriptor */
 	short events;     /* requested events */
-- 
1.6.3.1.54.g99dd

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 5/5] MinGW: Fix compiler warning in merge-recursive
  2009-05-23  8:04       ` [PATCH 4/5] MinGW: Add a simple getpass() Steffen Prohaska
@ 2009-05-23  8:04         ` Steffen Prohaska
  0 siblings, 0 replies; 6+ messages in thread
From: Steffen Prohaska @ 2009-05-23  8:04 UTC (permalink / raw)
  To: Junio C Hamano
  Cc: git, Johannes Schindelin, Johannes Sixt, Johannes Schindelin,
	Steffen Prohaska

From: Johannes Schindelin <johannes.schindelin@gmx.de>

GCC 4.4.0 on Windows does not like the format %zu.  It is quite unlikely,
though, that we need more merge bases than a %d can display, so replace
the %zu by a %d.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Steffen Prohaska <prohaska@zib.de>
---
 builtin-merge-recursive.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/builtin-merge-recursive.c b/builtin-merge-recursive.c
index 703045b..d26a96e 100644
--- a/builtin-merge-recursive.c
+++ b/builtin-merge-recursive.c
@@ -45,8 +45,9 @@ int cmd_merge_recursive(int argc, const char **argv, const char *prefix)
 			bases[bases_count++] = sha;
 		}
 		else
-			warning("Cannot handle more than %zu bases. "
-				"Ignoring %s.", ARRAY_SIZE(bases)-1, argv[i]);
+			warning("Cannot handle more than %d bases. "
+				"Ignoring %s.",
+				(int)ARRAY_SIZE(bases)-1, argv[i]);
 	}
 	if (argc - i != 3) /* "--" "<head>" "<remote>" */
 		die("Not handling anything other than two heads merge.");
-- 
1.6.3.1.54.g99dd

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-05-23  8:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-23  8:04 [PATCH 0/5] A few minor MinGW changes Steffen Prohaska
2009-05-23  8:04 ` [PATCH 1/5] MinGW: Scan for \r in addition to \n when reading shbang lines Steffen Prohaska
2009-05-23  8:04   ` [PATCH 2/5] MinGW: the path separator to split GITPERLLIB is ';' on Win32 Steffen Prohaska
2009-05-23  8:04     ` [PATCH 3/5] MinGW: use POSIX signature of waitpid() Steffen Prohaska
2009-05-23  8:04       ` [PATCH 4/5] MinGW: Add a simple getpass() Steffen Prohaska
2009-05-23  8:04         ` [PATCH 5/5] MinGW: Fix compiler warning in merge-recursive Steffen Prohaska

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).