From: Jonathan Nieder <jrnieder@gmail.com>
To: Nguyen Thai Ngoc Duy <pclouds@gmail.com>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>,
Nicolas Pitre <nico@fluxnic.net>, Jeff King <peff@peff.net>
Subject: [PATCH 4/3] compat: do not use relative paths to refer to git-compat-util.h et al
Date: Thu, 17 Feb 2011 22:32:31 -0600 [thread overview]
Message-ID: <20110218043231.GD15643@elie> (raw)
In-Reply-To: <20110218042916.GC15643@elie>
Constructs like '#include "../cache.h"' referring to the toplevel of
the git sources from a subdirectory make it hard to move files around.
Luckily "cache.h" works from any directory because the Makefile
supplies -I. in BASIC_CFLAGS explicitly.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
compat/basename.c | 2 +-
compat/cygwin.c | 4 ++--
compat/fopen.c | 2 +-
compat/inet_ntop.c | 2 +-
compat/inet_pton.c | 2 +-
compat/memmem.c | 2 +-
compat/mingw.c | 4 ++--
compat/mkdtemp.c | 2 +-
compat/mmap.c | 2 +-
compat/msvc.c | 4 ++--
compat/pread.c | 2 +-
compat/qsort.c | 2 +-
compat/setenv.c | 2 +-
compat/snprintf.c | 2 +-
compat/strcasestr.c | 2 +-
compat/strlcpy.c | 2 +-
compat/strtok_r.c | 2 +-
compat/strtoumax.c | 2 +-
compat/unsetenv.c | 2 +-
compat/win32/dirent.c | 2 +-
compat/win32/pthread.c | 2 +-
compat/win32/syslog.c | 4 ++--
compat/win32mmap.c | 2 +-
compat/winansi.c | 2 +-
24 files changed, 28 insertions(+), 28 deletions(-)
diff --git a/compat/basename.c b/compat/basename.c
index d8f8a3c..4382378 100644
--- a/compat/basename.c
+++ b/compat/basename.c
@@ -1,4 +1,4 @@
-#include "../git-compat-util.h"
+#include "git-compat-util.h"
/* Adapted from libiberty's basename.c. */
char *gitbasename (char *path)
diff --git a/compat/cygwin.c b/compat/cygwin.c
index b4a51b9..23c5138 100644
--- a/compat/cygwin.c
+++ b/compat/cygwin.c
@@ -1,7 +1,7 @@
#define WIN32_LEAN_AND_MEAN
-#include "../git-compat-util.h"
+#include "git-compat-util.h"
+#include "cache.h" /* to read configuration */
#include "win32.h"
-#include "../cache.h" /* to read configuration */
static inline void filetime_to_timespec(const FILETIME *ft, struct timespec *ts)
{
diff --git a/compat/fopen.c b/compat/fopen.c
index b5ca142..e777c44 100644
--- a/compat/fopen.c
+++ b/compat/fopen.c
@@ -9,7 +9,7 @@
* fopen after including git-compat-util.h is inadequate in this case.
*/
#undef FREAD_READS_DIRECTORIES
-#include "../git-compat-util.h"
+#include "git-compat-util.h"
FILE *git_fopen(const char *path, const char *mode)
{
diff --git a/compat/inet_ntop.c b/compat/inet_ntop.c
index ea249c6..d2c2b48 100644
--- a/compat/inet_ntop.c
+++ b/compat/inet_ntop.c
@@ -18,7 +18,7 @@
#include <errno.h>
#include <sys/types.h>
-#include "../git-compat-util.h"
+#include "git-compat-util.h"
#include <stdio.h>
#include <string.h>
diff --git a/compat/inet_pton.c b/compat/inet_pton.c
index 2ec995e..8ff1d9d 100644
--- a/compat/inet_pton.c
+++ b/compat/inet_pton.c
@@ -18,7 +18,7 @@
#include <errno.h>
#include <sys/types.h>
-#include "../git-compat-util.h"
+#include "git-compat-util.h"
#include <stdio.h>
#include <string.h>
diff --git a/compat/memmem.c b/compat/memmem.c
index 56bcb42..2df3e7b 100644
--- a/compat/memmem.c
+++ b/compat/memmem.c
@@ -1,4 +1,4 @@
-#include "../git-compat-util.h"
+#include "git-compat-util.h"
void *gitmemmem(const void *haystack, size_t haystack_len,
const void *needle, size_t needle_len)
diff --git a/compat/mingw.c b/compat/mingw.c
index bee6054..e43bba3 100644
--- a/compat/mingw.c
+++ b/compat/mingw.c
@@ -1,7 +1,7 @@
-#include "../git-compat-util.h"
+#include "git-compat-util.h"
+#include "strbuf.h"
#include "win32.h"
#include <conio.h>
-#include "../strbuf.h"
int err_win_to_posix(DWORD winerr)
{
diff --git a/compat/mkdtemp.c b/compat/mkdtemp.c
index 1136119..4349e15 100644
--- a/compat/mkdtemp.c
+++ b/compat/mkdtemp.c
@@ -1,4 +1,4 @@
-#include "../git-compat-util.h"
+#include "git-compat-util.h"
char *gitmkdtemp(char *template)
{
diff --git a/compat/mmap.c b/compat/mmap.c
index c9d46d1..a62533e 100644
--- a/compat/mmap.c
+++ b/compat/mmap.c
@@ -1,4 +1,4 @@
-#include "../git-compat-util.h"
+#include "git-compat-util.h"
void *git_mmap(void *start, size_t length, int prot, int flags, int fd, off_t offset)
{
diff --git a/compat/msvc.c b/compat/msvc.c
index 71843d7..e55b546 100644
--- a/compat/msvc.c
+++ b/compat/msvc.c
@@ -1,6 +1,6 @@
-#include "../git-compat-util.h"
+#include "git-compat-util.h"
+#include "strbuf.h"
#include "win32.h"
#include <conio.h>
-#include "../strbuf.h"
#include "mingw.c"
diff --git a/compat/pread.c b/compat/pread.c
index 978cac4..429f7dd 100644
--- a/compat/pread.c
+++ b/compat/pread.c
@@ -1,4 +1,4 @@
-#include "../git-compat-util.h"
+#include "git-compat-util.h"
ssize_t git_pread(int fd, void *buf, size_t count, off_t offset)
{
diff --git a/compat/qsort.c b/compat/qsort.c
index d93dce2..a490959 100644
--- a/compat/qsort.c
+++ b/compat/qsort.c
@@ -1,4 +1,4 @@
-#include "../git-compat-util.h"
+#include "git-compat-util.h"
/*
* A merge sort implementation, simplified from the qsort implementation
diff --git a/compat/setenv.c b/compat/setenv.c
index 3a22ea7..bf1016f 100644
--- a/compat/setenv.c
+++ b/compat/setenv.c
@@ -1,4 +1,4 @@
-#include "../git-compat-util.h"
+#include "git-compat-util.h"
int gitsetenv(const char *name, const char *value, int replace)
{
diff --git a/compat/snprintf.c b/compat/snprintf.c
index e1e0e75..376eeff 100644
--- a/compat/snprintf.c
+++ b/compat/snprintf.c
@@ -1,4 +1,4 @@
-#include "../git-compat-util.h"
+#include "git-compat-util.h"
/*
* The size parameter specifies the available space, i.e. includes
diff --git a/compat/strcasestr.c b/compat/strcasestr.c
index 26896de..d666093 100644
--- a/compat/strcasestr.c
+++ b/compat/strcasestr.c
@@ -1,4 +1,4 @@
-#include "../git-compat-util.h"
+#include "git-compat-util.h"
char *gitstrcasestr(const char *haystack, const char *needle)
{
diff --git a/compat/strlcpy.c b/compat/strlcpy.c
index 4024c36..780b39f 100644
--- a/compat/strlcpy.c
+++ b/compat/strlcpy.c
@@ -1,4 +1,4 @@
-#include "../git-compat-util.h"
+#include "git-compat-util.h"
size_t gitstrlcpy(char *dest, const char *src, size_t size)
{
diff --git a/compat/strtok_r.c b/compat/strtok_r.c
index 7b5d568..6eec7f8 100644
--- a/compat/strtok_r.c
+++ b/compat/strtok_r.c
@@ -17,7 +17,7 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
-#include "../git-compat-util.h"
+#include "git-compat-util.h"
/* Parse S into tokens separated by characters in DELIM.
If S is NULL, the saved pointer in SAVE_PTR is used as
diff --git a/compat/strtoumax.c b/compat/strtoumax.c
index 5541353..50fe26d 100644
--- a/compat/strtoumax.c
+++ b/compat/strtoumax.c
@@ -1,4 +1,4 @@
-#include "../git-compat-util.h"
+#include "git-compat-util.h"
uintmax_t gitstrtoumax (const char *nptr, char **endptr, int base)
{
diff --git a/compat/unsetenv.c b/compat/unsetenv.c
index eb29f5e..8f38d37 100644
--- a/compat/unsetenv.c
+++ b/compat/unsetenv.c
@@ -1,4 +1,4 @@
-#include "../git-compat-util.h"
+#include "git-compat-util.h"
void gitunsetenv (const char *name)
{
diff --git a/compat/win32/dirent.c b/compat/win32/dirent.c
index 7a0debe..038188e 100644
--- a/compat/win32/dirent.c
+++ b/compat/win32/dirent.c
@@ -1,4 +1,4 @@
-#include "../git-compat-util.h"
+#include "git-compat-util.h"
#include "dirent.h"
struct DIR {
diff --git a/compat/win32/pthread.c b/compat/win32/pthread.c
index 010e875..3b1f381 100644
--- a/compat/win32/pthread.c
+++ b/compat/win32/pthread.c
@@ -7,7 +7,7 @@
* no need for double-checking.
*/
-#include "../../git-compat-util.h"
+#include "git-compat-util.h"
#include "pthread.h"
#include <errno.h>
diff --git a/compat/win32/syslog.c b/compat/win32/syslog.c
index 42b95a9..9c4c8e2 100644
--- a/compat/win32/syslog.c
+++ b/compat/win32/syslog.c
@@ -1,5 +1,5 @@
-#include "../../git-compat-util.h"
-#include "../../strbuf.h"
+#include "git-compat-util.h"
+#include "strbuf.h"
static HANDLE ms_eventlog;
diff --git a/compat/win32mmap.c b/compat/win32mmap.c
index b58aa69..756fe8a 100644
--- a/compat/win32mmap.c
+++ b/compat/win32mmap.c
@@ -1,4 +1,4 @@
-#include "../git-compat-util.h"
+#include "git-compat-util.h"
void *git_mmap(void *start, size_t length, int prot, int flags, int fd, off_t offset)
{
diff --git a/compat/winansi.c b/compat/winansi.c
index dedce21..82a5d9c 100644
--- a/compat/winansi.c
+++ b/compat/winansi.c
@@ -2,7 +2,7 @@
* Copyright 2008 Peter Harris <git@peter.is-a-geek.org>
*/
-#include "../git-compat-util.h"
+#include "git-compat-util.h"
/*
Functions to be wrapped:
--
1.7.4.1
next prev parent reply other threads:[~2011-02-18 4:32 UTC|newest]
Thread overview: 54+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-09 15:14 [PATCH/RFC] Move test-*.c to test/ subdirectory Nguyễn Thái Ngọc Duy
2011-02-09 15:23 ` Nguyen Thai Ngoc Duy
2011-02-09 22:15 ` Junio C Hamano
2011-02-10 2:14 ` [PATCH] Move test-* to t/helper/ subdirectory Nguyễn Thái Ngọc Duy
2011-02-18 2:27 ` [RFC/PATCH 0/3] Thinning the git toplevel directory Jonathan Nieder
2011-02-18 2:31 ` [PATCH 1/3] Move libgit.a sources into a libgit/ subdirectory Jonathan Nieder
2011-02-18 3:47 ` Nguyen Thai Ngoc Duy
2011-02-18 4:14 ` Jonathan Nieder
2011-02-18 4:18 ` Jeff King
2011-02-18 5:58 ` Jonathan Nieder
2011-02-18 4:31 ` Nguyen Thai Ngoc Duy
2011-02-18 2:33 ` [PATCH 2/3] Move test-* into a test-programs/ subdirectory Jonathan Nieder
2011-02-18 2:37 ` [PATCH 3/3] Move header files into a include/ subdirectory Jonathan Nieder
2011-02-18 3:52 ` Nguyen Thai Ngoc Duy
2011-02-18 4:29 ` [RFC/PATCH 4 to 6/3] Move remaining " Jonathan Nieder
2011-02-18 4:32 ` Jonathan Nieder [this message]
2011-02-18 4:34 ` [PATCH 5/3] block-sha1: do not use relative path for git-compat-util.h Jonathan Nieder
2011-02-18 4:35 ` [PATCH 6/3] Move git-compat-util.h, strbuf.h, and cache.h to include/ Jonathan Nieder
2011-02-18 3:56 ` [RFC/PATCH 0/3] Thinning the git toplevel directory Nguyen Thai Ngoc Duy
2011-02-18 4:51 ` [RFC/PATCH 7 - 9/3] " Jonathan Nieder
2011-02-18 4:52 ` [PATCH 7/3] Move test-sha1.sh to test-programs/ Jonathan Nieder
2011-02-18 4:55 ` [PATCH 8/3] Move build helpers to scripts/ subdirectory Jonathan Nieder
2011-02-18 5:04 ` [PATCH 9/3] Move non-builtin git commands and script libraries to a subdirectory Jonathan Nieder
2011-02-18 9:25 ` [RFC/PATCH 0/3] Thinning the git toplevel directory Jonathan Nieder
2011-02-18 11:08 ` Jeff King
2011-02-18 12:33 ` Jonathan Nieder
2011-02-18 12:33 ` Nguyen Thai Ngoc Duy
2011-02-18 18:55 ` Junio C Hamano
2011-02-19 11:11 ` Jonathan Nieder
2011-02-19 23:05 ` Sverre Rabbelier
2011-02-19 23:15 ` The git_remote_helpers package (Re: [RFC/PATCH 0/3] Thinning the git toplevel directory) Jonathan Nieder
2011-02-22 15:56 ` [RFC/PATCH 0/3] Thinning the git toplevel directory Jeff King
2011-02-22 19:30 ` Junio C Hamano
2011-02-22 19:32 ` Sverre Rabbelier
2011-02-23 4:51 ` Jeff King
2011-02-23 8:29 ` Jonathan Nieder
2011-02-23 8:43 ` Jeff King
2011-02-23 9:56 ` Recursive make and variations on the theme Jonathan Nieder
2011-02-23 16:42 ` [RFC/PATCH 0/3] Thinning the git toplevel directory Junio C Hamano
2011-02-23 17:18 ` Nicolas Pitre
2011-02-23 23:09 ` Drew Northup
2011-02-24 0:14 ` Nicolas Pitre
2011-02-24 17:10 ` Drew Northup
2011-02-24 18:04 ` Nicolas Pitre
2011-02-24 19:08 ` Jeff King
2011-02-24 19:46 ` Drew Northup
2011-02-19 0:10 ` Piotr Krukowiecki
2011-02-19 0:31 ` Junio C Hamano
2011-02-19 0:50 ` Jonathan Nieder
2011-02-19 9:27 ` Piotr Krukowiecki
2011-02-19 9:24 ` Piotr Krukowiecki
2011-02-19 9:41 ` Advertising the prebuilt htmldocs and manpages Jonathan Nieder
2011-02-20 6:52 ` Junio C Hamano
2011-02-20 9:40 ` Jonathan Nieder
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110218043231.GD15643@elie \
--to=jrnieder@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=nico@fluxnic.net \
--cc=pclouds@gmail.com \
--cc=peff@peff.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.