Git development
 help / color / mirror / Atom feed
* Re: bbchop & Wikipedia's Bayesian search theory page
From: Ealdwulf Wuffinga @ 2009-08-17 14:46 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: git
In-Reply-To: <alpine.DEB.1.00.0908161907580.8306@pacific.mpi-cbg.de>

On Sun, Aug 16, 2009 at 6:13 PM, Johannes
Schindelin<Johannes.Schindelin@gmx.de> wrote:
> I tried to find some documentation for Bayesian search theory, but it
> seems those ridiculous Wikipedia admins struck once again, in their
> mission to reduce the world's intellect to their own.

It looks like it is still there to me:
http://en.wikipedia.org/wiki/Bayesian_search_theory

It looks like github has included a ')' on the end when html-ifying
the link inthe README, making it into a dead link. I'll fix that.

The wikipedia article is still not amazing,though. Unfortunately most
of the online descriptions
of Bayesian Search Theory, such as:
http://www.sarinz.com/index.cfm/3,112,261/landsearchmethodsreview.pdf
seem to go heavily into the minutia of search-and-rescue, which while
interesting, is not
relevant to git.

However, although I got the idea of bbchop from search theory, it is
not necessary to know much
of search theory in order to understand bbchop. The basic algorithm is
very simple:

At each step, test the commit for which the expected gain of information (about
the location of the bug) is greatest.

That is basically all I got from search theory so far - the
calculation of the probability of the
bug existing in each location is standard bayesian probability theory,
which maybe you already
know. If not, a very readable reference is:
http://www.inference.phy.cam.ac.uk/mackay/itila/book.html (free on-line book).

So all the code does is compute N entropies and pick the best. Most of the
complexity is introduced by:
 - calculating the N entropies without calculating N^2 probabilities
 - calculations over a DAG.

Ealdwulf

^ permalink raw reply

* Re: Using VC build git (split patch)
From: Frank Li @ 2009-08-17 15:14 UTC (permalink / raw)
  To: Erik Faye-Lund; +Cc: git, msysGit, Johannes Schindelin
In-Reply-To: <40aa078e0908170619r3d325e0csee466446df474302@mail.gmail.com>

> Then use send-email, which IS supported in msysgit.

gmail require ssl.  ssl.pm miss when I use send-email in msysgit. I
have submit bug at msysgit

best regards
Frank Li

^ permalink raw reply

* Re: [RFC PATCH v3 8/8] --sparse for porcelains
From: Johannes Schindelin @ 2009-08-17 15:19 UTC (permalink / raw)
  To: Nguyen Thai Ngoc Duy; +Cc: Jakub Narebski, Junio C Hamano, git
In-Reply-To: <fcaeb9bf0908170741v210e7f4et9f1c68bc9a81ca65@mail.gmail.com>

[-- Attachment #1: Type: TEXT/PLAIN, Size: 2127 bytes --]

Hi,

On Mon, 17 Aug 2009, Nguyen Thai Ngoc Duy wrote:

> On Mon, Aug 17, 2009 at 8:35 PM, Johannes
> Schindelin<Johannes.Schindelin@gmx.de> wrote:
>
> > The problem of course is that the other branch has an ancient version 
> > of that file (which should _not_ overwrite the current, modified 
> > version!), i.e. "git diff HEAD..other -- file" does not come empty.
> >
> > As 'file' is assume-unchanged, zinnnng, the file gets "updated".
> 
> Then it is a bug. Assume-unchanged as in reading is good.
> Assume-unchanged in writing sounds scary. Something like this should
> fix it (not well tested though). It's on top of my series, but you can
> adapt it to 'next' or 'master' easily.

No.

The purpose of 'assume-unchanged' is to tell Git that it has no business 
checking that the file is unchanged.  It should _assume_ that it is 
unchanged.  That's what this flag says.

So do you agree that assume-changed is not quite similar enough to sparse 
to use the same bit?

> > Another use case: documentation.  I do not have that use case yet, but 
> > I know about people who do.
> 
> Translators usually checkout one or two files (I am Vietnamese 
> Translation Coordinator of GNOME, but well... I check them all out. I 
> suppose "normal" translators would not want to do like I do.)

Exactly.

echo /Documentation/ > .git/info/sparse

Remember: the documentation contributors are the least programming-savvy 
contributors of any project.

> >  Specifying what you _want_ to have checked out is much more 
> > straight-forward here than the opposite.
> 
> I think it depends on type of projects. For documentation projects, you 
> may want a few files. For software projects, usually you need everything 
> _except_ a few big directories. For WebKit, it's a bunch of test data 
> that I don't care about. Firmware in hardware-related projects or media 
> files in game projects fall in the same category. I don't have strong 
> opinion on this. Either include or exclude is fine to me.

Okay, let me just ask: if you have a sparse checkout, what would you think 
I mean when I talk about the "sparse files"?

Ciao,
Dscho

^ permalink raw reply

* Re: Continue git clone after interruption
From: Shawn O. Pearce @ 2009-08-17 15:23 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Tomasz Kontusz, git
In-Reply-To: <alpine.DEB.1.00.0908171430010.4991@intel-tinevez-2-302>

Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> On Mon, 17 Aug 2009, Tomasz Kontusz wrote:
> 
> > is anybody working on making it possible to continue git clone after 
> > interruption? It would be quite useful for people with bad internet 
> > connection (I was downloading a big repo lately, and it was a bit 
> > frustrating to start it over every time git stopped at ~90%).
> 
> Unfortunately, we did not have enough GSoC slots for the project to allow 
> restartable clones.
> 
> There were discussions about how to implement this on the list, though.

Unfortunately, those of us who know how the native protocol works
can't come to an agreement on how it might be restartable.  If you
really read the archives on this topic, you'll see that Nico and I
disagree about how to do this.  IIRC Nico's position is, it isn't
really possible to implement a restart.

-- 
Shawn.

^ permalink raw reply

* Re: Using VC build git (split patch)
From: Erik Faye-Lund @ 2009-08-17 15:25 UTC (permalink / raw)
  To: Frank Li; +Cc: git, msysGit, Johannes Schindelin
In-Reply-To: <1976ea660908170814q30c316aek20d44e67bba4a3ab@mail.gmail.com>

On Mon, Aug 17, 2009 at 5:14 PM, Frank Li<lznuaa@gmail.com> wrote:
>> Then use send-email, which IS supported in msysgit.
>
> gmail require ssl.  ssl.pm miss when I use send-email in msysgit. I
> have submit bug at msysgit

Have a look at http://code.google.com/p/msysgit/wiki/UsingSendEmail to
find out how to use send-email from Windows.



-- 
Erik "kusma" Faye-Lund
kusmabite@gmail.com
(+47) 986 59 656

^ permalink raw reply

* Re: [RFC PATCH v3 8/8] --sparse for porcelains
From: Junio C Hamano @ 2009-08-17 15:41 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Jakub Narebski, Nguyen Thai Ngoc Duy, git
In-Reply-To: <alpine.DEB.1.00.0908171101090.4991@intel-tinevez-2-302>

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

> The scenario is this: the repository contains a file that users are 
> supposed to change, but not commit to (only the super-intelligent inventor 
> of this scenario is allowed to).  As this repository is originally a 
> subversion one, there is no problem: people just do not switch branches.
>
> But this guy uses git-svn, so he does switch branches, and to avoid 
> committing the file by mistake, he marked it assume-unchanged.  Only that 
> a branch switch overwrites the local changes.

If it is a problem that a branch switch overwrites the local changes in
assume-unchanged file, perhaps that is what this person needs to change?

Let's step back a bit and think.

Local changes in git do not belong to any particular branch.  They belong
to the work tree and the index.  Hence you (1) can switch from branch A to
branch B iff the branches do not have difference in the path with local
changes, and (2) have to stash save, switch branches and then stash pop if
you have local changes to paths that are different between branches you
are switching between.

How should assume-unchanged play with this philosophy?

I'd say that assume-unchanged is a promise you make git that you won't
change these paths, and in return to the promise git will give you faster
response by not running lstat on them.  Having changes in such paths is
your problem and you deserve these chanegs to be lost.  At least, that is
the interpretation according to the original assume-unchanged semantics.

If some paths should not be committed, I'd say it should be handled by a
pre commit hook, and not assume-unchanged.

Is checking with "diff --cached" on the paths and either erroring out (or
better yet resetting the problematic paths in the index) an option?

^ permalink raw reply

* Re: Linus' sha1 is much faster!
From: Steven Noonan @ 2009-08-17 15:44 UTC (permalink / raw)
  To: Giuseppe Scrivano
  Cc: Pádraig Brady, Bug-coreutils, Linus Torvalds,
	Git Mailing List
In-Reply-To: <8763cmemsa.fsf@master.homenet>

On Mon, Aug 17, 2009 at 3:51 AM, Giuseppe Scrivano<gscrivano@gnu.org> wrote:
> Pádraig Brady <P@draigBrady.com> writes:
>
>>   -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
>>   -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i586
>>   -mtune=generic -fasynchronous-unwind-tables -D_GNU_SOURCE=1
>
> thanks.  I did again all tests on my machine using these same options.
> I repeated each test 6 times and I took the median without consider the
> first result.  Except the first run that it is not considered, I didn't
> report a big variance on results of the same test.
>
>
> gcc 4.3.3
>
> gnulib sha1:            real    0m2.543s
> gnulib sha1 lookup:     real    0m1.906s (-25%)
> linus's sha1:           real    0m2.468s (-3%)
> linus's sha1 no asm:    real    0m2.289s (-9%)
>
>
> gcc 4.4.1
>
> gnulib sha1:            real    0m3.386s
> gnulib sha1 lookup:     real    0m3.110s (-8%)
> linus's sha1:           real    0m1.701s (-49%)
> linus's sha1 no asm:    real    0m1.284s (-62%)
>
>
> I don't see such big differences in asm generated by gcc 4.4.1 and gcc
> 4.3.3 to explain this performance difference, what I noticed immediately
> is that in the gcc-4.4 generated asm there are more "lea" instructions
> (+30%), but I doubt this is the reason of these poor results.  Anyway, I
> haven't yet looked much in details.
>
> Cheers,
> Giuseppe

Interesting. I compared Linus' implementation to the public domain one
by Steve Reid[1], which is used in OpenLDAP and a few other projects.
Anyone with some experience testing these kinds of things in a
statistically sound manner want to try it out? In my tests, I got
this:

(average of 5 runs)
Linus' sha1: 283MB/s
Steve Reid's sha1: 305MB/s

- Steven

[1] http://gpl.nas-central.org/SYNOLOGY/x07-series/514_UNTARED/source/openldap-2.3.11/libraries/liblutil/sha1.c

^ permalink raw reply

* Re: [RFC PATCH v3 8/8] --sparse for porcelains
From: Jakub Narebski @ 2009-08-17 16:01 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Junio C Hamano, Nguyen Thai Ngoc Duy, git
In-Reply-To: <alpine.DEB.1.00.0908161002460.8306@pacific.mpi-cbg.de>

On Sun, 16 Aug 2009, Johannes Schindelin wrote:
> On Sun, 16 Aug 2009, Jakub Narebski wrote:
>> On Sat, 15 Aug 2009, Junio C Hamano wrote:
>>> Jakub Narebski <jnareb@gmail.com> writes:
>>> 
>>>>>> Hmmm... this looks like either argument for introducing --full 
>>>>>> option to git-checkout (ignore CE_VALID bit, checkout everything, 
>>>>>> and clean CE_VALID (?))...
>>>>>>
>>>>>>  ...or for going with _separate_ bit for partial checkout, like in 
>>>>>>  the very first version of this series, which otherwise functions 
>>>>>>  like CE_VALID, or is just used to mark that CE_VALID was set using 
>>>>>>  sparse.
>>> 
>>> How would a separate bit help?  Just like you need to clear CE_VALID 
>>> bit to revert the index into a normal (or "non sparse") state somehow, 
>>> you would need to have a way to clear that separate bit anyway.
>>> 
>>> A separate bit would help only if you want to handle assume-unchanged 
>>> and sparse checkout independently. But my impression was that the 
>>> recent lstat reduction effort addressed the issue assume-unchanged 
>>> were invented to work around in the first place.
>> 
>> Well, if we assume that we don't need (don't want) to handle 
>> assume-unchanged and sparse checkout independently, then of course the 
>> idea of having separate or additional bit for sparse doesn't make sense.
> 
> For the shallow/graft issue, we had a similar discussion.  Back then, I 
> was convinced that shallow commits and grafted commits were something 
> fundamentally different, and my recent patch to pack-objects shows that: 
> shallow commits do not have the real parents in the current repository, 
> and that makes them different from other grafted commits.
> 
> Now, if you want to say that assume-unchanged and sparse are two 
> fundamentally different things, I would be interested in some equally 
> convincing argument as for the shallow/graft issue.
> 
> There is a fundamental difference, I grant you that: the working directory 
> does not contain the "sparse'd away" files while the same is not true for 
> assume-unchanged files.
> 
> But does that matter?  The corresponding files are still in the index and 
> the repository.
> 
> IOW under what circumstances would you want to be able to discern between 
> assume-unchanged and "sparse'd away" files in the working directory?

>From what I understand it, assume-unchanged is performance optimization.
Sparse checkout is about files which are (assumed to) not be in working
directory, which means that they have to be assume-unchanged for git to
not try to access working area version of files which aren't there.

$GIT_DIR/info/sparse (or how it would be named; the name 'sparse' 
doesn't tell us whether patterns are about the files that are checked
out, or are about files which are not present in working directory)
is about specifying which files to checkout with "git checkout --sparse"
(or core.sparse / checkout.sparse = true).

> I could _imagine_ that you'd want a tool that allows you to change the 
> focus of the sparse checkout together with the working directory.  
> Example: you have a sparse checkout of Documentation/ and now you want to 
> have t/, too.  Just changing .git/info/sparse will not be enough.
> 
> The question is if the tool to change the "sparseness" [*1*] should not 
> change .git/info/sparse itself; if it does not, it would be good to be 
> able to discern between the "assume-unchanged" and "sparse'd away" files.
> 
> Although it might be enough to traverse the index and check the presence 
> of the assume-unchanged files in the working directory to determine which 
> files are sparse, and which ones are merely assume-unchanged.

There are quite a few possibilities: file can be marked "sparse" in
index (which also implies also marking it "assume-unchanged", if 
"assume-unchanged" doesn't work alone as "sparse" index bit) or not,
file can match 'no-checkout' pattern in $GIT_DIR/info/sparse or not,
file can be present in working directory or not:

 * match no-checkout
   - assume-unchanged
     + present in working directory
     + absent from working directory
   - no assume-unchanged
     + present
     + absent
 * doesn't match no-checkout
   - assume-unchanged
     + present
     + absent
   - no assume-unchanged
     + present
     + absent

> Footnote [*1*]: I think we need some nice and clear nomenclature here.  
> Any English wizards with a good taste of naming things?
 
English is not my native language, but what about:

 $GIT_DIR/info/
    no-checkout
    exclude-checkout
    workdir-exclude
    ignore-change
    assume-unchanged
    ghosts
  
-- 
Jakub Narebski
Poland

^ permalink raw reply

* Re: [PATCH 0/6] "git commit --dry-run" updates
From: Junio C Hamano @ 2009-08-17 15:57 UTC (permalink / raw)
  To: Thomas Rast; +Cc: git, Jeff King
In-Reply-To: <200908171201.43343.trast@student.ethz.ch>

Thomas Rast <trast@student.ethz.ch> writes:

> If it's not too much work, it would be nice to somehow detect if -u
> can have any influence at all.  For example,
>
>   $ git status bar
>   # Not currently on any branch.
>   nothing to commit (use -u to show untracked files)
>
> is a bit misleading if 'bar' is tracked because adding a -u won't make
> any difference.

It is an issue shared with the original "git status".  Running

    git init
    >file
    git add file
    git commit -m initial
    git status -uno

will give the same "use -u to show" message.

The thing is, "use -u to show" is because you told git not to check if
there is any untracked file.  Whoever added -uno wanted not to run the
recursive read_directory() to find them.

The message says "you told me not to check about untracked files, so I can
not show you any, because I did not check; if you want, please use -u to
tell me to check so that I can show them to you".  

It is not about "we know that there are untracked files but you told me
not to show it, so I am not telling".  We simply do not know at the point
we give that message.  In other words, conditional removal of that message
is fundamentally incompatible with the use of -uno.

^ permalink raw reply

* [PATCH] read-tree: Fix regression with creation of a new index file.
From: Alexandre Julliard @ 2009-08-17 15:35 UTC (permalink / raw)
  To: git; +Cc: Stephen Boyd

Reading the index into an empty file has been broken by
5a56da58060e50980fab0f4c38203a25440d1530, since it causes the existing
index to always be loaded first, and dies if it's an empty file:

$ GIT_INDEX_FILE=`mktemp` git read-tree master
fatal: index file smaller than expected

It breaks for instance committing from git.el. This patch reverts to the
previous behavior of only loading the index when merging it.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
---
 builtin-read-tree.c            |   10 ++++++----
 t/t1009-read-tree-new-index.sh |   25 +++++++++++++++++++++++++
 2 files changed, 31 insertions(+), 4 deletions(-)
 create mode 100755 t/t1009-read-tree-new-index.sh

diff --git a/builtin-read-tree.c b/builtin-read-tree.c
index 9c2d634..14c836b 100644
--- a/builtin-read-tree.c
+++ b/builtin-read-tree.c
@@ -113,13 +113,15 @@ int cmd_read_tree(int argc, const char **argv, const char *unused_prefix)
 	argc = parse_options(argc, argv, unused_prefix, read_tree_options,
 			     read_tree_usage, 0);
 
-	if (read_cache_unmerged() && (opts.prefix || opts.merge))
-		die("You need to resolve your current index first");
-
 	prefix_set = opts.prefix ? 1 : 0;
 	if (1 < opts.merge + opts.reset + prefix_set)
 		die("Which one? -m, --reset, or --prefix?");
-	stage = opts.merge = (opts.reset || opts.merge || prefix_set);
+
+	if (opts.reset || opts.merge || opts.prefix) {
+		if (read_cache_unmerged() && (opts.prefix || opts.merge))
+			die("You need to resolve your current index first");
+		stage = opts.merge = 1;
+	}
 
 	for (i = 0; i < argc; i++) {
 		const char *arg = argv[i];
diff --git a/t/t1009-read-tree-new-index.sh b/t/t1009-read-tree-new-index.sh
new file mode 100755
index 0000000..59b3aa4
--- /dev/null
+++ b/t/t1009-read-tree-new-index.sh
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+test_description='test read-tree into a fresh index file'
+
+. ./test-lib.sh
+
+test_expect_success setup '
+	echo one >a &&
+	git add a &&
+	git commit -m initial
+'
+
+test_expect_success 'non-existent index file' '
+	rm -f new-index &&
+	GIT_INDEX_FILE=new-index git read-tree master
+'
+
+test_expect_success 'empty index file' '
+	rm -f new-index &&
+	> new-index &&
+	GIT_INDEX_FILE=new-index git read-tree master
+'
+
+test_done
+
-- 
1.6.4.181.g3f2ea.dirty

-- 
Alexandre Julliard
julliard@winehq.org

^ permalink raw reply related

* Re: "make quick-install-man" broke recently
From: Junio C Hamano @ 2009-08-17 15:57 UTC (permalink / raw)
  To: Randal L. Schwartz
  Cc: Junio C Hamano, Jacob Helwig, Linus Torvalds, Kjetil Barvik,
	git@vger.kernel.org
In-Reply-To: <861vna8qj6.fsf@blue.stonehenge.com>

merlyn@stonehenge.com (Randal L. Schwartz) writes:

> It's good to know I wasn't hallucinating, in any case. :)

Thanks.

^ permalink raw reply

* [PATCH 01/11] Fix build failure at VC because function declare use old style at regex.c
From: Frank Li @ 2009-08-17 16:01 UTC (permalink / raw)
  To: git, msysgit; +Cc: Johannes.Schindelin, Frank Li

regerror declare function argument type after function define.

Signed-off-by: Frank Li <lznuaa@gmail.com>
---
 compat/regex/regex.c |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)

diff --git a/compat/regex/regex.c b/compat/regex/regex.c
index 5ea0075..5728de1 100644
--- a/compat/regex/regex.c
+++ b/compat/regex/regex.c
@@ -4852,11 +4852,7 @@ regexec (preg, string, nmatch, pmatch, eflags)
    from either regcomp or regexec.   We don't use PREG here.  */
 
 size_t
-regerror (errcode, preg, errbuf, errbuf_size)
-    int errcode;
-    const regex_t *preg;
-    char *errbuf;
-    size_t errbuf_size;
+regerror (int errcode, const regex_t * preg, char * errbuf,size_t errbuf_size)
 {
   const char *msg;
   size_t msg_size;
-- 
1.6.4.msysgit.0

^ permalink raw reply related

* [PATCH 02/11] Fix declare variable at mid of function
From: Frank Li @ 2009-08-17 16:01 UTC (permalink / raw)
  To: git, msysgit; +Cc: Johannes.Schindelin, Frank Li
In-Reply-To: <1250524872-5148-1-git-send-email-lznuaa@gmail.com>

Some compiler such as MSVC can't support declear variable at mid of funtion at c file.

Signed-off-by: Frank Li <lznuaa@gmail.com>
---
 compat/mingw.c |   16 ++++++++++++----
 help.c         |    3 ++-
 run-command.c  |    2 ++
 3 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/compat/mingw.c b/compat/mingw.c
index bed4178..75c74b1 100644
--- a/compat/mingw.c
+++ b/compat/mingw.c
@@ -123,13 +123,17 @@ int mingw_open (const char *filename, int oflags, ...)
 {
 	va_list args;
 	unsigned mode;
+	int fd;
+
 	va_start(args, oflags);
 	mode = va_arg(args, int);
 	va_end(args);
 
 	if (!strcmp(filename, "/dev/null"))
 		filename = "nul";
-	int fd = open(filename, oflags, mode);
+
+	fd = open(filename, oflags, mode);
+
 	if (fd < 0 && (oflags & O_CREAT) && errno == EACCES) {
 		DWORD attrs = GetFileAttributes(filename);
 		if (attrs != INVALID_FILE_ATTRIBUTES && (attrs & FILE_ATTRIBUTE_DIRECTORY))
@@ -580,10 +584,11 @@ static char **get_path_split(void)
 
 static void free_path_split(char **path)
 {
+	char **p = path;
+
 	if (!path)
 		return;
 
-	char **p = path;
 	while (*p)
 		free(*p++);
 	free(path);
@@ -1108,9 +1113,11 @@ int sigaction(int sig, struct sigaction *in, struct sigaction *out)
 #undef signal
 sig_handler_t mingw_signal(int sig, sig_handler_t handler)
 {
+	sig_handler_t old;
+
 	if (sig != SIGALRM)
 		return signal(sig, handler);
-	sig_handler_t old = timer_fn;
+	old = timer_fn;
 	timer_fn = handler;
 	return old;
 }
@@ -1197,8 +1204,9 @@ struct dirent *mingw_readdir(DIR *dir)
 
 	if (dir->dd_handle == (long)INVALID_HANDLE_VALUE && dir->dd_stat == 0)
 	{
+		DWORD lasterr;
 		handle = FindFirstFileA(dir->dd_name, &buf);
-		DWORD lasterr = GetLastError();
+		lasterr = GetLastError();
 		dir->dd_handle = (long)handle;
 		if (handle == INVALID_HANDLE_VALUE && (lasterr != ERROR_NO_MORE_FILES)) {
 			errno = err_win_to_posix(lasterr);
diff --git a/help.c b/help.c
index 6c46d8b..399b0b4 100644
--- a/help.c
+++ b/help.c
@@ -127,7 +127,7 @@ static int is_executable(const char *name)
 		return 0;
 
 #ifdef __MINGW32__
-	/* cannot trust the executable bit, peek into the file instead */
+{	/* cannot trust the executable bit, peek into the file instead */
 	char buf[3] = { 0 };
 	int n;
 	int fd = open(name, O_RDONLY);
@@ -140,6 +140,7 @@ static int is_executable(const char *name)
 				st.st_mode |= S_IXUSR;
 		close(fd);
 	}
+}
 #endif
 	return st.st_mode & S_IXUSR;
 }
diff --git a/run-command.c b/run-command.c
index ff3d8e2..d1df7ab 100644
--- a/run-command.c
+++ b/run-command.c
@@ -123,6 +123,7 @@ int start_command(struct child_process *cmd)
 		exit(127);
 	}
 #else
+{
 	int s0 = -1, s1 = -1, s2 = -1;	/* backups of stdin, stdout, stderr */
 	const char **sargv = cmd->argv;
 	char **env = environ;
@@ -186,6 +187,7 @@ int start_command(struct child_process *cmd)
 		dup2(s1, 1), close(s1);
 	if (s2 >= 0)
 		dup2(s2, 2), close(s2);
+}
 #endif
 
 	if (cmd->pid < 0) {
-- 
1.6.4.msysgit.0

^ permalink raw reply related

* [PATCH 03/11] Define SNPRINTF_SIZE_CORR 1 when use MSVC build git
From: Frank Li @ 2009-08-17 16:01 UTC (permalink / raw)
  To: git, msysgit; +Cc: Johannes.Schindelin, Frank Li
In-Reply-To: <1250524872-5148-2-git-send-email-lznuaa@gmail.com>

There are not NUL at vsnprintf verstion of MSVC when rearch max len.
Define vsnprintf to _vsnprintf. vsnprintf have deprecated.

Signed-off-by: Frank Li <lznuaa@gmail.com>
---
 compat/snprintf.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/compat/snprintf.c b/compat/snprintf.c
index 6c0fb05..47b2b8a 100644
--- a/compat/snprintf.c
+++ b/compat/snprintf.c
@@ -6,7 +6,7 @@
  * number of characters to write without the trailing NUL.
  */
 #ifndef SNPRINTF_SIZE_CORR
-#if defined(__MINGW32__) && defined(__GNUC__) && __GNUC__ < 4
+#if defined(__MINGW32__) && defined(__GNUC__) && __GNUC__ < 4 || defined(_MSC_VER)
 #define SNPRINTF_SIZE_CORR 1
 #else
 #define SNPRINTF_SIZE_CORR 0
@@ -14,6 +14,11 @@
 #endif
 
 #undef vsnprintf
+
+#if defined(_MSC_VER)
+#define vsnprintf _vsnprintf
+#endif
+
 int git_vsnprintf(char *str, size_t maxsize, const char *format, va_list ap)
 {
 	char *s;
-- 
1.6.4.msysgit.0

^ permalink raw reply related

* [PATCH 04/11] Add _MSC_VER predefine macro to make same behaviors with __MINGW32__ Enable MSVC build. MSVC have the save behaviors with msysgit.
From: Frank Li @ 2009-08-17 16:01 UTC (permalink / raw)
  To: git, msysgit; +Cc: Johannes.Schindelin, Frank Li
In-Reply-To: <1250524872-5148-3-git-send-email-lznuaa@gmail.com>

Signed-off-by: Frank Li <lznuaa@gmail.com>
---
 help.c        |    2 +-
 pager.c       |    4 ++--
 run-command.c |    8 ++++----
 run-command.h |    2 +-
 setup.c       |    2 +-
 5 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/help.c b/help.c
index 399b0b4..a311241 100644
--- a/help.c
+++ b/help.c
@@ -126,7 +126,7 @@ static int is_executable(const char *name)
 	    !S_ISREG(st.st_mode))
 		return 0;
 
-#ifdef __MINGW32__
+#if defined(__MINGW32__) || defined(_MSC_VER)
 {	/* cannot trust the executable bit, peek into the file instead */
 	char buf[3] = { 0 };
 	int n;
diff --git a/pager.c b/pager.c
index 4921843..28122c5 100644
--- a/pager.c
+++ b/pager.c
@@ -9,7 +9,7 @@
 
 static int spawned_pager;
 
-#ifndef __MINGW32__
+#if !defined(__MINGW32__) && !defined(_MSC_VER)
 static void pager_preexec(void)
 {
 	/*
@@ -70,7 +70,7 @@ void setup_pager(void)
 	pager_argv[2] = pager;
 	pager_process.argv = pager_argv;
 	pager_process.in = -1;
-#ifndef __MINGW32__
+#if !defined(__MINGW32__) && !defined(_MSC_VER)
 	pager_process.preexec_cb = pager_preexec;
 #endif
 	if (start_command(&pager_process))
diff --git a/run-command.c b/run-command.c
index d1df7ab..df139da 100644
--- a/run-command.c
+++ b/run-command.c
@@ -67,7 +67,7 @@ int start_command(struct child_process *cmd)
 
 	trace_argv_printf(cmd->argv, "trace: run_command:");
 
-#ifndef __MINGW32__
+#if !defined(__MINGW32__) && !defined(_MSC_VER)
 	fflush(NULL);
 	cmd->pid = fork();
 	if (!cmd->pid) {
@@ -294,7 +294,7 @@ int run_command_v_opt_cd_env(const char **argv, int opt, const char *dir, const
 	return run_command(&cmd);
 }
 
-#ifdef __MINGW32__
+#if defined(__MINGW32__) || defined(_MSC_VER)
 static __stdcall unsigned run_thread(void *data)
 {
 	struct async *async = data;
@@ -310,7 +310,7 @@ int start_async(struct async *async)
 		return error("cannot create pipe: %s", strerror(errno));
 	async->out = pipe_out[0];
 
-#ifndef __MINGW32__
+#if !defined(__MINGW32__) && !defined(_MSC_VER)
 	/* Flush stdio before fork() to avoid cloning buffers */
 	fflush(NULL);
 
@@ -339,7 +339,7 @@ int start_async(struct async *async)
 
 int finish_async(struct async *async)
 {
-#ifndef __MINGW32__
+#if !defined(__MINGW32__) && !defined(_MSC_VER)
 	int ret = 0;
 
 	if (wait_or_whine(async->pid))
diff --git a/run-command.h b/run-command.h
index e345502..57a707b 100644
--- a/run-command.h
+++ b/run-command.h
@@ -79,7 +79,7 @@ struct async {
 	int (*proc)(int fd, void *data);
 	void *data;
 	int out;	/* caller reads from here and closes it */
-#ifndef __MINGW32__
+#if !defined(__MINGW32__) && !defined(_MSC_VER)
 	pid_t pid;
 #else
 	HANDLE tid;
diff --git a/setup.c b/setup.c
index e3781b6..14e3ca7 100644
--- a/setup.c
+++ b/setup.c
@@ -41,7 +41,7 @@ const char *prefix_path(const char *prefix, int len, const char *path)
 const char *prefix_filename(const char *pfx, int pfx_len, const char *arg)
 {
 	static char path[PATH_MAX];
-#ifndef __MINGW32__
+#if !defined(__MINGW32__) && !defined(_MSC_VER)
 	if (!pfx || !*pfx || is_absolute_path(arg))
 		return arg;
 	memcpy(path, pfx, pfx_len);
-- 
1.6.4.msysgit.0

^ permalink raw reply related

* [PATCH 05/11] Remove va_copy at MSVC because there are va_copy.
From: Frank Li @ 2009-08-17 16:04 UTC (permalink / raw)
  To: git, msysgit; +Cc: Johannes.Schindelin, Frank Li

MSVs have not implemented va_copy. remove va_copy at MSVC environment.
It will malloc buffer each time.

Signed-off-by: Frank Li <lznuaa@gmail.com>
---
 compat/winansi.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/compat/winansi.c b/compat/winansi.c
index 9217c24..6091138 100644
--- a/compat/winansi.c
+++ b/compat/winansi.c
@@ -3,7 +3,11 @@
  */
 
 #include <windows.h>
+#ifdef _MSC_VER
+#include <stdio.h>
+#else
 #include "../git-compat-util.h"
+#endif
 
 /*
  Functions to be wrapped:
@@ -310,9 +314,13 @@ static int winansi_vfprintf(FILE *stream, const char *format, va_list list)
 	if (!console)
 		goto abort;
 
+#ifndef _MSC_VER 
 	va_copy(cp, list);
 	len = vsnprintf(small_buf, sizeof(small_buf), format, cp);
 	va_end(cp);
+#else
+	len= sizeof(small_buf) ;
+#endif
 
 	if (len > sizeof(small_buf) - 1) {
 		buf = malloc(len + 1);
-- 
1.6.4.msysgit.0

^ permalink raw reply related

* [PATCH 06/11] Add miss git-compat-util.h at regex.c and fnmatch.c Add git-compat-util.h to enable build at MSVC environment
From: Frank Li @ 2009-08-17 16:04 UTC (permalink / raw)
  To: git, msysgit; +Cc: Johannes.Schindelin, Frank Li

Signed-off-by: Frank Li <lznuaa@gmail.com>
---
 compat/fnmatch/fnmatch.c |    4 ++++
 compat/regex/regex.c     |    4 ++++
 2 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/compat/fnmatch/fnmatch.c b/compat/fnmatch/fnmatch.c
index 14feac7..5cbd49c 100644
--- a/compat/fnmatch/fnmatch.c
+++ b/compat/fnmatch/fnmatch.c
@@ -16,6 +16,10 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+#ifdef _MSC_VER
+#include "git-compat-util.h"
+#endif
+
 #if HAVE_CONFIG_H
 # include <config.h>
 #endif
diff --git a/compat/regex/regex.c b/compat/regex/regex.c
index 5728de1..2298a3a 100644
--- a/compat/regex/regex.c
+++ b/compat/regex/regex.c
@@ -20,6 +20,10 @@
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
 /* AIX requires this to be the first thing in the file. */
+#ifdef _MSC_VER
+#include "git-compat-util.h"
+#endif
+
 #if defined (_AIX) && !defined (REGEX_MALLOC)
   #pragma alloca
 #endif
-- 
1.6.4.msysgit.0

^ permalink raw reply related

* [PATCH 07/11] Add  O_BINARY flag to open flag at mingw.c
From: Frank Li @ 2009-08-17 16:04 UTC (permalink / raw)
  To: git, msysgit; +Cc: Johannes.Schindelin, Frank Li
In-Reply-To: <1250525103-5184-1-git-send-email-lznuaa@gmail.com>

Windows will convert CR\LF and union code at text mode.
Git doesn't like this. Add O_BINARY flag to open function

Signed-off-by: Frank Li <lznuaa@gmail.com>
---
 compat/mingw.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/compat/mingw.c b/compat/mingw.c
index 75c74b1..d5fa0ed 100644
--- a/compat/mingw.c
+++ b/compat/mingw.c
@@ -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(filename, oflags | O_BINARY, mode);
 
 	if (fd < 0 && (oflags & O_CREAT) && errno == EACCES) {
 		DWORD attrs = GetFileAttributes(filename);
@@ -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(filename, O_RDWR | O_CREAT | O_BINARY, 0600);
 }
 
 int gettimeofday(struct timeval *tv, void *tz)
-- 
1.6.4.msysgit.0

^ permalink raw reply related

* Re: sparse support in pu
From: Junio C Hamano @ 2009-08-17 16:05 UTC (permalink / raw)
  To: Johannes Schindelin
  Cc: Peter Harris, Nguyen Thai Ngoc Duy, Johannes Sixt, skillzero, git
In-Reply-To: <alpine.DEB.1.00.0908171522510.4991@intel-tinevez-2-302>

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

>> That's funny. I have a git tree that would benefit from sparse checkout. 
>> I know which path I _don't_ want. Specifying all the paths I want would 
>> be a rather longer (and more error-prone) list. I suspect it would be 
>> best to support both.
>
> Yes, I agree, but the common case is for people to know what they are 
> working on, right?

I either may be working on Documentation/ (I know I do not care about
everthing else so I can afford to list Makefile and Documentation/ in the
"interesting" list), or I either may be working on code (I do not know how
many code directories there are, and do not care to list them, but I know
I do not need Documentation/ and contrib/).  You need both ways.

And with .gitignore syntax you can have both.

^ permalink raw reply

* [PATCH 08/11] Place __stdcall to correct position.
From: Frank Li @ 2009-08-17 16:04 UTC (permalink / raw)
  To: git, msysgit; +Cc: Johannes.Schindelin, Frank Li
In-Reply-To: <1250525103-5184-2-git-send-email-lznuaa@gmail.com>

MSVC require __stdcall is between return value and function name.
ALL Win32 API definition is as TYPE WINAPI function name

Signed-off-by: Frank Li <lznuaa@gmail.com>
---
 compat/mingw.c |    4 ++--
 run-command.c  |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/compat/mingw.c b/compat/mingw.c
index d5fa0ed..0c9c793 100644
--- a/compat/mingw.c
+++ b/compat/mingw.c
@@ -1017,7 +1017,7 @@ static sig_handler_t timer_fn = SIG_DFL;
  * length to call the signal handler.
  */
 
-static __stdcall unsigned ticktack(void *dummy)
+static unsigned __stdcall ticktack(void *dummy)
 {
 	while (WaitForSingleObject(timer_event, timer_interval) == WAIT_TIMEOUT) {
 		if (timer_fn == SIG_DFL)
@@ -1146,7 +1146,7 @@ void mingw_open_html(const char *unixpath)
 
 int link(const char *oldpath, const char *newpath)
 {
-	typedef BOOL WINAPI (*T)(const char*, const char*, LPSECURITY_ATTRIBUTES);
+	typedef  BOOL (WINAPI *T)(const char*, const char*, LPSECURITY_ATTRIBUTES);
 	static T create_hard_link = NULL;
 	if (!create_hard_link) {
 		create_hard_link = (T) GetProcAddress(
diff --git a/run-command.c b/run-command.c
index df139da..423b506 100644
--- a/run-command.c
+++ b/run-command.c
@@ -295,12 +295,12 @@ int run_command_v_opt_cd_env(const char **argv, int opt, const char *dir, const
 }
 
 #if defined(__MINGW32__) || defined(_MSC_VER)
-static __stdcall unsigned run_thread(void *data)
+static unsigned __stdcall run_thread(void *data)
 {
 	struct async *async = data;
 	return async->proc(async->fd_for_proc, async->data);
 }
-#endif
+#endif /* __MINGW32__ || _MSC_VER */
 
 int start_async(struct async *async)
 {
-- 
1.6.4.msysgit.0

^ permalink raw reply related

* [PATCH 09/11] Add MSVC porting header files.
From: Frank Li @ 2009-08-17 16:05 UTC (permalink / raw)
  To: git, msysgit; +Cc: Johannes.Schindelin, Frank Li
In-Reply-To: <1250525103-5184-3-git-send-email-lznuaa@gmail.com>

Add unix head file, dirent.h, unistd.h  and time.h
Add MSVC special porting head file msvc.h and msvc.c.

Signed-off-by: Frank Li <lznuaa@gmail.com>
---
 compat/msvc.c                   |   33 ++++++++++
 compat/msvc.h                   |   95 +++++++++++++++++++++++++++++
 compat/vcbuild/include/dirent.h |  127 +++++++++++++++++++++++++++++++++++++++
 compat/vcbuild/include/unistd.h |   92 ++++++++++++++++++++++++++++
 compat/vcbuild/sys/time.h       |   21 +++++++
 git-compat-util.h               |   12 ++++-
 6 files changed, 379 insertions(+), 1 deletions(-)
 create mode 100644 compat/msvc.c
 create mode 100644 compat/msvc.h
 create mode 100644 compat/vcbuild/include/dirent.h
 create mode 100644 compat/vcbuild/include/unistd.h
 create mode 100644 compat/vcbuild/sys/time.h

diff --git a/compat/msvc.c b/compat/msvc.c
new file mode 100644
index 0000000..80afd4d
--- /dev/null
+++ b/compat/msvc.c
@@ -0,0 +1,33 @@
+#include "../git-compat-util.h"
+#include "win32.h"
+#include <conio.h>
+#include "../strbuf.h"
+
+DIR *opendir(const char *name)
+{
+	int len;
+	DIR *p;
+	p = (DIR*)malloc(sizeof(DIR));
+	memset(p, 0, sizeof(DIR));
+	strncpy(p->dd_name, name, PATH_MAX);
+	len = strlen(p->dd_name);
+	p->dd_name[len] = '/';
+	p->dd_name[len+1] = '*';
+
+	if (p == NULL)
+		return NULL;
+
+	p->dd_handle = _findfirst(p->dd_name, &p->dd_dta);
+
+	if (p->dd_handle == -1) {
+		free(p);
+		return NULL;
+	}
+	return p;
+}
+int closedir(DIR *dir)
+{
+	_findclose(dir->dd_handle);
+	free(dir);
+	return 0;
+}
diff --git a/compat/msvc.h b/compat/msvc.h
new file mode 100644
index 0000000..6071565
--- /dev/null
+++ b/compat/msvc.h
@@ -0,0 +1,95 @@
+#ifndef __MSVC__HEAD
+#define __MSVC__HEAD
+
+#define WINVER 0x0500
+#define _WIN32_WINNT 0x0500
+#define _WIN32_WINDOWS 0x0410
+#define _WIN32_IE 0x0700
+#define NTDDI_VERSION NTDDI_WIN2KSP1
+#include <winsock2.h>
+
+/*Configuration*/
+
+#define NO_PREAD
+#define NO_OPENSSL
+#define NO_LIBGEN_H
+#define NO_SYMLINK_HEAD
+#define NO_IPV6
+#define NO_SETENV
+#define NO_UNSETENV
+#define NO_STRCASESTR
+#define NO_STRLCPY
+#define NO_MEMMEM
+#define NO_C99_FORMAT
+#define NO_STRTOUMAX
+#define NO_MKDTEMP
+#define NO_MKSTEMPS
+
+#define RUNTIME_PREFIX
+#define NO_ST_BLOCKS_IN_STRUCT_STAT
+#define NO_NSEC
+#define USE_WIN32_MMAP
+#define USE_NED_ALLOCATOR
+
+#define NO_REGEX
+
+#define NO_SYS_SELECT_H
+#define NO_PTHEADS
+#define HAVE_STRING_H 1
+#define STDC_HEADERS
+#define NO_ICONV
+
+#define inline __inline
+#define __inline__ __inline
+
+#define SNPRINTF_RETURNS_BOGUS
+
+#define SHA1_HEADER "mozilla-sha1\\sha1.h"
+
+#define ETC_GITCONFIG "%HOME%"
+
+#define NO_PTHREADS
+#define NO_CURL
+
+
+#define NO_STRTOUMAX
+#define REGEX_MALLOC
+
+
+#define GIT_EXEC_PATH "bin"
+#define GIT_VERSION "1.6"
+#define BINDIR "bin"
+#define PREFIX "."
+#define GIT_MAN_PATH "man"
+#define GIT_INFO_PATH "info"
+#define GIT_HTML_PATH "html"
+#define DEFAULT_GIT_TEMPLATE_DIR "templates"
+
+#define NO_STRLCPY
+#define NO_UNSETENV
+#define NO_SETENV
+
+#define strdup _strdup
+#define read _read
+#define close _close
+#define dup _dup
+#define dup2 _dup2
+#define strncasecmp _strnicmp
+#define strtoull _strtoui64
+
+#define __attribute__(x)
+
+static __inline int strcasecmp (const char *s1, const char *s2)
+{
+	int size1=strlen(s1);
+	int sisz2=strlen(s2);
+
+	return _strnicmp(s1,s2,sisz2>size1?sisz2:size1);
+}
+
+#include "compat/mingw.h"
+#undef ERROR
+#undef stat
+#define stat(x,y) mingw_lstat
+#define stat      _stat64
+#endif
\ No newline at end of file
diff --git a/compat/vcbuild/include/dirent.h b/compat/vcbuild/include/dirent.h
new file mode 100644
index 0000000..a6b6f4c
--- /dev/null
+++ b/compat/vcbuild/include/dirent.h
@@ -0,0 +1,127 @@
+/*
+ * DIRENT.H (formerly DIRLIB.H)
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is a part of the mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within the package.
+ *
+ */
+#ifndef _DIRENT_H_
+#define _DIRENT_H_
+
+/* All the headers include this file. */
+//#include <_mingw.h>
+
+#include <io.h>
+
+#define PATH_MAX 512
+
+#define __MINGW_NOTHROW
+
+#ifndef RC_INVOKED
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct dirent
+{
+	long		d_ino;		/* Always zero. */
+	unsigned short	d_reclen;	/* Always zero. */
+	unsigned short	d_namlen;	/* Length of name in d_name. */
+	char		d_name[FILENAME_MAX]; /* File name. */
+};
+
+/*
+ * This is an internal data structure. Good programmers will not use it
+ * except as an argument to one of the functions below.
+ * dd_stat field is now int (was short in older versions).
+ */
+typedef struct
+{
+	/* disk transfer area for this dir */
+	struct _finddata_t	dd_dta;
+
+	/* dirent struct to return from dir (NOTE: this makes this thread
+	 * safe as long as only one thread uses a particular DIR struct at
+	 * a time) */
+	struct dirent		dd_dir;
+
+	/* _findnext handle */
+	long			dd_handle;
+
+	/*
+         * Status of search:
+	 *   0 = not started yet (next entry to read is first entry)
+	 *  -1 = off the end
+	 *   positive = 0 based index of next entry
+	 */
+	int			dd_stat;
+
+	/* given path for dir with search pattern (struct is extended) */
+	char			dd_name[PATH_MAX+3];
+} DIR;
+
+DIR* __cdecl __MINGW_NOTHROW opendir (const char*);
+struct dirent* __cdecl __MINGW_NOTHROW readdir (DIR*);
+int __cdecl __MINGW_NOTHROW closedir (DIR*);
+void __cdecl __MINGW_NOTHROW rewinddir (DIR*);
+long __cdecl __MINGW_NOTHROW telldir (DIR*);
+void __cdecl __MINGW_NOTHROW seekdir (DIR*, long);
+
+
+/* wide char versions */
+
+struct _wdirent
+{
+	long		d_ino;		/* Always zero. */
+	unsigned short	d_reclen;	/* Always zero. */
+	unsigned short	d_namlen;	/* Length of name in d_name. */
+	wchar_t		d_name[FILENAME_MAX]; /* File name. */
+};
+
+/*
+ * This is an internal data structure. Good programmers will not use it
+ * except as an argument to one of the functions below.
+ */
+typedef struct
+{
+	/* disk transfer area for this dir */
+	//struct _wfinddata_t	dd_dta;
+
+	/* dirent struct to return from dir (NOTE: this makes this thread
+	 * safe as long as only one thread uses a particular DIR struct at
+	 * a time) */
+	struct _wdirent		dd_dir;
+
+	/* _findnext handle */
+	long			dd_handle;
+
+	/*
+         * Status of search:
+	 *   0 = not started yet (next entry to read is first entry)
+	 *  -1 = off the end
+	 *   positive = 0 based index of next entry
+	 */
+	int			dd_stat;
+
+	/* given path for dir with search pattern (struct is extended) */
+	wchar_t			dd_name[1];
+} _WDIR;
+
+
+
+_WDIR* __cdecl __MINGW_NOTHROW _wopendir (const wchar_t*);
+struct _wdirent*  __cdecl __MINGW_NOTHROW _wreaddir (_WDIR*);
+int __cdecl __MINGW_NOTHROW _wclosedir (_WDIR*);
+void __cdecl __MINGW_NOTHROW _wrewinddir (_WDIR*);
+long __cdecl __MINGW_NOTHROW _wtelldir (_WDIR*);
+void __cdecl __MINGW_NOTHROW _wseekdir (_WDIR*, long);
+
+
+#ifdef	__cplusplus
+}
+#endif
+
+#endif	/* Not RC_INVOKED */
+
+#endif	/* Not _DIRENT_H_ */
diff --git a/compat/vcbuild/include/unistd.h b/compat/vcbuild/include/unistd.h
new file mode 100644
index 0000000..a0f59e6
--- /dev/null
+++ b/compat/vcbuild/include/unistd.h
@@ -0,0 +1,92 @@
+#ifndef _UNISTD_
+#define _UNISTD_
+
+/* Win32 define for porting git*/
+
+#ifndef _MODE_T_
+#define	_MODE_T_
+typedef unsigned short _mode_t;
+
+#ifndef	_NO_OLDNAMES
+typedef _mode_t	mode_t;
+#endif
+#endif	/* Not _MODE_T_ */
+
+#ifndef _SSIZE_T_
+#define _SSIZE_T_
+typedef long _ssize_t;
+
+#ifndef	_OFF_T_
+#define	_OFF_T_
+typedef long _off_t;
+
+#ifndef	_NO_OLDNAMES
+typedef _off_t	off_t;
+#endif
+#endif	/* Not _OFF_T_ */
+
+
+#ifndef	_NO_OLDNAMES
+typedef _ssize_t ssize_t;
+#endif
+#endif /* Not _SSIZE_T_ */
+
+typedef signed char int8_t;
+typedef unsigned char   uint8_t;
+typedef short  int16_t;
+typedef unsigned short  uint16_t;
+typedef int  int32_t;
+typedef unsigned   uint32_t;
+typedef long long  int64_t;
+typedef unsigned long long   uint64_t;
+
+typedef long long  intmax_t;
+typedef unsigned long long uintmax_t;
+
+typedef int64_t off64_t;
+
+#define STDOUT_FILENO 1
+#define STDERR_FILENO 2
+
+/* Some defines for _access nAccessMode (MS doesn't define them, but
+ * it doesn't seem to hurt to add them). */
+#define	F_OK	0	/* Check for file existence */
+/* Well maybe it does hurt.  On newer versions of MSVCRT, an access mode
+   of 1 causes invalid parameter error. */ 
+#define	X_OK	0	/* MS access() doesn't check for execute permission. */
+#define	W_OK	2	/* Check for write permission */
+#define	R_OK	4	/* Check for read permission */
+
+#define	_S_IFIFO	0x1000	/* FIFO */
+#define	_S_IFCHR	0x2000	/* Character */
+#define	_S_IFBLK	0x3000	/* Block: Is this ever set under w32? */
+#define	_S_IFDIR	0x4000	/* Directory */
+#define	_S_IFREG	0x8000	/* Regular */
+
+#define	_S_IFMT		0xF000	/* File type mask */
+
+#define	_S_IXUSR	_S_IEXEC
+#define	_S_IWUSR	_S_IWRITE
+#define	_S_IRUSR	_S_IREAD
+#define	_S_ISDIR(m)	(((m) & _S_IFMT) == _S_IFDIR)
+
+#define	S_IFIFO		_S_IFIFO
+#define	S_IFCHR		_S_IFCHR
+#define	S_IFBLK		_S_IFBLK
+#define	S_IFDIR		_S_IFDIR
+#define	S_IFREG		_S_IFREG
+#define	S_IFMT		_S_IFMT
+#define	S_IEXEC		_S_IEXEC
+#define	S_IWRITE	_S_IWRITE
+#define	S_IREAD		_S_IREAD
+#define	S_IRWXU		_S_IRWXU
+#define	S_IXUSR		_S_IXUSR
+#define	S_IWUSR		_S_IWUSR
+#define	S_IRUSR		_S_IRUSR
+
+
+#define	S_ISDIR(m)	(((m) & S_IFMT) == S_IFDIR)
+#define	S_ISREG(m)	(((m) & S_IFMT) == S_IFREG)
+#define	S_ISFIFO(m)	(((m) & S_IFMT) == S_IFIFO)
+
+#endif
\ No newline at end of file
diff --git a/compat/vcbuild/sys/time.h b/compat/vcbuild/sys/time.h
new file mode 100644
index 0000000..6ed82c0
--- /dev/null
+++ b/compat/vcbuild/sys/time.h
@@ -0,0 +1,21 @@
+#ifndef	_UTIME_H_
+#define	_UTIME_H_
+/*
+ * Structure used by _utime function.
+ */
+struct _utimbuf
+{
+	time_t	actime;		/* Access time */
+	time_t	modtime;	/* Modification time */
+};
+
+#ifndef	_NO_OLDNAMES
+/* NOTE: Must be the same as _utimbuf above. */
+struct utimbuf
+{
+	time_t	actime;
+	time_t	modtime;
+};
+#endif	/* Not _NO_OLDNAMES */
+
+#endif
diff --git a/git-compat-util.h b/git-compat-util.h
index 9f941e4..cb89294 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -77,8 +77,10 @@
 #include <string.h>
 #include <errno.h>
 #include <limits.h>
+#ifndef _MSC_VER
 #include <sys/param.h>
 #include <sys/types.h>
+#endif
 #include <dirent.h>
 #include <sys/time.h>
 #include <time.h>
@@ -86,7 +88,12 @@
 #include <fnmatch.h>
 #include <assert.h>
 #include <regex.h>
+
+#ifndef _MSC_VER
 #include <utime.h>
+#endif
+
+#ifndef _MSC_VER
 #ifndef __MINGW32__
 #include <sys/wait.h>
 #include <sys/poll.h>
@@ -114,7 +121,10 @@
 #else 	/* __MINGW32__ */
 /* pull in Windows compatibility stuff */
 #include "compat/mingw.h"
-#endif	/* __MINGW32__ */
+#endif  /* __MINGW32__ */
+#else   /* _MSC_VER */
+#include "compat/msvc.h"
+#endif	/* _MSC_VER */
 
 #ifndef NO_LIBGEN_H
 #include <libgen.h>
-- 
1.6.4.msysgit.0

^ permalink raw reply related

* Re: [RFC PATCH v3 8/8] --sparse for porcelains
From: Nguyen Thai Ngoc Duy @ 2009-08-17 16:06 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Johannes Schindelin, Jakub Narebski, git
In-Reply-To: <7vtz06xxao.fsf@alter.siamese.dyndns.org>

On Mon, Aug 17, 2009 at 10:41 PM, Junio C Hamano<gitster@pobox.com> wrote:
> How should assume-unchanged play with this philosophy?
>
> I'd say that assume-unchanged is a promise you make git that you won't
> change these paths, and in return to the promise git will give you faster
> response by not running lstat on them.  Having changes in such paths is
> your problem and you deserve these chanegs to be lost.  At least, that is
> the interpretation according to the original assume-unchanged semantics.

But commit 5f73076 ("Assume unchanged" git) says [1] it favors safety
over performance? Otherwise I'd need to resurrect no-checkout bit.

[1] excerpt from the mentioned commit:
--<--
    Index entries marked with CE_VALID bit are assumed to be
    unchanged most of the time.  However, there are cases that
    CE_VALID bit is ignored for the sake of safety and usability:

     - while "git-read-tree -m" or git-apply need to make sure
       that the paths involved in the merge do not have local
       modifications.  This sacrifices performance for safety.

     - when git-checkout-index -f -q -u -a tries to see if it needs
       to checkout the paths.  Otherwise you can never check
       anything out ;-).

     - when git-update-index --really-refresh (a new flag) tries to
       see if the index entry is up to date.  You can start with
       everything marked as CE_VALID and run this once to drop
       CE_VALID bit for paths that are modified.
--<--
-- 
Duy

^ permalink raw reply

* [PATCH 10/11] Add MSVC Project file
From: Frank Li @ 2009-08-17 16:05 UTC (permalink / raw)
  To: git, msysgit; +Cc: Johannes.Schindelin, Frank Li
In-Reply-To: <1250525103-5184-4-git-send-email-lznuaa@gmail.com>

Add libgit.vcproj to build common library.
Add git.vcproj to build git program.

Signed-off-by: Frank Li <lznuaa@gmail.com>
---
 compat/vcbuild/git/git.vcproj       |  197 +++++
 compat/vcbuild/libgit/libgit.vcproj | 1347 +++++++++++++++++++++++++++++++++++
 2 files changed, 1544 insertions(+), 0 deletions(-)
 create mode 100644 compat/vcbuild/git/git.vcproj
 create mode 100644 compat/vcbuild/libgit/libgit.vcproj

diff --git a/compat/vcbuild/git/git.vcproj b/compat/vcbuild/git/git.vcproj
new file mode 100644
index 0000000..6f85de3
--- /dev/null
+++ b/compat/vcbuild/git/git.vcproj
@@ -0,0 +1,197 @@
+<?xml version="1.0" encoding="gb2312"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="9.00"
+	Name="git"
+	ProjectGUID="{E3E30E51-C5AD-407B-AB43-985E4111474A}"
+	RootNamespace="git"
+	Keyword="Win32Proj"
+	TargetFrameworkVersion="196613"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)\bin"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="0"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..;..\..\..\..\zlib;..\..;..\;..\include;..\..\..\compat;..\..\..\compat\fnmatch;..\..\..\compat\regex;.\"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="wininet.lib ws2_32.lib "
+				LinkIncremental="2"
+				GenerateDebugInformation="true"
+				SubSystem="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)\bin"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="0"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				EnableIntrinsicFunctions="true"
+				AdditionalIncludeDirectories="..\..\..;..\..\..\..\zlib;..\..;..\;..\include;..\..\..\compat;..\..\..\compat\fnmatch;..\..\..\compat\regex;.\"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="wininet.lib ws2_32.lib "
+				LinkIncremental="1"
+				GenerateDebugInformation="true"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+			>
+			<File
+				RelativePath="..\..\..\git.c"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+			>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+			>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/compat/vcbuild/libgit/libgit.vcproj b/compat/vcbuild/libgit/libgit.vcproj
new file mode 100644
index 0000000..bbc3aed
--- /dev/null
+++ b/compat/vcbuild/libgit/libgit.vcproj
@@ -0,0 +1,1347 @@
+<?xml version="1.0" encoding="gb2312"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="9.00"
+	Name="libgit"
+	ProjectGUID="{F6DEC8C3-B803-4A86-8848-430F08B499E3}"
+	RootNamespace="libgit"
+	Keyword="Win32Proj"
+	TargetFrameworkVersion="196613"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="4"
+			CharacterSet="0"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories="..\..\..;..\..\..\..\zlib;..\..;..\;..\include;..\..\..\compat;..\..\..\compat\fnmatch;..\..\..\compat\regex;.\"
+				PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLibrarianTool"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="4"
+			CharacterSet="0"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				EnableIntrinsicFunctions="true"
+				AdditionalIncludeDirectories="..\..\..;..\..\..\..\zlib;..\..;..\;..\include;..\..\..\compat;..\..\..\compat\fnmatch;..\..\..\compat\regex;.\"
+				PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLibrarianTool"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+			>
+			<File
+				RelativePath="..\..\msvc.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\mozilla-sha1\sha1.c"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+			>
+			<File
+				RelativePath="..\..\..\archive.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\attr.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\blob.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\branch.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\builtin.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\bundle.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\cache-tree.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\cache.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\color.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\commit.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\csum-file.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\decorate.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\delta.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\diff.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\diffcore.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\dir.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\exec_cmd.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\fetch-pack.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\fsck.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\git-compat-util.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\graph.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\grep.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\hash.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\help.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\http.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\levenshtein.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\list-objects.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ll-merge.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\log-tree.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\mailmap.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\merge-recursive.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\notes.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\object.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\pack-refs.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\pack-revindex.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\pack.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\parse-options.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\patch-ids.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\pkt-line.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\progress.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\quote.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\reachable.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\reflog-walk.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\refs.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\remote.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\rerere.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\revision.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\run-command.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\send-pack.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\sha1-lookup.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\shortlog.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\sideband.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\sigchain.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\strbuf.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\string-list.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\tag.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\tar.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\thread-utils.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\transport.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\tree-walk.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\tree.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\unpack-trees.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\userdiff.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\utf8.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\walker.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\wt-status.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\xdiff-interface.h"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+			>
+		</Filter>
+		<Filter
+			Name="compat"
+			>
+			<File
+				RelativePath="..\..\..\compat\basename.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\compat\cygwin.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\compat\fnmatch\fnmatch.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\compat\fnmatch\fnmatch.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\compat\fopen.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\compat\memmem.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\compat\mingw.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\compat\mingw.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\compat\mkdtemp.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\compat\mkstemps.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\compat\pread.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\compat\qsort.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\compat\regex\regex.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\compat\regex\regex.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\compat\setenv.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\compat\snprintf.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\compat\strcasestr.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\compat\strlcpy.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\compat\strtoumax.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\compat\unsetenv.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\compat\win32.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\compat\win32mmap.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\compat\winansi.c"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="git"
+			>
+			<File
+				RelativePath="..\..\..\abspath.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\alias.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\alloc.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\archive-tar.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\archive-zip.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\archive.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\attr.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\base85.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\bisect.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\blob.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\branch.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\builtin-add.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\builtin-annotate.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\builtin-apply.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\builtin-archive.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\builtin-bisect--helper.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\builtin-blame.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\builtin-branch.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\builtin-bundle.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\builtin-cat-file.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\builtin-check-attr.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\builtin-check-ref-format.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\builtin-checkout-index.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\builtin-checkout.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\builtin-clean.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\builtin-clone.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\builtin-commit-tree.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\builtin-commit.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\builtin-config.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\builtin-count-objects.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\builtin-describe.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\builtin-diff-files.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\builtin-diff-index.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\builtin-diff-tree.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\builtin-diff.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\builtin-fast-export.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\builtin-fetch--tool.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\builtin-fetch-pack.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\builtin-fetch.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\builtin-fmt-merge-msg.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\builtin-for-each-ref.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\builtin-fsck.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\builtin-gc.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\builtin-grep.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\builtin-help.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\builtin-init-db.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\builtin-log.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\builtin-ls-files.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\builtin-ls-remote.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\builtin-ls-tree.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\builtin-mailinfo.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\builtin-mailsplit.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\builtin-merge-base.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\builtin-merge-file.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\builtin-merge-ours.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\builtin-merge-recursive.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\builtin-merge.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\builtin-mktree.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\builtin-mv.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\builtin-name-rev.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\builtin-pack-objects.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\builtin-pack-refs.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\builtin-prune-packed.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\builtin-prune.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\builtin-push.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\builtin-read-tree.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\builtin-receive-pack.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\builtin-reflog.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\builtin-remote.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\builtin-rerere.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\builtin-reset.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\builtin-rev-list.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\builtin-rev-parse.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\builtin-revert.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\builtin-rm.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\builtin-send-pack.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\builtin-shortlog.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\builtin-show-branch.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\builtin-show-ref.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\builtin-stripspace.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\builtin-symbolic-ref.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\builtin-tag.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\builtin-tar-tree.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\builtin-unpack-objects.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\builtin-update-index.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\builtin-update-ref.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\builtin-upload-archive.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\builtin-verify-pack.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\builtin-verify-tag.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\builtin-write-tree.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\bundle.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\cache-tree.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\color.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\combine-diff.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\commit.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\config.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\connect.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\convert.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\copy.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\csum-file.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ctype.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\date.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\decorate.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\diff-delta.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\diff-lib.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\diff-no-index.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\diff.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\diffcore-break.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\diffcore-delta.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\diffcore-order.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\diffcore-pickaxe.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\diffcore-rename.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\dir.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\editor.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\entry.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\environment.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\exec_cmd.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\fsck.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\graph.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\grep.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\hash.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\help.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ident.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\levenshtein.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\list-objects.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ll-merge.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\lockfile.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\log-tree.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\mailmap.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\match-trees.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\merge-file.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\merge-recursive.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\merge-tree.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\name-hash.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\object.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\pack-check.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\pack-refs.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\pack-revindex.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\pack-write.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\pager.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\parse-options.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\patch-delta.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\patch-ids.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\path.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\pkt-line.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\preload-index.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\pretty.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\progress.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\quote.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\reachable.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\read-cache.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\reflog-walk.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\refs.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\remote.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\rerere.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\revision.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\run-command.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\server-info.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\setup.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\sha1-lookup.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\sha1_file.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\sha1_name.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\shallow.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\sideband.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\sigchain.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\strbuf.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\string-list.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\symlinks.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\tag.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\thread-utils.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\trace.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\transport.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\tree-diff.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\tree-walk.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\tree.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\unpack-trees.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\usage.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\userdiff.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\utf8.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\walker.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\wrapper.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\write_or_die.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\ws.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\wt-status.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\xdiff-interface.c"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="xdiff"
+			>
+			<File
+				RelativePath="..\..\..\xdiff\xdiff.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\xdiff\xdiffi.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\xdiff\xdiffi.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\xdiff\xemit.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\xdiff\xemit.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\xdiff\xinclude.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\xdiff\xmacros.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\xdiff\xmerge.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\xdiff\xpatience.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\xdiff\xprepare.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\xdiff\xprepare.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\xdiff\xtypes.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\xdiff\xutils.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\xdiff\xutils.h"
+				>
+			</File>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
-- 
1.6.4.msysgit.0

^ permalink raw reply related

* [PATCH 11/11] Add gitignore and ReadMe file for MSVC Build
From: Frank Li @ 2009-08-17 16:09 UTC (permalink / raw)
  To: git, msysgit; +Cc: Johannes.Schindelin, Frank Li

Add ReadMe to user how to build git with MSVC.
Add gitignore to filter out files created file by MSVC.

Signed-off-by: Frank Li <lznuaa@gmail.com>
---
 compat/vcbuild/.gitignore |    3 +++
 compat/vcbuild/ReadMe     |   13 +++++++++++++
 2 files changed, 16 insertions(+), 0 deletions(-)
 create mode 100644 compat/vcbuild/.gitignore
 create mode 100644 compat/vcbuild/ReadMe

diff --git a/compat/vcbuild/.gitignore b/compat/vcbuild/.gitignore
new file mode 100644
index 0000000..7796990
--- /dev/null
+++ b/compat/vcbuild/.gitignore
@@ -0,0 +1,3 @@
+Debug
+Release
+*.user
\ No newline at end of file
diff --git a/compat/vcbuild/ReadMe b/compat/vcbuild/ReadMe
new file mode 100644
index 0000000..47c089e
--- /dev/null
+++ b/compat/vcbuild/ReadMe
@@ -0,0 +1,13 @@
+The Steps of Build Git with VS2008
+
+1. Create VC Build Environment.
+
+   git clone git://repo.or.cz/gitbuild.git
+
+   gitbuild include VS solution file and library such as zlib.
+ 
+2. Get Submodule
+  
+   git submodule update
+
+3. Open gitbuild\gitbuild.sln with VS2008. Then press F7.
\ No newline at end of file
-- 
1.6.4.msysgit.0

^ permalink raw reply related

* rev-list behavior in mail notification when pushing multiple branches
From: Tim Niemueller @ 2009-08-17 16:13 UTC (permalink / raw)
  To: git

Hi.

We are using git to manage a project which is separated in multiple
repositories. We use email notification for commits to the central
repositories, but the log output in these mails is not what we expect.
We use the contrib hook script from the git repository.

The main repository contains the trunk, in the real sense, meaning that
it is composed of infrastructure code shared among all repositories, not
in the svn sense. The other repositories contain the trunk master branch
as "trunk" branch. Their own master branch is based on trunk, but
extended by additional modules. We regularly merge from the main
repository into the other repositories trunk.

Consider the following situation:

--*---X-------Y     master branch
     /       /
A---B--C*---D       trunk branch

master has been ultimately derived from trunk. At X trunk changes up to
C have been merged into the master. Then trunk evolves but master
remains unchanged. We merge again everything up to D from trunk. Now
assume that we haven't pushed since B/X and now push after D/Y. Then
there are two mails to be generated, one for master X..Y, effectively
containing log message Y (merged...), and one for trunk B..D, C* is any
number of intermediate commits to the trunk.

It happens to be that master has been pushed first. The email contains
the expected output in the log section. However, for the trunk branch
the output unexpectedly is empty, meaning that information about C* is
never send in any mail.

The reason is the following: in show_new_revisions "rev-parse --not" is
used to generate "stop" points for rev-list. The stop point issued for
the master branch is Y. This causes rev-list to stop immediately, since
this is the last commit in the chronological order.

What we would like to have is the that the master mail only states
"merged trunk changes" (as it is right now, if there were commits
between X and Y these should be included as well), while the trunk mail
issues all C* commits and D.

I have tried to come up with a way to filter out entries from the mails
that have been issued on "the other" branch(es) originally (although
they are now /after/ merging also part of the this branch's history).
Since gitk can show this there should be a way to figure it out, but my
git-fu isn't strong enough, yet. Can someone give advice on how to
achieve this, or how you solved the problem, if you did?

Thanks,
	Tim

-- 
AllemaniACs RoboCup Team            KBSG - Knowledge-Based Systems Group
========================================================================
http://robocup.rwth-aachen.de                     RWTH Aachen University
http://www.kbsg.rwth-aachen.de                           Ahornstrasse 55
http://www.fawkesrobotics.org                             D-52056 Aachen

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox