* Re: Is it possible to use git as a remote file storage without making any local repos?
From: Avery Pennarun @ 2009-10-28 18:33 UTC (permalink / raw)
To: matvejchikov; +Cc: git
In-Reply-To: <8496f91a0910280509p49447d6egd7c07b382657c375@mail.gmail.com>
On Wed, Oct 28, 2009 at 8:09 AM, Matvejchikov Ilya
<matvejchikov@gmail.com> wrote:
> I have a remote storage server with a git-daemon running and I want to
> be able to put some data in that repo
> in a way like 'git hash-object -w <object>'. The general problem for
> me is that I don't want to create any local
> git repositories that is needed by 'pit push ...' etc.
>
> So, is it possible to use git for remote storage purposes without
> making local repository?
This functionality isn't built into git (and it might be considered a
security hole, strictly speaking, if a repository let you download any
object by default). However, it would be pretty easy to create your
own server that does this.
For example, you could make one CGI script that dumps its POST data
into a pipe to "git hash-object --stdin -w"
I've written a service similar to this at work. It's relatively
simple to do a basic version. Of course, as you get into more
complicated situations (what about multiple users updating the same
filename? merges? authentication?) it gets more complicated. But I
think everybody would want this for a different reason, so it's
unlikely that there'll ever be a single "standard" solution.
Have fun,
Avery
^ permalink raw reply
* Re: [PATCH] commit: More generous accepting of RFC-2822 footer lines.
From: David Brown @ 2009-10-28 18:17 UTC (permalink / raw)
To: Junio C Hamano; +Cc: David Brown, git@vger.kernel.org
In-Reply-To: <7vd447o0jp.fsf@alter.siamese.dyndns.org>
On Wed, Oct 28, 2009 at 11:06:50AM -0700, Junio C Hamano wrote:
> I do not think it is particularly readable to add Cc: at the end, and in a
> sense this patch encourages that practice (without the patch, the end
> result looks ugly and that has an effect to discourage people from adding
> Cc: there).
I wasn't actually even thinking of Cc: at the end. I was
thinking more of things like Acked-by:, or Bugs-fixed:, or
Patch-applied-even-though-I-dont-like-it-by:, or
like that.
David
^ permalink raw reply
* Re: [PATCH 0/3] fix "git diff --color-words -U0"
From: Junio C Hamano @ 2009-10-28 18:14 UTC (permalink / raw)
To: Markus Heidelberg; +Cc: git, Johannes Schindelin
In-Reply-To: <1256732672-11817-1-git-send-email-markus.heidelberg@web.de>
Is this a serious enough breakage that deserves to be fixed in the
maintenance track (1.6.5.X)?
^ permalink raw reply
* git svn show-ignore is excrutiatingly slow
From: Adam Spiers @ 2009-10-28 17:43 UTC (permalink / raw)
To: git mailing list
Something is badly wrong here ...
$ cd $svn_wd
$ time svn propget -R svn:ignore >/dev/null
svn propget -R svn:ignore > /dev/null 0.28s user 0.20s system 98% cpu 0.490 total
$ cd $git_wd
$ time git svn show-ignore > show-ignore.out
git svn show-ignore > show-ignore.out 20.52s user 33.69s system 1% cpu 1:23:42.17 total
That's 10,000 times slower for what is effectively the same source
tree! Admittedly the svn propget was a "warm" run and took longer the
first time around, but even so there are several orders of magnitude
difference.
I had a quick look at the code and it seemed to be doing the svn tree
recursion itself via Git::SVN::prop_walk(), which might explain why.
However I did not have time to dig deeper, so would welcome any ideas.
Thanks,
Adam
^ permalink raw reply
* Re: [PATCH 2/4] Add I18N-wrappers for low-level IO-routines
From: Jeff King @ 2009-10-28 18:10 UTC (permalink / raw)
To: Timur Sufiev; +Cc: git
In-Reply-To: <4ae886f4.0b38560a.6cfb.5ac4@mx.google.com>
On Wed, Oct 28, 2009 at 09:01:21PM +0300, Timur Sufiev wrote:
> Yes, it actually haven't made it to the list. Perhaps this was due to
> patch size: it was approx. 3300 lines long (BTW, what's the message size
> limit?) So I've rewritten the patch to make it more compact, using mingw
> approach with macros. Subj prefix for a patch series is 'PATCH I18N
> filenames v2'.
Thanks. The rules for vger are here:
http://vger.kernel.org/majordomo-info.html
The max size is 100K, but you may also be triggering something from the
taboo list accidentally.
> > 2. I seem to recall that Linus added a filename translation layer for
> > doing much more, like handling unicode normalizations (but I
> > confess I haven't looked closely at that code). Should this be part
> > of that system?
>
> I've heard nothing about that :(. Could you point me directly at Linus'
> changes?
Try looking at this series:
http://thread.gmane.org/gmane.comp.version-control.git/119222
-Peff
^ permalink raw reply
* Re: [PATCH] commit: More generous accepting of RFC-2822 footer lines.
From: Junio C Hamano @ 2009-10-28 18:06 UTC (permalink / raw)
To: David Brown; +Cc: git
In-Reply-To: <20091028171344.GA22290@quaoar.codeaurora.org>
David Brown <davidb@codeaurora.org> writes:
> From: David Brown <davidb@quicinc.com>
>
> 'git commit -s' will insert a blank line before the Signed-off-by
> line at the end of the message, unless this last line is a
> Signed-off-by line itself. Common use has other trailing lines
> at the ends of commit text, in the style of RFC2822 headers.
>
> Be more generous in considering lines to be part of this footer.
> If the last paragraph of the commit message reasonably resembles
> RFC-2822 formatted lines, don't insert that blank line.
I do not think it is particularly readable to add Cc: at the end, and in a
sense this patch encourages that practice (without the patch, the end
result looks ugly and that has an effect to discourage people from adding
Cc: there).
But this is not a strong objection. Applied.
Thanks.
^ permalink raw reply
* [PATCH I18N filenames v2 3/3] Provide compatibility with MinGW
From: Timur Sufiev @ 2009-10-28 18:01 UTC (permalink / raw)
To: git; +Cc: Timur Sufiev
In-Reply-To: <1256752900-2615-2-git-send-email-timur@iris-comp.ru>
Signed-off-by: Timur Sufiev <timur@iris-comp.ru>
---
compat/fopen.c | 5 +++--
compat/mingw.c | 37 ++++++++++++++++++++++++++++---------
compat/mingw.h | 6 +++++-
compat/mkstemps.c | 3 ++-
compat/win32.h | 13 +++++++++++--
io-i18n.c | 5 +++++
io-i18n.h | 7 +++++++
7 files changed, 61 insertions(+), 15 deletions(-)
diff --git a/compat/fopen.c b/compat/fopen.c
index b5ca142..9136a14 100644
--- a/compat/fopen.c
+++ b/compat/fopen.c
@@ -10,6 +10,7 @@
*/
#undef FREAD_READS_DIRECTORIES
#include "../git-compat-util.h"
+#include "io-i18n.h"
FILE *git_fopen(const char *path, const char *mode)
{
@@ -17,9 +18,9 @@ FILE *git_fopen(const char *path, const char *mode)
struct stat st;
if (mode[0] == 'w' || mode[0] == 'a')
- return fopen(path, mode);
+ return fopen_i18n(path, mode);
- if (!(fp = fopen(path, mode)))
+ if (!(fp = fopen_i18n(path, mode)))
return NULL;
if (fstat(fileno(fp), &st)) {
diff --git a/compat/mingw.c b/compat/mingw.c
index 6b5b5b2..2a2ebcb 100644
--- a/compat/mingw.c
+++ b/compat/mingw.c
@@ -2,7 +2,7 @@
#include "win32.h"
#include <conio.h>
#include "../strbuf.h"
-
+#include "../io-i18n.h"
#include <shellapi.h>
static int err_win_to_posix(DWORD winerr)
@@ -132,7 +132,7 @@ int mingw_open (const char *filename, int oflags, ...)
if (!strcmp(filename, "/dev/null"))
filename = "nul";
- fd = open(filename, oflags, mode);
+ fd = open_i18n(filename, oflags, mode);
if (fd < 0 && (oflags & O_CREAT) && errno == EACCES) {
DWORD attrs = GetFileAttributes(filename);
@@ -253,7 +253,7 @@ int mingw_utime (const char *file_name, const struct utimbuf *times)
int fh, rc;
/* must have write permission */
- if ((fh = open(file_name, O_RDWR | O_BINARY)) < 0)
+ if ((fh = open_i18n(file_name, O_RDWR | O_BINARY)) < 0)
return -1;
time_t_to_filetime(times->modtime, &mft);
@@ -278,7 +278,7 @@ int mkstemp(char *template)
char *filename = mktemp(template);
if (filename == NULL)
return -1;
- return open(filename, O_RDWR | O_CREAT, 0600);
+ return open_i18n(filename, O_RDWR | O_CREAT, 0600);
}
int gettimeofday(struct timeval *tv, void *tz)
@@ -519,7 +519,7 @@ static const char *parse_interpreter(const char *cmd)
if (n >= 4 && !strcasecmp(cmd+n-4, ".exe"))
return NULL;
- fd = open(cmd, O_RDONLY);
+ fd = open_i18n(cmd, O_RDONLY);
if (fd < 0)
return NULL;
n = read(fd, buf, sizeof(buf)-1);
@@ -1135,10 +1135,14 @@ sig_handler_t mingw_signal(int sig, sig_handler_t handler)
static const char *make_backslash_path(const char *path)
{
static char buf[PATH_MAX + 1];
+ char *out = filename_to_local(path);
char *c;
- if (strlcpy(buf, path, PATH_MAX) >= PATH_MAX)
- die("Too long path: %.*s", 60, path);
+ if ( strlcpy(buf, out ? out : path, PATH_MAX) >= PATH_MAX) {
+ die("Too long path: %.*s", 60, out ? out : path);
+ free(out);
+ }
+ free(out);
for (c = buf; *c; c++) {
if (*c == '/')
@@ -1158,6 +1162,9 @@ int link(const char *oldpath, const char *newpath)
{
typedef BOOL (WINAPI *T)(const char*, const char*, LPSECURITY_ATTRIBUTES);
static T create_hard_link = NULL;
+ char *old_out = filename_to_local(oldpath);
+ char *new_out = filename_to_local(newpath);
+
if (!create_hard_link) {
create_hard_link = (T) GetProcAddress(
GetModuleHandle("kernel32.dll"), "CreateHardLinkA");
@@ -1168,10 +1175,15 @@ int link(const char *oldpath, const char *newpath)
errno = ENOSYS;
return -1;
}
- if (!create_hard_link(newpath, oldpath, NULL)) {
+ if (!create_hard_link(new_out ? new_out : newpath,
+ old_out ? old_out : oldpath, NULL)) {
+ free(new_out);
+ free(old_out);
errno = err_win_to_posix(GetLastError());
return -1;
}
+ free(new_out);
+ free(old_out);
return 0;
}
@@ -1206,6 +1218,7 @@ struct dirent *mingw_readdir(DIR *dir)
WIN32_FIND_DATAA buf;
HANDLE handle;
struct mingw_DIR *mdir = (struct mingw_DIR*)dir;
+ char *out;
if (!dir->dd_handle) {
errno = EBADF; /* No set_errno for mingw */
@@ -1236,7 +1249,13 @@ struct dirent *mingw_readdir(DIR *dir)
}
/* We get here if `buf' contains valid data. */
- strcpy(dir->dd_dir.d_name, buf.cFileName);
+ out = filename_to_utf8(buf.cFileName);
+ if ( strlcpy(dir->dd_dir.d_name,
+ out ? out : buf.cFileName, FILENAME_MAX) >= FILENAME_MAX) {
+ die("Too long dir entry name: %.*s", 60,
+ out ? out : buf.cFileName);
+ free(out);
+ }
++dir->dd_stat;
/* Set file type, based on WIN32_FIND_DATA */
diff --git a/compat/mingw.h b/compat/mingw.h
index 5b5258b..2447aa7 100644
--- a/compat/mingw.h
+++ b/compat/mingw.h
@@ -1,4 +1,7 @@
+#ifndef GIT_MINGW_H
+#define GIT_MINGW_H
#include <winsock2.h>
+#include "../io-i18n.h"
/*
* things that are not available in header files
@@ -112,7 +115,7 @@ static inline int mingw_unlink(const char *pathname)
{
/* read-only files cannot be removed */
chmod(pathname, 0666);
- return unlink(pathname);
+ return unlink_i18n(pathname);
}
#define unlink mingw_unlink
@@ -273,3 +276,4 @@ struct mingw_dirent
#define readdir(x) mingw_readdir(x)
struct dirent *mingw_readdir(DIR *dir);
#endif // !NO_MINGW_REPLACE_READDIR
+#endif // GIT_MINGW_H
diff --git a/compat/mkstemps.c b/compat/mkstemps.c
index 14179c8..0cdd42d 100644
--- a/compat/mkstemps.c
+++ b/compat/mkstemps.c
@@ -1,4 +1,5 @@
#include "../git-compat-util.h"
+#include "../io-i18n.h"
/* Adapted from libiberty's mkstemp.c. */
@@ -47,7 +48,7 @@ int gitmkstemps(char *pattern, int suffix_len)
template[4] = letters[v % num_letters]; v /= num_letters;
template[5] = letters[v % num_letters]; v /= num_letters;
- fd = open(pattern, O_CREAT | O_EXCL | O_RDWR, 0600);
+ fd = open_i18n(pattern, O_CREAT | O_EXCL | O_RDWR, 0600);
if (fd > 0)
return fd;
/*
diff --git a/compat/win32.h b/compat/win32.h
index 8ce9104..f71e36d 100644
--- a/compat/win32.h
+++ b/compat/win32.h
@@ -20,8 +20,17 @@ static inline int file_attr_to_st_mode (DWORD attr)
static inline int get_file_attr(const char *fname, WIN32_FILE_ATTRIBUTE_DATA *fdata)
{
- if (GetFileAttributesExA(fname, GetFileExInfoStandard, fdata))
- return 0;
+ char *out = filename_to_local(fname);
+ int ret;
+
+ if ( out != NULL ) {
+ ret = GetFileAttributesExA(out, GetFileExInfoStandard, fdata);
+ free(out);
+ } else
+ ret = GetFileAttributesExA(fname, GetFileExInfoStandard, fdata);
+
+ if ( ret )
+ return 0;
switch (GetLastError()) {
case ERROR_ACCESS_DENIED:
diff --git a/io-i18n.c b/io-i18n.c
index ed88a68..63e88b8 100644
--- a/io-i18n.c
+++ b/io-i18n.c
@@ -84,6 +84,7 @@ char *filename_to_local(const char *filename)
#endif
}
+#ifndef __USE_MINGW_ACCESS
#undef stat
int stat_i18n(const char *filename, struct stat *buf)
{
@@ -127,6 +128,7 @@ int link_i18n(const char *oldname, const char *newname)
free(new_out);
return ret;
}
+#endif // __USE_MINGW_ACCESS
#undef open
int open_i18n(const char *filename, int flags, ...)
@@ -165,6 +167,8 @@ int unlink_i18n(const char *filename)
return ret;
}
+#if !defined(__USE_MINGW_ACCESS) || \
+ (defined(__USE_MINGW_ACCESS) && defined(NO_MINGW_REPLACE_READDIR))
#undef readdir
struct dirent *readdir_i18n(DIR * dirstream)
{
@@ -187,6 +191,7 @@ struct dirent *readdir_i18n(DIR * dirstream)
} else
return NULL;
}
+#endif
#undef opendir
DIR *opendir_i18n(const char *dirname)
diff --git a/io-i18n.h b/io-i18n.h
index 2369d31..38f73b3 100644
--- a/io-i18n.h
+++ b/io-i18n.h
@@ -23,11 +23,18 @@ int unlink_i18n(const char *filename);
#define opendir(a) opendir_i18n(a)
#define fopen(a, b) fopen_i18n(a, b)
#define chmod(a, b) chmod_i18n(a, b)
+
+#ifndef __USE_MINGW_ACCESS
#define open open_i18n
#define stat(a, b) stat_i18n(a, b)
#define lstat(a, b) lstat_i18n(a, b)
#define readdir(a) readdir_i18n(a)
#define unlink(a) unlink_i18n(a)
#define link(a, b) link_i18n(a, b)
+#endif // __USE_MINGW_ACCESS
+
+#if defined(__USE_MINGW_ACCESS) && defined(NO_MINGW_REPLACE_READDIR)
+#define readdir(a) readdir_i18n(a)
+#endif
#endif /* GIT_IO_I18N_H */
--
1.6.5.1
^ permalink raw reply related
* [PATCH I18N filenames v2 2/3] Use I18N-wrappers everywhere in Git
From: Timur Sufiev @ 2009-10-28 18:01 UTC (permalink / raw)
To: git; +Cc: Timur Sufiev
In-Reply-To: <1256752900-2615-1-git-send-email-timur@iris-comp.ru>
Signed-off-by: Timur Sufiev <timur@iris-comp.ru>
---
abspath.c | 1 +
attr.c | 1 +
bisect.c | 1 +
branch.c | 1 +
builtin-add.c | 1 +
builtin-apply.c | 1 +
builtin-archive.c | 1 +
builtin-blame.c | 1 +
builtin-clean.c | 1 +
builtin-clone.c | 1 +
builtin-commit.c | 1 +
builtin-count-objects.c | 1 +
builtin-diff.c | 1 +
builtin-fast-export.c | 1 +
builtin-fetch--tool.c | 1 +
builtin-fetch-pack.c | 1 +
builtin-fetch.c | 1 +
builtin-fmt-merge-msg.c | 1 +
builtin-fsck.c | 1 +
builtin-gc.c | 1 +
builtin-grep.c | 1 +
builtin-help.c | 1 +
builtin-init-db.c | 1 +
builtin-ls-files.c | 1 +
builtin-mailinfo.c | 1 +
builtin-mailsplit.c | 1 +
builtin-merge-file.c | 1 +
builtin-merge.c | 1 +
builtin-mv.c | 1 +
builtin-pack-objects.c | 1 +
builtin-prune-packed.c | 1 +
builtin-prune.c | 1 +
builtin-reflog.c | 1 +
builtin-remote.c | 1 +
builtin-rerere.c | 1 +
builtin-rm.c | 1 +
builtin-tag.c | 1 +
builtin-update-index.c | 1 +
builtin-verify-tag.c | 1 +
bundle.c | 1 +
check-racy.c | 1 +
combine-diff.c | 1 +
commit.c | 1 +
config.c | 1 +
copy.c | 1 +
daemon.c | 1 +
diff-lib.c | 1 +
diff-no-index.c | 1 +
diff.c | 1 +
diffcore-order.c | 1 +
dir.c | 1 +
entry.c | 1 +
fast-import.c | 1 +
hash-object.c | 1 +
help.c | 1 +
http.c | 1 +
index-pack.c | 1 +
ll-merge.c | 1 +
lockfile.c | 1 +
mailmap.c | 1 +
merge-recursive.c | 1 +
pack-write.c | 1 +
path.c | 1 +
preload-index.c | 1 +
read-cache.c | 1 +
refs.c | 1 +
remote.c | 1 +
rerere.c | 1 +
server-info.c | 1 +
setup.c | 1 +
sha1_file.c | 1 +
sha1_name.c | 1 +
shallow.c | 1 +
strbuf.c | 1 +
symlinks.c | 1 +
test-chmtime.c | 1 +
test-delta.c | 1 +
trace.c | 1 +
transport.c | 1 +
unpack-trees.c | 1 +
wrapper.c | 1 +
xdiff-interface.c | 1 +
82 files changed, 82 insertions(+), 0 deletions(-)
diff --git a/abspath.c b/abspath.c
index b88122c..b672c18 100644
--- a/abspath.c
+++ b/abspath.c
@@ -1,4 +1,5 @@
#include "cache.h"
+#include "io-i18n.h"
/*
* Do not use this for inspecting *tracked* content. When path is a
diff --git a/attr.c b/attr.c
index 55bdb7c..6422254 100644
--- a/attr.c
+++ b/attr.c
@@ -1,6 +1,7 @@
#define NO_THE_INDEX_COMPATIBILITY_MACROS
#include "cache.h"
#include "attr.h"
+#include "io-i18n.h"
const char git_attr__true[] = "(builtin)true";
const char git_attr__false[] = "\0(builtin)false";
diff --git a/bisect.c b/bisect.c
index dc18db8..fe9fbb5 100644
--- a/bisect.c
+++ b/bisect.c
@@ -9,6 +9,7 @@
#include "run-command.h"
#include "log-tree.h"
#include "bisect.h"
+#include "io-i18n.h"
struct sha1_array {
unsigned char (*sha1)[20];
diff --git a/branch.c b/branch.c
index 05ef3f5..1569809 100644
--- a/branch.c
+++ b/branch.c
@@ -3,6 +3,7 @@
#include "refs.h"
#include "remote.h"
#include "commit.h"
+#include "io-i18n.h"
struct tracking {
struct refspec spec;
diff --git a/builtin-add.c b/builtin-add.c
index cb6e590..027170c 100644
--- a/builtin-add.c
+++ b/builtin-add.c
@@ -12,6 +12,7 @@
#include "parse-options.h"
#include "diff.h"
#include "revision.h"
+#include "io-i18n.h"
static const char * const builtin_add_usage[] = {
"git add [options] [--] <filepattern>...",
diff --git a/builtin-apply.c b/builtin-apply.c
index f667368..7d2f4f4 100644
--- a/builtin-apply.c
+++ b/builtin-apply.c
@@ -15,6 +15,7 @@
#include "string-list.h"
#include "dir.h"
#include "parse-options.h"
+#include "io-i18n.h"
/*
* --check turns on checking that the working tree matches the
diff --git a/builtin-archive.c b/builtin-archive.c
index 12351e9..528676e 100644
--- a/builtin-archive.c
+++ b/builtin-archive.c
@@ -8,6 +8,7 @@
#include "parse-options.h"
#include "pkt-line.h"
#include "sideband.h"
+#include "io-i18n.h"
static void create_output_file(const char *output_file)
{
diff --git a/builtin-blame.c b/builtin-blame.c
index 7512773..d349198 100644
--- a/builtin-blame.c
+++ b/builtin-blame.c
@@ -20,6 +20,7 @@
#include "mailmap.h"
#include "parse-options.h"
#include "utf8.h"
+#include "io-i18n.h"
static char blame_usage[] = "git blame [options] [rev-opts] [rev] [--] file";
diff --git a/builtin-clean.c b/builtin-clean.c
index 28cdcd0..37293f7 100644
--- a/builtin-clean.c
+++ b/builtin-clean.c
@@ -11,6 +11,7 @@
#include "dir.h"
#include "parse-options.h"
#include "quote.h"
+#include "io-i18n.h"
static int force = -1; /* unset */
diff --git a/builtin-clone.c b/builtin-clone.c
index 5762a6f..5949438 100644
--- a/builtin-clone.c
+++ b/builtin-clone.c
@@ -23,6 +23,7 @@
#include "branch.h"
#include "remote.h"
#include "run-command.h"
+#include "io-i18n.h"
/*
* Overall FIXMEs:
diff --git a/builtin-commit.c b/builtin-commit.c
index 200ffda..a124d88 100644
--- a/builtin-commit.c
+++ b/builtin-commit.c
@@ -24,6 +24,7 @@
#include "string-list.h"
#include "rerere.h"
#include "unpack-trees.h"
+#include "io-i18n.h"
static const char * const builtin_commit_usage[] = {
"git commit [options] [--] <filepattern>...",
diff --git a/builtin-count-objects.c b/builtin-count-objects.c
index 1b0b6c8..dde93dc 100644
--- a/builtin-count-objects.c
+++ b/builtin-count-objects.c
@@ -8,6 +8,7 @@
#include "dir.h"
#include "builtin.h"
#include "parse-options.h"
+#include "io-i18n.h"
static void count_objects(DIR *d, char *path, int len, int verbose,
unsigned long *loose,
diff --git a/builtin-diff.c b/builtin-diff.c
index ffcdd05..49748f0 100644
--- a/builtin-diff.c
+++ b/builtin-diff.c
@@ -13,6 +13,7 @@
#include "revision.h"
#include "log-tree.h"
#include "builtin.h"
+#include "io-i18n.h"
struct blobinfo {
unsigned char sha1[20];
diff --git a/builtin-fast-export.c b/builtin-fast-export.c
index b0a4029..932b964 100644
--- a/builtin-fast-export.c
+++ b/builtin-fast-export.c
@@ -16,6 +16,7 @@
#include "string-list.h"
#include "utf8.h"
#include "parse-options.h"
+#include "io-i18n.h"
static const char *fast_export_usage[] = {
"git fast-export [rev-list-opts]",
diff --git a/builtin-fetch--tool.c b/builtin-fetch--tool.c
index 3dbdf7a..91b774d 100644
--- a/builtin-fetch--tool.c
+++ b/builtin-fetch--tool.c
@@ -3,6 +3,7 @@
#include "refs.h"
#include "commit.h"
#include "sigchain.h"
+#include "io-i18n.h"
static char *get_stdin(void)
{
diff --git a/builtin-fetch-pack.c b/builtin-fetch-pack.c
index 629735f..aecc2f4 100644
--- a/builtin-fetch-pack.c
+++ b/builtin-fetch-pack.c
@@ -9,6 +9,7 @@
#include "fetch-pack.h"
#include "remote.h"
#include "run-command.h"
+#include "io-i18n.h"
static int transfer_unpack_limit = -1;
static int fetch_unpack_limit = -1;
diff --git a/builtin-fetch.c b/builtin-fetch.c
index a35a6f8..14e7f79 100644
--- a/builtin-fetch.c
+++ b/builtin-fetch.c
@@ -11,6 +11,7 @@
#include "run-command.h"
#include "parse-options.h"
#include "sigchain.h"
+#include "io-i18n.h"
static const char * const builtin_fetch_usage[] = {
"git fetch [options] [<repository> <refspec>...]",
diff --git a/builtin-fmt-merge-msg.c b/builtin-fmt-merge-msg.c
index 9d52400..c002968 100644
--- a/builtin-fmt-merge-msg.c
+++ b/builtin-fmt-merge-msg.c
@@ -4,6 +4,7 @@
#include "diff.h"
#include "revision.h"
#include "tag.h"
+#include "io-i18n.h"
static const char * const fmt_merge_msg_usage[] = {
"git fmt-merge-msg [--log|--no-log] [--file <file>]",
diff --git a/builtin-fsck.c b/builtin-fsck.c
index 2d88e45..67d0826 100644
--- a/builtin-fsck.c
+++ b/builtin-fsck.c
@@ -11,6 +11,7 @@
#include "fsck.h"
#include "parse-options.h"
#include "dir.h"
+#include "io-i18n.h"
#define REACHABLE 0x0001
#define SEEN 0x0002
diff --git a/builtin-gc.c b/builtin-gc.c
index 093517e..e66c817 100644
--- a/builtin-gc.c
+++ b/builtin-gc.c
@@ -14,6 +14,7 @@
#include "cache.h"
#include "parse-options.h"
#include "run-command.h"
+#include "io-i18n.h"
#define FAILED_RUN "failed to run %s"
diff --git a/builtin-grep.c b/builtin-grep.c
index 1df25b0..3f37fab 100644
--- a/builtin-grep.c
+++ b/builtin-grep.c
@@ -14,6 +14,7 @@
#include "userdiff.h"
#include "grep.h"
#include "quote.h"
+#include "io-i18n.h"
#ifndef NO_EXTERNAL_GREP
#ifdef __unix__
diff --git a/builtin-help.c b/builtin-help.c
index e1eba77..7d54179 100644
--- a/builtin-help.c
+++ b/builtin-help.c
@@ -10,6 +10,7 @@
#include "parse-options.h"
#include "run-command.h"
#include "help.h"
+#include "io-i18n.h"
static struct man_viewer_list {
struct man_viewer_list *next;
diff --git a/builtin-init-db.c b/builtin-init-db.c
index dd84cae..61b3f28 100644
--- a/builtin-init-db.c
+++ b/builtin-init-db.c
@@ -7,6 +7,7 @@
#include "builtin.h"
#include "exec_cmd.h"
#include "parse-options.h"
+#include "io-i18n.h"
#ifndef DEFAULT_GIT_TEMPLATE_DIR
#define DEFAULT_GIT_TEMPLATE_DIR "/usr/share/git-core/templates"
diff --git a/builtin-ls-files.c b/builtin-ls-files.c
index c5c0407..3669d37 100644
--- a/builtin-ls-files.c
+++ b/builtin-ls-files.c
@@ -11,6 +11,7 @@
#include "builtin.h"
#include "tree.h"
#include "parse-options.h"
+#include "io-i18n.h"
static int abbrev;
static int show_deleted;
diff --git a/builtin-mailinfo.c b/builtin-mailinfo.c
index c90cd31..a5f6160 100644
--- a/builtin-mailinfo.c
+++ b/builtin-mailinfo.c
@@ -6,6 +6,7 @@
#include "builtin.h"
#include "utf8.h"
#include "strbuf.h"
+#include "io-i18n.h"
static FILE *cmitmsg, *patchfile, *fin, *fout;
diff --git a/builtin-mailsplit.c b/builtin-mailsplit.c
index dfe5b15..637a0f9 100644
--- a/builtin-mailsplit.c
+++ b/builtin-mailsplit.c
@@ -8,6 +8,7 @@
#include "builtin.h"
#include "string-list.h"
#include "strbuf.h"
+#include "io-i18n.h"
static const char git_mailsplit_usage[] =
"git mailsplit [-d<prec>] [-f<n>] [-b] -o<directory> [<mbox>|<Maildir>...]";
diff --git a/builtin-merge-file.c b/builtin-merge-file.c
index afd2ea7..d986758 100644
--- a/builtin-merge-file.c
+++ b/builtin-merge-file.c
@@ -3,6 +3,7 @@
#include "xdiff/xdiff.h"
#include "xdiff-interface.h"
#include "parse-options.h"
+#include "io-i18n.h"
static const char *const merge_file_usage[] = {
"git merge-file [options] [-L name1 [-L orig [-L name2]]] file1 orig_file file2",
diff --git a/builtin-merge.c b/builtin-merge.c
index b6b8428..2759c25 100644
--- a/builtin-merge.c
+++ b/builtin-merge.c
@@ -24,6 +24,7 @@
#include "rerere.h"
#include "help.h"
#include "merge-recursive.h"
+#include "io-i18n.h"
#define DEFAULT_TWOHEAD (1<<0)
#define DEFAULT_OCTOPUS (1<<1)
diff --git a/builtin-mv.c b/builtin-mv.c
index 1b20028..8ce8dfd 100644
--- a/builtin-mv.c
+++ b/builtin-mv.c
@@ -9,6 +9,7 @@
#include "cache-tree.h"
#include "string-list.h"
#include "parse-options.h"
+#include "io-i18n.h"
static const char * const builtin_mv_usage[] = {
"git mv [options] <source>... <destination>",
diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c
index 02f9246..2fe3e64 100644
--- a/builtin-pack-objects.c
+++ b/builtin-pack-objects.c
@@ -16,6 +16,7 @@
#include "list-objects.h"
#include "progress.h"
#include "refs.h"
+#include "io-i18n.h"
#ifdef THREADED_DELTA_SEARCH
#include "thread-utils.h"
diff --git a/builtin-prune-packed.c b/builtin-prune-packed.c
index be99eb0..30f5a8a 100644
--- a/builtin-prune-packed.c
+++ b/builtin-prune-packed.c
@@ -2,6 +2,7 @@
#include "cache.h"
#include "progress.h"
#include "parse-options.h"
+#include "io-i18n.h"
static const char * const prune_packed_usage[] = {
"git prune-packed [-n|--dry-run] [-q|--quiet]",
diff --git a/builtin-prune.c b/builtin-prune.c
index 8459aec..bfb7eee 100644
--- a/builtin-prune.c
+++ b/builtin-prune.c
@@ -6,6 +6,7 @@
#include "reachable.h"
#include "parse-options.h"
#include "dir.h"
+#include "io-i18n.h"
static const char * const prune_usage[] = {
"git prune [-n] [-v] [--expire <time>] [--] [<head>...]",
diff --git a/builtin-reflog.c b/builtin-reflog.c
index e23b5ef..b8b637e 100644
--- a/builtin-reflog.c
+++ b/builtin-reflog.c
@@ -7,6 +7,7 @@
#include "diff.h"
#include "revision.h"
#include "reachable.h"
+#include "io-i18n.h"
/*
* reflog expire
diff --git a/builtin-remote.c b/builtin-remote.c
index 0777dd7..95ba635 100644
--- a/builtin-remote.c
+++ b/builtin-remote.c
@@ -6,6 +6,7 @@
#include "strbuf.h"
#include "run-command.h"
#include "refs.h"
+#include "io-i18n.h"
static const char * const builtin_remote_usage[] = {
"git remote [-v | --verbose]",
diff --git a/builtin-rerere.c b/builtin-rerere.c
index adfb7b5..d3e29e0 100644
--- a/builtin-rerere.c
+++ b/builtin-rerere.c
@@ -5,6 +5,7 @@
#include "rerere.h"
#include "xdiff/xdiff.h"
#include "xdiff-interface.h"
+#include "io-i18n.h"
static const char git_rerere_usage[] =
"git rerere [clear | status | diff | gc]";
diff --git a/builtin-rm.c b/builtin-rm.c
index 57975db..a4ba0cd 100644
--- a/builtin-rm.c
+++ b/builtin-rm.c
@@ -9,6 +9,7 @@
#include "cache-tree.h"
#include "tree-walk.h"
#include "parse-options.h"
+#include "io-i18n.h"
static const char * const builtin_rm_usage[] = {
"git rm [options] [--] <file>...",
diff --git a/builtin-tag.c b/builtin-tag.c
index c479018..fd42072 100644
--- a/builtin-tag.c
+++ b/builtin-tag.c
@@ -12,6 +12,7 @@
#include "tag.h"
#include "run-command.h"
#include "parse-options.h"
+#include "io-i18n.h"
static const char * const git_tag_usage[] = {
"git tag [-a|-s|-u <key-id>] [-f] [-m <msg>|-F <file>] <tagname> [<head>]",
diff --git a/builtin-update-index.c b/builtin-update-index.c
index 92beaaf..0dab755 100644
--- a/builtin-update-index.c
+++ b/builtin-update-index.c
@@ -9,6 +9,7 @@
#include "tree-walk.h"
#include "builtin.h"
#include "refs.h"
+#include "io-i18n.h"
/*
* Default to not allowing changes to the list of files. The
diff --git a/builtin-verify-tag.c b/builtin-verify-tag.c
index 9f482c2..6271aaf 100644
--- a/builtin-verify-tag.c
+++ b/builtin-verify-tag.c
@@ -11,6 +11,7 @@
#include "run-command.h"
#include <signal.h>
#include "parse-options.h"
+#include "io-i18n.h"
static const char * const verify_tag_usage[] = {
"git verify-tag [-v|--verbose] <tag>...",
diff --git a/bundle.c b/bundle.c
index df95e15..46e6b9e 100644
--- a/bundle.c
+++ b/bundle.c
@@ -7,6 +7,7 @@
#include "list-objects.h"
#include "run-command.h"
#include "refs.h"
+#include "io-i18n.h"
static const char bundle_signature[] = "# v2 git bundle\n";
diff --git a/check-racy.c b/check-racy.c
index 00d92a1..05eeedf 100644
--- a/check-racy.c
+++ b/check-racy.c
@@ -1,4 +1,5 @@
#include "cache.h"
+#include "io-i18n.h"
int main(int ac, char **av)
{
diff --git a/combine-diff.c b/combine-diff.c
index 5b63af1..1d6eb1c 100644
--- a/combine-diff.c
+++ b/combine-diff.c
@@ -7,6 +7,7 @@
#include "xdiff-interface.h"
#include "log-tree.h"
#include "refs.h"
+#include "io-i18n.h"
static struct combine_diff_path *intersect_paths(struct combine_diff_path *curr, int n, int num_parent)
{
diff --git a/commit.c b/commit.c
index fedbd5e..cbdc8c3 100644
--- a/commit.c
+++ b/commit.c
@@ -5,6 +5,7 @@
#include "utf8.h"
#include "diff.h"
#include "revision.h"
+#include "io-i18n.h"
int save_commit_buffer = 1;
diff --git a/config.c b/config.c
index 2be6531..9826eff 100644
--- a/config.c
+++ b/config.c
@@ -7,6 +7,7 @@
*/
#include "cache.h"
#include "exec_cmd.h"
+#include "io-i18n.h"
#define MAXNAME (256)
diff --git a/copy.c b/copy.c
index a7f58fd..de64127 100644
--- a/copy.c
+++ b/copy.c
@@ -1,4 +1,5 @@
#include "cache.h"
+#include "io-i18n.h"
int copy_fd(int ifd, int ofd)
{
diff --git a/daemon.c b/daemon.c
index 1b5ada6..42f70e5 100644
--- a/daemon.c
+++ b/daemon.c
@@ -3,6 +3,7 @@
#include "exec_cmd.h"
#include "run-command.h"
#include "strbuf.h"
+#include "io-i18n.h"
#include <syslog.h>
diff --git a/diff-lib.c b/diff-lib.c
index 0c74ef5..988baee 100644
--- a/diff-lib.c
+++ b/diff-lib.c
@@ -10,6 +10,7 @@
#include "cache-tree.h"
#include "unpack-trees.h"
#include "refs.h"
+#include "io-i18n.h"
/*
* diff-files
diff --git a/diff-no-index.c b/diff-no-index.c
index 4ebc1db..b12ad8f 100644
--- a/diff-no-index.c
+++ b/diff-no-index.c
@@ -15,6 +15,7 @@
#include "log-tree.h"
#include "builtin.h"
#include "string-list.h"
+#include "io-i18n.h"
static int read_directory(const char *path, struct string_list *list)
{
diff --git a/diff.c b/diff.c
index b0c7e61..b875429 100644
--- a/diff.c
+++ b/diff.c
@@ -13,6 +13,7 @@
#include "utf8.h"
#include "userdiff.h"
#include "sigchain.h"
+#include "io-i18n.h"
#ifdef NO_FAST_WORKING_DIRECTORY
#define FAST_WORKING_DIRECTORY 0
diff --git a/diffcore-order.c b/diffcore-order.c
index 23e9385..6ce4d4a 100644
--- a/diffcore-order.c
+++ b/diffcore-order.c
@@ -4,6 +4,7 @@
#include "cache.h"
#include "diff.h"
#include "diffcore.h"
+#include "io-i18n.h"
static char **order;
static int order_cnt;
diff --git a/dir.c b/dir.c
index d0999ba..8bbee16 100644
--- a/dir.c
+++ b/dir.c
@@ -8,6 +8,7 @@
#include "cache.h"
#include "dir.h"
#include "refs.h"
+#include "io-i18n.h"
struct path_simplify {
int len;
diff --git a/entry.c b/entry.c
index 06d24f1..b01a23b 100644
--- a/entry.c
+++ b/entry.c
@@ -1,6 +1,7 @@
#include "cache.h"
#include "blob.h"
#include "dir.h"
+#include "io-i18n.h"
static void create_directories(const char *path, int path_len,
const struct checkout *state)
diff --git a/fast-import.c b/fast-import.c
index 6faaaac..97d010d 100644
--- a/fast-import.c
+++ b/fast-import.c
@@ -152,6 +152,7 @@ Format of STDIN stream:
#include "csum-file.h"
#include "quote.h"
#include "exec_cmd.h"
+#include "io-i18n.h"
#define PACK_ID_BITS 16
#define MAX_PACK_ID ((1<<PACK_ID_BITS)-1)
diff --git a/hash-object.c b/hash-object.c
index 9455dd0..0f17bbd 100644
--- a/hash-object.c
+++ b/hash-object.c
@@ -9,6 +9,7 @@
#include "quote.h"
#include "parse-options.h"
#include "exec_cmd.h"
+#include "io-i18n.h"
static void hash_fd(int fd, const char *type, int write_object, const char *path)
{
diff --git a/help.c b/help.c
index e8db31f..fcbb8c0 100644
--- a/help.c
+++ b/help.c
@@ -3,6 +3,7 @@
#include "exec_cmd.h"
#include "levenshtein.h"
#include "help.h"
+#include "io-i18n.h"
/* most GUI terminals set COLUMNS (although some don't export it) */
static int term_columns(void)
diff --git a/http.c b/http.c
index 23b2a19..d064f58 100644
--- a/http.c
+++ b/http.c
@@ -1,5 +1,6 @@
#include "http.h"
#include "pack.h"
+#include "io-i18n.h"
int data_received;
int active_requests;
diff --git a/index-pack.c b/index-pack.c
index b4f8278..2ae89c4 100644
--- a/index-pack.c
+++ b/index-pack.c
@@ -9,6 +9,7 @@
#include "progress.h"
#include "fsck.h"
#include "exec_cmd.h"
+#include "io-i18n.h"
static const char index_pack_usage[] =
"git index-pack [-v] [-o <index-file>] [{ ---keep | --keep=<msg> }] [--strict] { <pack-file> | --stdin [--fix-thin] [<pack-file>] }";
diff --git a/ll-merge.c b/ll-merge.c
index 2d6b6d6..beff7a9 100644
--- a/ll-merge.c
+++ b/ll-merge.c
@@ -9,6 +9,7 @@
#include "xdiff-interface.h"
#include "run-command.h"
#include "ll-merge.h"
+#include "io-i18n.h"
struct ll_merge_driver;
diff --git a/lockfile.c b/lockfile.c
index 6851fa5..fea9f4c 100644
--- a/lockfile.c
+++ b/lockfile.c
@@ -3,6 +3,7 @@
*/
#include "cache.h"
#include "sigchain.h"
+#include "io-i18n.h"
static struct lock_file *lock_file_list;
static const char *alternate_index_output;
diff --git a/mailmap.c b/mailmap.c
index f167c00..7239fb7 100644
--- a/mailmap.c
+++ b/mailmap.c
@@ -1,6 +1,7 @@
#include "cache.h"
#include "string-list.h"
#include "mailmap.h"
+#include "io-i18n.h"
#define DEBUG_MAILMAP 0
#if DEBUG_MAILMAP
diff --git a/merge-recursive.c b/merge-recursive.c
index f55b7eb..3258c49 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -19,6 +19,7 @@
#include "attr.h"
#include "merge-recursive.h"
#include "dir.h"
+#include "io-i18n.h"
static struct tree *shift_tree_object(struct tree *one, struct tree *two)
{
diff --git a/pack-write.c b/pack-write.c
index 741efcd..00d2c4a 100644
--- a/pack-write.c
+++ b/pack-write.c
@@ -1,6 +1,7 @@
#include "cache.h"
#include "pack.h"
#include "csum-file.h"
+#include "io-i18n.h"
uint32_t pack_idx_default_version = 2;
uint32_t pack_idx_off32_limit = 0x7fffffff;
diff --git a/path.c b/path.c
index 047fdb0..b598190 100644
--- a/path.c
+++ b/path.c
@@ -11,6 +11,7 @@
* which is what it's designed for.
*/
#include "cache.h"
+#include "io-i18n.h"
static char bad_path[] = "/bad-path/";
diff --git a/preload-index.c b/preload-index.c
index 9289933..bfab0c3 100644
--- a/preload-index.c
+++ b/preload-index.c
@@ -2,6 +2,7 @@
* Copyright (C) 2008 Linus Torvalds
*/
#include "cache.h"
+#include "io-i18n.h"
#ifdef NO_PTHREADS
static void preload_index(struct index_state *index, const char **pathspec)
diff --git a/read-cache.c b/read-cache.c
index 1bbaf1c..cc06da2 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -14,6 +14,7 @@
#include "diffcore.h"
#include "revision.h"
#include "blob.h"
+#include "io-i18n.h"
/* Index extensions.
*
diff --git a/refs.c b/refs.c
index 808f56b..53f6539 100644
--- a/refs.c
+++ b/refs.c
@@ -3,6 +3,7 @@
#include "object.h"
#include "tag.h"
#include "dir.h"
+#include "io-i18n.h"
/* ISSYMREF=01 and ISPACKED=02 are public interfaces */
#define REF_KNOWS_PEELED 04
diff --git a/remote.c b/remote.c
index 73d33f2..780ff75 100644
--- a/remote.c
+++ b/remote.c
@@ -6,6 +6,7 @@
#include "revision.h"
#include "dir.h"
#include "tag.h"
+#include "io-i18n.h"
static struct refspec s_tag_refspec = {
0,
diff --git a/rerere.c b/rerere.c
index 29f95f6..dfff2ac 100644
--- a/rerere.c
+++ b/rerere.c
@@ -3,6 +3,7 @@
#include "rerere.h"
#include "xdiff/xdiff.h"
#include "xdiff-interface.h"
+#include "io-i18n.h"
/* if rerere_enabled == -1, fall back to detection of .git/rr-cache */
static int rerere_enabled = -1;
diff --git a/server-info.c b/server-info.c
index 4098ca2..f074057 100644
--- a/server-info.c
+++ b/server-info.c
@@ -3,6 +3,7 @@
#include "object.h"
#include "commit.h"
#include "tag.h"
+#include "io-i18n.h"
/* refs */
static FILE *info_ref_fp;
diff --git a/setup.c b/setup.c
index 029371e..c87efa3 100644
--- a/setup.c
+++ b/setup.c
@@ -1,5 +1,6 @@
#include "cache.h"
#include "dir.h"
+#include "io-i18n.h"
static int inside_git_dir = -1;
static int inside_work_tree = -1;
diff --git a/sha1_file.c b/sha1_file.c
index 63981fb..3f9145f 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -16,6 +16,7 @@
#include "refs.h"
#include "pack-revindex.h"
#include "sha1-lookup.h"
+#include "io-i18n.h"
#ifndef O_NOATIME
#if defined(__linux__) && (defined(__i386__) || defined(__PPC__))
diff --git a/sha1_name.c b/sha1_name.c
index 44bb62d..bee34aa 100644
--- a/sha1_name.c
+++ b/sha1_name.c
@@ -5,6 +5,7 @@
#include "blob.h"
#include "tree-walk.h"
#include "refs.h"
+#include "io-i18n.h"
static int find_short_object_filename(int len, const char *name, unsigned char *sha1)
{
diff --git a/shallow.c b/shallow.c
index 4d90eda..745b64f 100644
--- a/shallow.c
+++ b/shallow.c
@@ -1,6 +1,7 @@
#include "cache.h"
#include "commit.h"
#include "tag.h"
+#include "io-i18n.h"
static int is_shallow = -1;
diff --git a/strbuf.c b/strbuf.c
index a6153dc..1baa78a 100644
--- a/strbuf.c
+++ b/strbuf.c
@@ -1,5 +1,6 @@
#include "cache.h"
#include "refs.h"
+#include "io-i18n.h"
int prefixcmp(const char *str, const char *prefix)
{
diff --git a/symlinks.c b/symlinks.c
index 7b0a86d..7907186 100644
--- a/symlinks.c
+++ b/symlinks.c
@@ -1,4 +1,5 @@
#include "cache.h"
+#include "io-i18n.h"
/*
* Returns the length (on a path component basis) of the longest
diff --git a/test-chmtime.c b/test-chmtime.c
index fe476cb..6471850 100644
--- a/test-chmtime.c
+++ b/test-chmtime.c
@@ -29,6 +29,7 @@
*/
#include "git-compat-util.h"
#include <utime.h>
+#include "io-i18n.h"
static const char usage_str[] = "-v|--verbose (+|=|=+|=-|-)<seconds> <file>...";
diff --git a/test-delta.c b/test-delta.c
index af40a3c..24d678f 100644
--- a/test-delta.c
+++ b/test-delta.c
@@ -11,6 +11,7 @@
#include "git-compat-util.h"
#include "delta.h"
#include "cache.h"
+#include "io-i18n.h"
static const char usage_str[] =
"test-delta (-d|-p) <from_file> <data_file> <out_file>";
diff --git a/trace.c b/trace.c
index 4229ae1..616a64e 100644
--- a/trace.c
+++ b/trace.c
@@ -24,6 +24,7 @@
#include "cache.h"
#include "quote.h"
+#include "io-i18n.h"
/* Get a trace file descriptor from GIT_TRACE env variable. */
static int get_trace_fd(int *need_close)
diff --git a/transport.c b/transport.c
index 644a30a..3e898aa 100644
--- a/transport.c
+++ b/transport.c
@@ -8,6 +8,7 @@
#include "bundle.h"
#include "dir.h"
#include "refs.h"
+#include "io-i18n.h"
/* rsync support */
diff --git a/unpack-trees.c b/unpack-trees.c
index 720f7a1..5bad618 100644
--- a/unpack-trees.c
+++ b/unpack-trees.c
@@ -8,6 +8,7 @@
#include "progress.h"
#include "refs.h"
#include "attr.h"
+#include "io-i18n.h"
/*
* Error messages expected by scripts out of plumbing commands such as
diff --git a/wrapper.c b/wrapper.c
index c9be140..0a89eec 100644
--- a/wrapper.c
+++ b/wrapper.c
@@ -2,6 +2,7 @@
* Various trivial helper wrappers around standard functions
*/
#include "cache.h"
+#include "io-i18n.h"
char *xstrdup(const char *str)
{
diff --git a/xdiff-interface.c b/xdiff-interface.c
index 01f14fb..dee800c 100644
--- a/xdiff-interface.c
+++ b/xdiff-interface.c
@@ -4,6 +4,7 @@
#include "xdiff/xdiffi.h"
#include "xdiff/xemit.h"
#include "xdiff/xmacros.h"
+#include "io-i18n.h"
struct xdiff_emit_state {
xdiff_emit_consume_fn consume;
--
1.6.5.1
^ permalink raw reply related
* [PATCH I18N filenames v2 1/3] Add IO-wrappers for filenames encoding <local encoding> <-> UTF-8
From: Timur Sufiev @ 2009-10-28 18:01 UTC (permalink / raw)
To: git; +Cc: Timur Sufiev
The point is to make Git aware of filenames local encoding and make it
keep all filenames in UTF-8 internally. If
`i18n.filenameslocalencoding' option was set via git-config to a
correct <codepage> encoding, 2 things should be done:
1. Translate all filenames read by READDIR from <codepage> into UTF-8.
2. Translate all filenames passed to IO-routines from UTF-8 into
<codepage>.
This patch provides:
1. Routines for reencoding filenames from local encoding into UTF-8
and back (taking `i18n.filenameslocalencoding' into consideration).
2. I18N-wrappers around OPENDIR, READDIR, OPEN, FOPEN, STAT, LSTAT,
CHMOD, LINK AND UNLINK.
3. Makes `git-config' support `i18n.filenameslocalencoding' option.
Signed-off-by: Timur Sufiev <timur@iris-comp.ru>
---
Makefile | 2 +
cache.h | 1 +
config.c | 3 +
environment.c | 1 +
io-i18n.c | 231 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
io-i18n.h | 33 ++++++++
6 files changed, 271 insertions(+), 0 deletions(-)
create mode 100644 io-i18n.c
create mode 100644 io-i18n.h
diff --git a/Makefile b/Makefile
index 42b7d60..ac8e807 100644
--- a/Makefile
+++ b/Makefile
@@ -459,6 +459,7 @@ LIB_H += tree-walk.h
LIB_H += unpack-trees.h
LIB_H += userdiff.h
LIB_H += utf8.h
+LIB_H += io-i18n.h
LIB_H += wt-status.h
LIB_OBJS += abspath.o
@@ -562,6 +563,7 @@ LIB_OBJS += unpack-trees.o
LIB_OBJS += usage.o
LIB_OBJS += userdiff.o
LIB_OBJS += utf8.o
+LIB_OBJS += io-i18n.o
LIB_OBJS += walker.o
LIB_OBJS += wrapper.o
LIB_OBJS += write_or_die.o
diff --git a/cache.h b/cache.h
index 96840c7..7f19f7a 100644
--- a/cache.h
+++ b/cache.h
@@ -919,6 +919,7 @@ extern int user_ident_explicitly_given;
extern const char *git_commit_encoding;
extern const char *git_log_output_encoding;
+extern const char *git_filenames_local_encoding;
extern const char *git_mailmap_file;
/* IO helper functions */
diff --git a/config.c b/config.c
index c644061..2be6531 100644
--- a/config.c
+++ b/config.c
@@ -539,6 +539,9 @@ static int git_default_i18n_config(const char *var, const char *value)
if (!strcmp(var, "i18n.logoutputencoding"))
return git_config_string(&git_log_output_encoding, var, value);
+ if (!strcmp(var, "i18n.filenameslocalencoding"))
+ return git_config_string(&git_filenames_local_encoding, var, value);
+
/* Add other config variables here and to Documentation/config.txt. */
return 0;
}
diff --git a/environment.c b/environment.c
index 5de6837..b101f7b 100644
--- a/environment.c
+++ b/environment.c
@@ -24,6 +24,7 @@ int warn_ambiguous_refs = 1;
int repository_format_version;
const char *git_commit_encoding;
const char *git_log_output_encoding;
+const char *git_filenames_local_encoding;
int shared_repository = PERM_UMASK;
const char *apply_default_whitespace;
const char *apply_default_ignorewhitespace;
diff --git a/io-i18n.c b/io-i18n.c
new file mode 100644
index 0000000..ed88a68
--- /dev/null
+++ b/io-i18n.c
@@ -0,0 +1,231 @@
+#include <stdarg.h>
+#include <stddef.h>
+#include "utf8.h"
+#include "cache.h"
+#include "io-i18n.h"
+
+inline static int is_string_ascii(const char *str)
+{
+ int is_ascii = 1;
+
+ for (; *str && is_ascii; str++)
+ is_ascii &= isascii(*str);
+
+ return is_ascii;
+}
+
+char *filename_to_utf8(const char *filename)
+{
+ char *out;
+
+ if (is_string_ascii(filename))
+ return NULL;
+
+#ifndef NO_ICONV
+ if (git_filenames_local_encoding && !is_utf8(filename)) {
+ out = reencode_string(filename,
+ "utf-8", git_filenames_local_encoding);
+#ifdef DEBUG_I18N
+ fprintf(stderr, "Local -> UTF8 encoding: <%s> -> <%s>\n",
+ filename, out);
+#endif
+ return out;
+ } else if (git_filenames_local_encoding && is_utf8(filename)) {
+#ifdef DEBUG_I18N
+ fprintf(stderr,
+ "Filename <%s> is already utf8-encoded, doing nothing...\n",
+ filename);
+#endif
+ return NULL;
+ } else {
+#ifdef DEBUG_I18N
+ fprintf(stderr, "No local encoding set, doing nothing...\n");
+#endif
+ return NULL;
+ }
+#else /* #ifdef NO_ICONV */
+ warning("No iconv support, doing nothing...\n");
+ return NULL;
+#endif
+}
+
+char *filename_to_local(const char *filename)
+{
+ char *out;
+
+ if (is_string_ascii(filename))
+ return NULL;
+
+#ifndef NO_ICONV
+ if (git_filenames_local_encoding && is_utf8(filename)) {
+ out = reencode_string(filename,
+ git_filenames_local_encoding, "utf-8");
+#ifdef DEBUG_I18N
+ fprintf(stderr, "UTF8 -> local encoding: <%s> -> <%s>\n",
+ filename, out);
+#endif
+ return out;
+ } else if (git_filenames_local_encoding && !is_utf8(filename)) {
+#ifdef DEBUG_I18N
+ fprintf(stderr,
+ "Filename <%s> is already local-encoded, doing nothing...\n",
+ filename);
+#endif
+ return NULL;
+ } else {
+#ifdef DEBUG_I18N
+ fprintf(stderr, "No local encoding set, doing nothing...\n");
+#endif
+ return NULL;
+ }
+#else /* #ifdef NO_ICONV */
+ warning("No iconv support, doing nothing...\n");
+ return NULL;
+#endif
+}
+
+#undef stat
+int stat_i18n(const char *filename, struct stat *buf)
+{
+ int ret;
+ char *out = filename_to_local(filename);
+
+ if (out != NULL) {
+ ret = stat(out, buf);
+ free(out);
+ } else
+ ret = stat(filename, buf);
+ return ret;
+}
+
+#undef lstat
+int lstat_i18n(const char *filename, struct stat *buf)
+{
+
+ int ret;
+ char *out = filename_to_local(filename);
+
+ if (out != NULL) {
+ ret = lstat(out, buf);
+ free(out);
+ } else
+ ret = lstat(filename, buf);
+ return ret;
+}
+
+#undef link
+int link_i18n(const char *oldname, const char *newname)
+{
+ char *old_out = filename_to_local(oldname);
+ char *new_out = filename_to_local(newname);
+ int ret = link(old_out ? old_out : oldname,
+ new_out ? new_out : newname);
+
+ if (old_out)
+ free(old_out);
+ if (new_out)
+ free(new_out);
+ return ret;
+}
+
+#undef open
+int open_i18n(const char *filename, int flags, ...)
+{
+ int ret;
+ mode_t mode = 0;
+ char *out = filename_to_local(filename);
+
+ if ( flags & O_CREAT ) {
+ va_list ap;
+
+ va_start(ap, flags);
+ mode = va_arg(ap, int);
+ va_end(ap);
+ }
+
+ if (out != NULL) {
+ ret = open(out, flags, mode);
+ free(out);
+ } else
+ ret = open(filename, flags, mode);
+ return ret;
+}
+
+#undef unlink
+int unlink_i18n(const char *filename)
+{
+ char *out = filename_to_local(filename);
+ int ret;
+
+ if (out) {
+ ret = unlink(out);
+ free(out);
+ } else
+ ret = unlink(filename);
+ return ret;
+}
+
+#undef readdir
+struct dirent *readdir_i18n(DIR * dirstream)
+{
+ struct dirent *de = readdir(dirstream);
+
+ if (de) {
+ char *out = filename_to_utf8(de->d_name);
+
+ if (out) {
+ int len = strlen(out);
+ if (len >= NAME_MAX) {
+ warning("readdir_i18n: converted dir entry name length exceeds NAME_MAX and will be truncated\n");
+ len = NAME_MAX - 1;
+ }
+ memcpy(de->d_name, out, len);
+ de->d_name[len] = '\0';
+ free(out);
+ }
+ return de;
+ } else
+ return NULL;
+}
+
+#undef opendir
+DIR *opendir_i18n(const char *dirname)
+{
+ DIR *dir;
+ char *out = filename_to_local(dirname);
+
+ if (out != NULL) {
+ dir = opendir(out);
+ free(out);
+ } else
+ dir = opendir(dirname);
+ return dir;
+}
+
+#undef fopen
+FILE *fopen_i18n(const char *filename, const char *opentype)
+{
+ FILE *file;
+ char *out = filename_to_local(filename);
+
+ if (out != NULL) {
+ file = fopen(out, opentype);
+ free(out);
+ } else
+ file = fopen(filename, opentype);
+ return file;
+}
+
+#undef chmod
+int chmod_i18n(const char *filename, mode_t mode)
+{
+ int ret;
+ char *out = filename_to_local(filename);
+
+ if (out != NULL) {
+ ret = chmod(out, mode);
+ free(out);
+ } else
+ ret = chmod(filename, mode);
+ return ret;
+}
diff --git a/io-i18n.h b/io-i18n.h
new file mode 100644
index 0000000..2369d31
--- /dev/null
+++ b/io-i18n.h
@@ -0,0 +1,33 @@
+#ifndef GIT_IO_I18N_H
+#define GIT_IO_I18N_H
+
+#define _FILE_OFFSET_BITS 64
+
+#include <sys/stat.h>
+#include <dirent.h>
+#include <stdio.h>
+#include <unistd.h>
+
+char *filename_to_local (const char* filename);
+char *filename_to_utf8(const char *filename);
+int stat_i18n(const char *filename, struct stat *buf);
+int lstat_i18n(const char *filename, struct stat *buf);
+DIR* opendir_i18n(const char *dirname);
+struct dirent *readdir_i18n(DIR *dirstream);
+int open_i18n(const char *filename, int flags, ...);
+FILE *fopen_i18n(const char *filename, const char *opentype);
+int chmod_i18n(const char *filename, mode_t mode);
+int link_i18n(const char *oldname, const char *newname);
+int unlink_i18n(const char *filename);
+
+#define opendir(a) opendir_i18n(a)
+#define fopen(a, b) fopen_i18n(a, b)
+#define chmod(a, b) chmod_i18n(a, b)
+#define open open_i18n
+#define stat(a, b) stat_i18n(a, b)
+#define lstat(a, b) lstat_i18n(a, b)
+#define readdir(a) readdir_i18n(a)
+#define unlink(a) unlink_i18n(a)
+#define link(a, b) link_i18n(a, b)
+
+#endif /* GIT_IO_I18N_H */
--
1.6.5.1
^ permalink raw reply related
* Re: [PATCH 2/4] Add I18N-wrappers for low-level IO-routines
From: Timur Sufiev @ 2009-10-28 18:01 UTC (permalink / raw)
To: Jeff King; +Cc: git
In-Reply-To: <20091027210817.GA1577@sigill.intra.peff.net>
> Hmm. Two questions about this series:
>
> 1. Patch 3/4 didn't seem to make it to the list. Presumably that is
> where you actually use these routines in git? Or are they just for
> mingw?
Yes, it actually haven't made it to the list. Perhaps this was due to
patch size: it was approx. 3300 lines long (BTW, what's the message size
limit?) So I've rewritten the patch to make it more compact, using mingw
approach with macros. Subj prefix for a patch series is 'PATCH I18N
filenames v2'.
> 2. I seem to recall that Linus added a filename translation layer for
> doing much more, like handling unicode normalizations (but I
> confess I haven't looked closely at that code). Should this be part
> of that system?
I've heard nothing about that :(. Could you point me directly at Linus'
changes?
> -Peff
--
Timur Sufiev
^ permalink raw reply
* Re: [PATCH] imap-send.c: fix pointer to be const
From: Junio C Hamano @ 2009-10-28 17:56 UTC (permalink / raw)
To: Michael J Gruber; +Cc: Vietor Liu, git
In-Reply-To: <4AE8482F.7020807@drmicha.warpmail.net>
Michael J Gruber <git@drmicha.warpmail.net> writes:
> Since this is only about warnings, maybe git 1.7.0 is the right time
> frame to adjust this to the upcoming standard?
This does not look like "one group wants this way, but the others want
differently. We have to pick one and sacrifice the other because it is
impossible to have it both ways"; there is no excuse to bring up 1.7.0 for
something like this.
Doesn't inclusing "ssl.h" give us some indication whether "const" is
needed to allow us to use #if/#else/#endif in order to compile with
headers from either versions? I.e. something like...
diff --git a/imap-send.c b/imap-send.c
index 3847fd1..a199db8 100644
--- a/imap-send.c
+++ b/imap-send.c
@@ -273,7 +273,11 @@ static int ssl_socket_connect(struct imap_socket *sock, int use_tls_only, int ve
fprintf(stderr, "SSL requested but SSL support not compiled in\n");
return -1;
#else
+#if (OPENSSL_VERSION_NUMBER >= 0x1000000fL)
+ const SSL_METHOD *meth;
+#else
SSL_METHOD *meth;
+#endif
SSL_CTX *ctx;
int ret;
^ permalink raw reply related
* Re: packaging vs default pager
From: Junio C Hamano @ 2009-10-28 17:55 UTC (permalink / raw)
To: Ben Walton; +Cc: GIT List
In-Reply-To: <1256742357-sup-3798@ntdws12.chass.utoronto.ca>
Ben Walton <bwalton@artsci.utoronto.ca> writes:
> On (old) solaris systems, /usr/bin/less (typically the first less
> found) doesn't understand the default arguments (FXRS), which forces
> users to alter their environment (PATH, GIT_PAGER, LESS, etc) or have
> a local or global gitconfig before paging works as expected.
>
> Would it be completely out of line to provide a knob so that the
> fallback $pager could be set to something more specific/appropriate
> during the build?
I think that is a sensible thing to do. Something like this?
Makefile | 6 ++++++
| 6 +++++-
2 files changed, 11 insertions(+), 1 deletions(-)
diff --git a/Makefile b/Makefile
index 268aede..342d49a 100644
--- a/Makefile
+++ b/Makefile
@@ -200,6 +200,9 @@ all::
# memory allocators with the nedmalloc allocator written by Niall Douglas.
#
# Define NO_REGEX if you have no or inferior regex support in your C library.
+#
+# Define DEFAULT_PAGER to the path of a sensible pager (defaults to "less") if
+# you want to use something different.
GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE
@$(SHELL_PATH) ./GIT-VERSION-GEN
@@ -1294,6 +1297,9 @@ ifdef NO_REGEX
COMPAT_CFLAGS += -Icompat/regex
COMPAT_OBJS += compat/regex/regex.o
endif
+ifdef DEFAULT_PAGER
+ BASIC_CFLAGS += -DDEFAULT_PAGER='"$(DEFAULT_PAGER)"'
+endif
ifdef USE_NED_ALLOCATOR
COMPAT_CFLAGS += -DUSE_NED_ALLOCATOR -DOVERRIDE_STRDUP -DNDEBUG -DREPLACE_SYSTEM_ALLOCATOR -Icompat/nedmalloc
--git a/pager.c b/pager.c
index 86facec..f4c992d 100644
--- a/pager.c
+++ b/pager.c
@@ -2,6 +2,10 @@
#include "run-command.h"
#include "sigchain.h"
+#ifndef DEFAULT_PAGER
+#define DEFAULT_PAGER "less"
+#endif
+
/*
* This is split up from the rest of git so that we can do
* something different on Windows.
@@ -58,7 +62,7 @@ void setup_pager(void)
if (!pager)
pager = getenv("PAGER");
if (!pager)
- pager = "less";
+ pager = DEFAULT_PAGER;
else if (!*pager || !strcmp(pager, "cat"))
return;
^ permalink raw reply related
* [PATCH] t5540: test both smart and dumb protocols
From: Clemens Buchacher @ 2009-10-28 17:52 UTC (permalink / raw)
To: Shawn O. Pearce; +Cc: Mark Lodato, git
In-Reply-To: <20091028001737.GN10505@spearce.org>
Signed-off-by: Clemens Buchacher <drizzd@aon.at>
---
On Tue, Oct 27, 2009 at 05:17:38PM -0700, Shawn O. Pearce wrote:
> Clemens Buchacher <drizzd@aon.at> wrote:
> > Set LIB_HTTPD_GIT to enable smart HTTP tests.
>
> My concern here is we have to run the test suite twice in order to
> test HTTP support. We should only run it once, with GIT_TEST_HTTPD=1
> set and have it all run at once.
How about this? The original code is not touched except for the test
description.
Clemens
t/lib-httpd.sh | 2 +
t/t5540-http-push.sh | 160 ++-----------------------------------------------
t/test-http-push.sh | 159 +++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 168 insertions(+), 153 deletions(-)
create mode 100755 t/test-http-push.sh
diff --git a/t/lib-httpd.sh b/t/lib-httpd.sh
index aaa0a71..cf1f1df 100644
--- a/t/lib-httpd.sh
+++ b/t/lib-httpd.sh
@@ -121,4 +121,6 @@ stop_httpd() {
"$LIB_HTTPD_PATH" -d "$HTTPD_ROOT_PATH" \
-f "$TEST_PATH/apache.conf" $HTTPD_PARA -k stop
+
+ rm -f "$HTTPD_ROOT_PATH/modules"
}
diff --git a/t/t5540-http-push.sh b/t/t5540-http-push.sh
index 049e129..a156f37 100755
--- a/t/t5540-http-push.sh
+++ b/t/t5540-http-push.sh
@@ -1,155 +1,9 @@
#!/bin/sh
-#
-# Copyright (c) 2008 Clemens Buchacher <drizzd@aon.at>
-#
-test_description='test http-push
-
-This test runs various sanity checks on http-push.'
-
-. ./test-lib.sh
-
-ROOT_PATH="$PWD"
-if test -z "$LIB_HTTPD_GIT"
-then
- LIB_HTTPD_DAV=t
-fi
-LIB_HTTPD_PORT=${LIB_HTTPD_PORT-'5540'}
-
-if git http-push > /dev/null 2>&1 || [ $? -eq 128 ]
-then
- say "skipping test, USE_CURL_MULTI is not defined"
- test_done
-fi
-
-. "$TEST_DIRECTORY"/lib-httpd.sh
-start_httpd
-
-test_expect_success 'setup remote repository' '
- cd "$ROOT_PATH" &&
- mkdir test_repo &&
- cd test_repo &&
- git init &&
- : >path1 &&
- git add path1 &&
- test_tick &&
- git commit -m initial &&
- cd - &&
- git clone --bare test_repo test_repo.git &&
- cd test_repo.git &&
- ORIG_HEAD=$(git rev-parse --verify HEAD) &&
- if test -n "$LIB_HTTPD_GIT"
- then
- git config http.receivepack true
- else
- git --bare update-server-info &&
- mv hooks/post-update.sample hooks/post-update
- fi &&
- cd - &&
- mv test_repo.git "$HTTPD_GIT_PATH"
-'
-
-test_expect_success 'clone remote repository' '
- cd "$ROOT_PATH" &&
- git clone $HTTPD_GIT_URL/test_repo.git test_repo_clone
-'
-
-test_expect_success 'push to remote repository with packed refs' '
- cd "$ROOT_PATH"/test_repo_clone &&
- : >path2 &&
- git add path2 &&
- test_tick &&
- git commit -m path2 &&
- HEAD=$(git rev-parse --verify HEAD) &&
- git push &&
- (cd "$HTTPD_GIT_PATH"/test_repo.git &&
- test $HEAD = $(git rev-parse --verify HEAD))
-'
-
-test_expect_success 'push already up-to-date' '
- git push
-'
-
-test_expect_success 'push to remote repository with unpacked refs' '
- (cd "$HTTPD_GIT_PATH"/test_repo.git &&
- rm packed-refs &&
- git update-ref refs/heads/master $ORIG_HEAD &&
- git --bare update-server-info) &&
- git push &&
- (cd "$HTTPD_GIT_PATH"/test_repo.git &&
- test $HEAD = $(git rev-parse --verify HEAD))
-'
-
-test_expect_success 'http-push fetches unpacked objects' '
- cp -R "$HTTPD_GIT_PATH"/test_repo.git \
- "$HTTPD_GIT_PATH"/test_repo_unpacked.git &&
-
- git clone $HTTPD_GIT_URL/test_repo_unpacked.git \
- "$ROOT_PATH"/fetch_unpacked &&
-
- # By reset, we force git to retrieve the object
- (cd "$ROOT_PATH"/fetch_unpacked &&
- git reset --hard HEAD^ &&
- git remote rm origin &&
- git reflog expire --expire=0 --all &&
- git prune &&
- git push -f -v $HTTPD_GIT_URL/test_repo_unpacked.git master)
-'
-
-test_expect_success 'http-push fetches packed objects' '
- cp -R "$HTTPD_GIT_PATH"/test_repo.git \
- "$HTTPD_GIT_PATH"/test_repo_packed.git &&
-
- git clone $HTTPD_GIT_URL/test_repo_packed.git \
- "$ROOT_PATH"/test_repo_clone_packed &&
-
- (cd "$HTTPD_GIT_PATH"/test_repo_packed.git &&
- git --bare repack &&
- git --bare prune-packed) &&
-
- # By reset, we force git to retrieve the packed object
- (cd "$ROOT_PATH"/test_repo_clone_packed &&
- git reset --hard HEAD^ &&
- git remote rm origin &&
- git reflog expire --expire=0 --all &&
- git prune &&
- git push -f -v $HTTPD_GIT_URL/test_repo_packed.git master)
-'
-
-test_expect_success 'create and delete remote branch' '
- cd "$ROOT_PATH"/test_repo_clone &&
- git checkout -b dev &&
- : >path3 &&
- git add path3 &&
- test_tick &&
- git commit -m dev &&
- git push origin dev &&
- git fetch &&
- git push origin :dev &&
- git fetch &&
- test_must_fail git show-ref --verify refs/remotes/origin/dev
-'
-
-test -n "$LIB_HTTPD_GIT" ||
-test_expect_success 'MKCOL sends directory names with trailing slashes' '
-
- ! grep "\"MKCOL.*[^/] HTTP/[^ ]*\"" < "$HTTPD_ROOT_PATH"/access.log
-
-'
-
-x1="[0-9a-f]"
-x2="$x1$x1"
-x5="$x1$x1$x1$x1$x1"
-x38="$x5$x5$x5$x5$x5$x5$x5$x1$x1$x1"
-x40="$x38$x2"
-
-test -n "$LIB_HTTPD_GIT" ||
-test_expect_success 'PUT and MOVE sends object to URLs with SHA-1 hash suffix' '
- sed -e "s/PUT /OP /" -e "s/MOVE /OP /" "$HTTPD_ROOT_PATH"/access.log |
- grep -e "\"OP .*/objects/$x2/${x38}_$x40 HTTP/[.0-9]*\" 20[0-9] "
-
-'
-
-stop_httpd
-
-test_done
+LIB_HTTPD_GIT=t
+export LIB_HTTPD_GIT
+./test-http-push.sh $@
+sleep 1
+LIB_HTTPD_GIT=
+export LIB_HTTPD_GIT
+./test-http-push.sh $@
diff --git a/t/test-http-push.sh b/t/test-http-push.sh
new file mode 100755
index 0000000..c557541
--- /dev/null
+++ b/t/test-http-push.sh
@@ -0,0 +1,159 @@
+#!/bin/sh
+
+if test -n "$LIB_HTTPD_GIT"
+then
+ protocol=smart
+else
+ protocol=dumb
+fi
+
+test_description="test http-push ($protocol)
+
+This test runs various sanity checks on http-push."
+
+. ./test-lib.sh
+
+ROOT_PATH="$PWD"
+if test -z "$LIB_HTTPD_GIT"
+then
+ LIB_HTTPD_DAV=t
+fi
+LIB_HTTPD_PORT=${LIB_HTTPD_PORT-'5540'}
+
+if git http-push > /dev/null 2>&1 || [ $? -eq 128 ]
+then
+ say "skipping test, USE_CURL_MULTI is not defined"
+ test_done
+fi
+
+. "$TEST_DIRECTORY"/lib-httpd.sh
+start_httpd
+
+test_expect_success 'setup remote repository' '
+ cd "$ROOT_PATH" &&
+ mkdir test_repo &&
+ cd test_repo &&
+ git init &&
+ : >path1 &&
+ git add path1 &&
+ test_tick &&
+ git commit -m initial &&
+ cd - &&
+ git clone --bare test_repo test_repo.git &&
+ cd test_repo.git &&
+ ORIG_HEAD=$(git rev-parse --verify HEAD) &&
+ if test -n "$LIB_HTTPD_GIT"
+ then
+ git config http.receivepack true
+ else
+ git --bare update-server-info &&
+ mv hooks/post-update.sample hooks/post-update
+ fi &&
+ cd - &&
+ mv test_repo.git "$HTTPD_GIT_PATH"
+'
+
+test_expect_success 'clone remote repository' '
+ cd "$ROOT_PATH" &&
+ git clone $HTTPD_GIT_URL/test_repo.git test_repo_clone
+'
+
+test_expect_success 'push to remote repository with packed refs' '
+ cd "$ROOT_PATH"/test_repo_clone &&
+ : >path2 &&
+ git add path2 &&
+ test_tick &&
+ git commit -m path2 &&
+ HEAD=$(git rev-parse --verify HEAD) &&
+ git push &&
+ (cd "$HTTPD_GIT_PATH"/test_repo.git &&
+ test $HEAD = $(git rev-parse --verify HEAD))
+'
+
+test_expect_success 'push already up-to-date' '
+ git push
+'
+
+test_expect_success 'push to remote repository with unpacked refs' '
+ (cd "$HTTPD_GIT_PATH"/test_repo.git &&
+ rm packed-refs &&
+ git update-ref refs/heads/master $ORIG_HEAD &&
+ git --bare update-server-info) &&
+ git push &&
+ (cd "$HTTPD_GIT_PATH"/test_repo.git &&
+ test $HEAD = $(git rev-parse --verify HEAD))
+'
+
+test_expect_success 'http-push fetches unpacked objects' '
+ cp -R "$HTTPD_GIT_PATH"/test_repo.git \
+ "$HTTPD_GIT_PATH"/test_repo_unpacked.git &&
+
+ git clone $HTTPD_GIT_URL/test_repo_unpacked.git \
+ "$ROOT_PATH"/fetch_unpacked &&
+
+ # By reset, we force git to retrieve the object
+ (cd "$ROOT_PATH"/fetch_unpacked &&
+ git reset --hard HEAD^ &&
+ git remote rm origin &&
+ git reflog expire --expire=0 --all &&
+ git prune &&
+ git push -f -v $HTTPD_GIT_URL/test_repo_unpacked.git master)
+'
+
+test_expect_success 'http-push fetches packed objects' '
+ cp -R "$HTTPD_GIT_PATH"/test_repo.git \
+ "$HTTPD_GIT_PATH"/test_repo_packed.git &&
+
+ git clone $HTTPD_GIT_URL/test_repo_packed.git \
+ "$ROOT_PATH"/test_repo_clone_packed &&
+
+ (cd "$HTTPD_GIT_PATH"/test_repo_packed.git &&
+ git --bare repack &&
+ git --bare prune-packed) &&
+
+ # By reset, we force git to retrieve the packed object
+ (cd "$ROOT_PATH"/test_repo_clone_packed &&
+ git reset --hard HEAD^ &&
+ git remote rm origin &&
+ git reflog expire --expire=0 --all &&
+ git prune &&
+ git push -f -v $HTTPD_GIT_URL/test_repo_packed.git master)
+'
+
+test_expect_success 'create and delete remote branch' '
+ cd "$ROOT_PATH"/test_repo_clone &&
+ git checkout -b dev &&
+ : >path3 &&
+ git add path3 &&
+ test_tick &&
+ git commit -m dev &&
+ git push origin dev &&
+ git fetch &&
+ git push origin :dev &&
+ git fetch &&
+ test_must_fail git show-ref --verify refs/remotes/origin/dev
+'
+
+test -n "$LIB_HTTPD_GIT" ||
+test_expect_success 'MKCOL sends directory names with trailing slashes' '
+
+ ! grep "\"MKCOL.*[^/] HTTP/[^ ]*\"" < "$HTTPD_ROOT_PATH"/access.log
+
+'
+
+x1="[0-9a-f]"
+x2="$x1$x1"
+x5="$x1$x1$x1$x1$x1"
+x38="$x5$x5$x5$x5$x5$x5$x5$x1$x1$x1"
+x40="$x38$x2"
+
+test -n "$LIB_HTTPD_GIT" ||
+test_expect_success 'PUT and MOVE sends object to URLs with SHA-1 hash suffix' '
+ sed -e "s/PUT /OP /" -e "s/MOVE /OP /" "$HTTPD_ROOT_PATH"/access.log |
+ grep -e "\"OP .*/objects/$x2/${x38}_$x40 HTTP/[.0-9]*\" 20[0-9] "
+
+'
+
+stop_httpd
+
+test_done
--
1.6.5.1.208.gd7b37
^ permalink raw reply related
* [PATCH] commit: More generous accepting of RFC-2822 footer lines.
From: David Brown @ 2009-10-28 17:13 UTC (permalink / raw)
To: git
In-Reply-To: <20091027234520.GA11433@quaoar.codeaurora.org>
From: David Brown <davidb@quicinc.com>
'git commit -s' will insert a blank line before the Signed-off-by
line at the end of the message, unless this last line is a
Signed-off-by line itself. Common use has other trailing lines
at the ends of commit text, in the style of RFC2822 headers.
Be more generous in considering lines to be part of this footer.
If the last paragraph of the commit message reasonably resembles
RFC-2822 formatted lines, don't insert that blank line.
The new Signed-off-by line is still only suppressed when the
author's existing Signed-off-by is the last line of the message.
Signed-off-by: David Brown <davidb@quicinc.com>
---
builtin-commit.c | 43 ++++++++++++++++++++++++++++++++++++++++++-
t/t7501-commit.sh | 41 +++++++++++++++++++++++++++++++++++++++++
2 files changed, 83 insertions(+), 1 deletions(-)
diff --git a/builtin-commit.c b/builtin-commit.c
index 200ffda..c395cbf 100644
--- a/builtin-commit.c
+++ b/builtin-commit.c
@@ -414,6 +414,47 @@ static void determine_author_info(void)
author_date = date;
}
+static int ends_rfc2822_footer(struct strbuf *sb)
+{
+ int ch;
+ int hit = 0;
+ int i, j, k;
+ int len = sb->len;
+ int first = 1;
+ const char *buf = sb->buf;
+
+ for (i = len - 1; i > 0; i--) {
+ if (hit && buf[i] == '\n')
+ break;
+ hit = (buf[i] == '\n');
+ }
+
+ while (i < len - 1 && buf[i] == '\n')
+ i++;
+
+ for (; i < len; i = k) {
+ for (k = i; k < len && buf[k] != '\n'; k++)
+ ; /* do nothing */
+ k++;
+
+ if ((buf[k] == ' ' || buf[k] == '\t') && !first)
+ continue;
+
+ first = 0;
+
+ for (j = 0; i + j < len; j++) {
+ ch = buf[i + j];
+ if (ch == ':')
+ break;
+ if (isalnum(ch) ||
+ (ch == '-'))
+ continue;
+ return 0;
+ }
+ }
+ return 1;
+}
+
static int prepare_to_commit(const char *index_file, const char *prefix,
struct wt_status *s)
{
@@ -489,7 +530,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
for (i = sb.len - 1; i > 0 && sb.buf[i - 1] != '\n'; i--)
; /* do nothing */
if (prefixcmp(sb.buf + i, sob.buf)) {
- if (prefixcmp(sb.buf + i, sign_off_header))
+ if (!ends_rfc2822_footer(&sb))
strbuf_addch(&sb, '\n');
strbuf_addbuf(&sb, &sob);
}
diff --git a/t/t7501-commit.sh b/t/t7501-commit.sh
index e2ef532..d2de576 100755
--- a/t/t7501-commit.sh
+++ b/t/t7501-commit.sh
@@ -247,6 +247,47 @@ $existing" &&
'
+test_expect_success 'signoff gap' '
+
+ echo 3 >positive &&
+ git add positive &&
+ alt="Alt-RFC-822-Header: Value" &&
+ git commit -s -m "welcome
+
+$alt" &&
+ git cat-file commit HEAD | sed -e "1,/^\$/d" > actual &&
+ (
+ echo welcome
+ echo
+ echo $alt
+ git var GIT_COMMITTER_IDENT |
+ sed -e "s/>.*/>/" -e "s/^/Signed-off-by: /"
+ ) >expected &&
+ test_cmp expected actual
+'
+
+test_expect_success 'signoff gap 2' '
+
+ echo 4 >positive &&
+ git add positive &&
+ alt="fixed: 34" &&
+ git commit -s -m "welcome
+
+We have now
+$alt" &&
+ git cat-file commit HEAD | sed -e "1,/^\$/d" > actual &&
+ (
+ echo welcome
+ echo
+ echo We have now
+ echo $alt
+ echo
+ git var GIT_COMMITTER_IDENT |
+ sed -e "s/>.*/>/" -e "s/^/Signed-off-by: /"
+ ) >expected &&
+ test_cmp expected actual
+'
+
test_expect_success 'multiple -m' '
>negative &&
--
1.6.5.1
^ permalink raw reply related
* Re: From 200 to 404 to 407.
From: Avery Pennarun @ 2009-10-28 16:48 UTC (permalink / raw)
To: Peter Odéus; +Cc: git
In-Reply-To: <loom.20091028T170227-957@post.gmane.org>
On Wed, Oct 28, 2009 at 12:10 PM, Peter Odéus <peter.odeus@gmail.com> wrote:
> Anyway. Behind these corporate walls, the proxy is a reality to deal with, so
> hopefully someone else can bring us closer to a solutiuon.
I was just looking at the source and it seems all the curl-related
stuff is isolated in git/http.c, and is pretty easy to understand.
Since I have no way to reproduce your problem, I won't attempt to look
into it myself. But if you look for "proxy" (and especially
CURLOPT_PROXY) in that file, you might find something.
Specifically, I would suggest resetting the CURLOPT_PROXY setting
before each URL request (eg. in new_http_object_request).
Hope this helps.
Avery
^ permalink raw reply
* Re: From 200 to 404 to 407.
From: Avery Pennarun @ 2009-10-28 16:35 UTC (permalink / raw)
To: Peter Odéus; +Cc: git
In-Reply-To: <loom.20091028T170227-957@post.gmane.org>
On Wed, Oct 28, 2009 at 12:10 PM, Peter Odéus <peter.odeus@gmail.com> wrote:
> Avery Pennarun <apenwarr <at> gmail.com> writes:
> If you wouldn't have posted the base64-encoded password it would have never hit
> the gmane list ;-)
Sorry about that. The To: line indicated that the message had been
sent to the list, so I didn't realize that your copy was rejected. I
have no idea what made gmane reject it for you (or whether my own copy
was rejected, for that matter :)).
Avery
^ permalink raw reply
* Re: From 200 to 404 to 407.
From: Peter Odéus @ 2009-10-28 16:10 UTC (permalink / raw)
To: git
In-Reply-To: <32541b130910280850t5b4baa91p90b31b4c1c467e94@mail.gmail.com>
Avery Pennarun <apenwarr <at> gmail.com> writes:
>
> On Wed, Oct 28, 2009 at 4:38 AM, Peter Odéus <peter.odeus <at> gmail.com>
wrote:
> > * Re-using existing connection! (#0) with host proxyserver.acme.com
> > * Connected to proxyserver.acme.com (192.71.145.9) port 8080
> > > GET
>
http://gitrepo.outside.com/git/gitrepo.git/objects/6b/132a9e81161e58812902d7f735
a38bf5ee1583 HTTP/1.1
> > Proxy-Authorization: Basic cmQva3F3Zzc2MjptYW1tYW1pYQ==
> > User-Agent: git/1.6.5.2
> > Host: gitrepo.outside.com
> > Accept: */*
> >
> > * The requested URL returned error: 404
>
> So this git object didn't exist, apparently. Can you confirm that the
> object shouldn't be there? (on the server: git cat-file -p
> 6b132a9e81161e58812902d7f735a38bf5ee1583) Does git-fsck report
> anything weird on the server repository?
>
> > * Closing connection #0
> > * Couldn't find host gitrepo.outside.com in the .netrc file, using defaults
> > * About to connect() to proxyserver.acme.com port 8080
> > * Trying 192.71.145.9... * connected
> > * Connected to proxyserver.acme.com (192.71.145.9) port 8080
> > > GET http://gitrepo.outside.com/git/gitrepo.git/objects/info/http-
alternates HTTP/1.1
> > User-Agent: git/1.6.5.2
> > Host: gitrepo.outside.com
> > Accept: */*
> > Pragma: no-cache
> >
> > < HTTP/1.1 407 Proxy Authentication Required ( The ISA Server requires
> > authorization to fulfill the request. Access to the Web Proxy service
> > is denied. )
>
> This error seems to happen because the Proxy-Authorization line was
> not included in this request like it was included in prior ones.
> Probably the authorization key was forgotten when the first connection
> closed. If there hadn't been a 404, the connection wouldn't have
> closed and this wouldn't have happened, which is presumably why you
> haven't seen this problem before.
>
> This is where my expertise ends, since I've never messed with either
> libcurl or git's usage of it. I couldn't tell you if this is a
> libcurl bug or a git bug. (Proxies are relatively rare nowadays, so
> this code path is likely to be rarely tested.)
>
> Hopefully someone else on the list can assist.
>
> ** WARNING: the username/password sent in the Proxy-Authorization line
> is not encrypted and you've posted a trace of it to a public mailing
> list. You need to change your password immediately. **
>
> Good luck,
>
> Avery
>
If you wouldn't have posted the base64-encoded password it would have never hit
the gmane list ;-)
Don't worry about it, because I tried to submit the console output myself all
day. But to no avail.
Is it enough to replace greater-than-signs to something else, btw?
Anyway. Behind these corporate walls, the proxy is a reality to deal with, so
hopefully someone else can bring us closer to a solutiuon.
Thanks for your input.
:D
/Peter
^ permalink raw reply
* Re: git svn branch tracking + ignore paths
From: Avery Pennarun @ 2009-10-28 16:00 UTC (permalink / raw)
To: Lachlan Deck; +Cc: git list
In-Reply-To: <19979334-07EB-48CA-8E62-4ECC5E1FA51C@gmail.com>
On Wed, Oct 28, 2009 at 1:59 AM, Lachlan Deck <lachlan.deck@gmail.com> wrote:
> On 28/10/2009, at 4:20 PM, Avery Pennarun wrote:
>> So which are the files you don't want to import from trunk? It
>> doesn't sound like there are any... so it's getting simpler already.
>
> There are. I've currently (as a workaround) done the following within the
> main branch:
> add the following to .git/info/exclude
> .settings
> target
> .classpath
> .project
>
> The last two of these has no effect of course because .project and
> .classpath files already exist -- and thus are marked as modified. So I'm
> currently doing a git stash && git svn rebase && git svn dcommit && git
> stash pop
>
> I'm also wanting to exclude 'lib' folders from trunk (as these are not
> needed).
The problem is that as your branch diverges from what you *actually*
want to commit, it becomes exponentially more complicated to figure
out what you *do* want to commit.
Note that if you're planning to share your git project with other
people anyway, then you have an additional problem: you're using git
svn rebase, which is almost useless for sharing with other people
(other than through svn, of course), for the same reason any git
rebase is.
One option you have is to maintain two branches:
1. (git-svn) The git-svn trunk, which contains only stuff you want upstream
2. (master) Your live branch, which contains everything from (1) plus
your local customizations.
When you want to fetch from svn, you do this:
git checkout master
git svn fetch git-svn
git merge git-svn
When you want to push to svn, you do this:
git checkout git-svn
git merge --squash --no-commit master
(now undo your local customizations)
git commit
git svn dcommit
git checkout master
git merge git-svn
Note that master never gets rebased, only merged. If you can write a
simple script for "undo your local customizations" - such as reverting
a particular commit, for example - then you can put the above in a
shell script and it should work fine most of the time.
Good luck.
Avery
^ permalink raw reply
* Re: From 200 to 404 to 407.
From: Avery Pennarun @ 2009-10-28 15:50 UTC (permalink / raw)
To: Peter Odéus; +Cc: git
In-Reply-To: <82fd2c5d0910280138r52baff98p3f4ff65e968b0d37@mail.gmail.com>
On Wed, Oct 28, 2009 at 4:38 AM, Peter Odéus <peter.odeus@gmail.com> wrote:
> * Re-using existing connection! (#0) with host proxyserver.acme.com
> * Connected to proxyserver.acme.com (192.71.145.9) port 8080
> > GET http://gitrepo.outside.com/git/gitrepo.git/objects/6b/132a9e81161e58812902d7f735a38bf5ee1583 HTTP/1.1
> Proxy-Authorization: Basic cmQva3F3Zzc2MjptYW1tYW1pYQ==
> User-Agent: git/1.6.5.2
> Host: gitrepo.outside.com
> Accept: */*
>
> * The requested URL returned error: 404
So this git object didn't exist, apparently. Can you confirm that the
object shouldn't be there? (on the server: git cat-file -p
6b132a9e81161e58812902d7f735a38bf5ee1583) Does git-fsck report
anything weird on the server repository?
> * Closing connection #0
> * Couldn't find host gitrepo.outside.com in the .netrc file, using defaults
> * About to connect() to proxyserver.acme.com port 8080
> * Trying 192.71.145.9... * connected
> * Connected to proxyserver.acme.com (192.71.145.9) port 8080
> > GET http://gitrepo.outside.com/git/gitrepo.git/objects/info/http-alternates HTTP/1.1
> User-Agent: git/1.6.5.2
> Host: gitrepo.outside.com
> Accept: */*
> Pragma: no-cache
>
> < HTTP/1.1 407 Proxy Authentication Required ( The ISA Server requires
> authorization to fulfill the request. Access to the Web Proxy service
> is denied. )
This error seems to happen because the Proxy-Authorization line was
not included in this request like it was included in prior ones.
Probably the authorization key was forgotten when the first connection
closed. If there hadn't been a 404, the connection wouldn't have
closed and this wouldn't have happened, which is presumably why you
haven't seen this problem before.
This is where my expertise ends, since I've never messed with either
libcurl or git's usage of it. I couldn't tell you if this is a
libcurl bug or a git bug. (Proxies are relatively rare nowadays, so
this code path is likely to be rarely tested.)
Hopefully someone else on the list can assist.
** WARNING: the username/password sent in the Proxy-Authorization line
is not encrypted and you've posted a trace of it to a public mailing
list. You need to change your password immediately. **
Good luck,
Avery
^ permalink raw reply
* Re: merge confusion
From: Alex Riesen @ 2009-10-28 15:43 UTC (permalink / raw)
To: Tim Mazid; +Cc: git
In-Reply-To: <26093419.post@talk.nabble.com>
On Wed, Oct 28, 2009 at 13:01, Tim Mazid <timmazid@hotmail.com> wrote:
> You can just do a 'git branch branch-to-merge COMMIT' then 'git merge
> branch-to-merge' from your feature branch. Alternatively, you could just do
> a straight 'git merge COMMIT' from your feature branch. Though I'm not sure
> of the consequences of merging a commit instead of a branch.
The only consequence is that the merge commit message (if there will be any,
fast-forward merges don't merge anything) will mention the SHA1 instead of
branch name. You can provide your own merge commit message, of course
(while merging and afterwards).
^ permalink raw reply
* Re: [PATCH] mergetool--lib: add p4merge as a pre-configured mergetool option
From: Scott Chacon @ 2009-10-28 15:37 UTC (permalink / raw)
To: David Aguilar; +Cc: Charles Bailey, git list, Junio C Hamano
In-Reply-To: <20091028090022.GA90780@gmail.com>
Hey,
On Wed, Oct 28, 2009 at 2:00 AM, David Aguilar <davvid@gmail.com> wrote:
>> I'm just wondering, does this work well with unixes and Mac OS X? I
>> think it's recommended install practice to symlink p4v as p4merge on
>> *nix, but Mac OS X needs some sort of 'launchp4merge' to be called
>> IIRC, or is this something that users can just configure with
>> mergetool.p4diff.path?
>
> I just tested this on Mac OS X with the latest version of
> p4merge. It worked great.
>
> $ git config difftool.p4merge.path \
> /Applications/p4merge.app/Contents/MacOS/p4merge
>
> $ git difftool -t p4merge HEAD^
>
This is how I have it setup as well and both diff and merge work for
me. I had to do a weird thing with passing it $LOCAL twice if there
was no merge base since otherwise it does a diff tool instead of a
merge tool - the difference is based on the number of arguments, but
it seems to work pretty well. I can try it on Linux a bit later, but
I'm not sure why launchp4merge would be needed instead of setting the
path like this on a Mac - if there is no serious objection, I can
resend this with my Signed-Off-By (sorry, I forgot).
Thanks,
Scott
^ permalink raw reply
* Re: From 200 to 404 to 407.
From: Peter Odéus @ 2009-10-28 15:35 UTC (permalink / raw)
To: git
In-Reply-To: <loom.20091028T160202-594@post.gmane.org>
Peter <peter.odeus <at> gmail.com> writes:
>
>
> Don't have root access at work == no wireshark.
>
>
I have tried to attach rich console output (thanks to env variable
GIT_CURL_VERBOSE=1) into a gmane-follow-up-message.
No dice.
Are there restrictions on what characters are permitted?
^ permalink raw reply
* Re: how to split a hunk
From: bill lam @ 2009-10-28 15:26 UTC (permalink / raw)
To: Geert Bosch; +Cc: git
In-Reply-To: <21963906-785A-4D98-8AD8-A89ED914920C@adacore.com>
On Tue, 27 Oct 2009, Geert Bosch wrote:
> I like to use "git gui" for this. This allows you to pick individual
> lines to commit. I really like the "git gui" interface for staging/unstaging
> changes and making a series of commits.
Thank you suggestion. However I did not use git-gui/gitk or have tcl
installed.
--
regards,
====================================================
GPG key 1024D/4434BAB3 2008-08-24
gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
^ permalink raw reply
* packaging vs default pager
From: Ben Walton @ 2009-10-28 15:21 UTC (permalink / raw)
To: GIT List
[-- Attachment #1: Type: text/plain, Size: 999 bytes --]
Hi All,
I'd like to see what people think about providing a configure/Makefile
knob for overriding the default pager at build time. Currently,
things use 'less' as the fallback and rely on the path to find
it.
On (old) solaris systems, /usr/bin/less (typically the first less
found) doesn't understand the default arguments (FXRS), which forces
users to alter their environment (PATH, GIT_PAGER, LESS, etc) or have
a local or global gitconfig before paging works as expected.
Would it be completely out of line to provide a knob so that the
fallback $pager could be set to something more specific/appropriate
during the build? [I'll do the work but not if it's an undesirable
addition.]
Alternately, are packagers recommended to simply ship a global
gitconfig that sets core.pager?
Thanks
-Ben
--
Ben Walton
Systems Programmer - CHASS
University of Toronto
C:416.407.5610 | W:416.978.4302
GPG Key Id: 8E89F6D2; Key Server: pgp.mit.edu
Contact me to arrange for a CAcert assurance meeting.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply
* Re: how to split a hunk
From: bill lam @ 2009-10-28 15:16 UTC (permalink / raw)
To: Thomas Rast; +Cc: git
In-Reply-To: <200910281406.12923.trast@student.ethz.ch>
On Wed, 28 Oct 2009, Thomas Rast wrote:
> There's also the 'git add -p' [e]dit feature, which pops up the patch
> in an editor. There are instructions in that file, but in this case,
> you can simply remove one of the additions.
Thank you for pointing out the [e], incidentally after trying it, I
also noticed and tried the add -e which belongs to a similar format.
--
regards,
====================================================
GPG key 1024D/4434BAB3 2008-08-24
gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
^ 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