* Re: [PATCH 04/14] Set _O_BINARY as default fmode for both MinGW and MSVC
From: Alexey Borzenkov @ 2009-09-15 19:01 UTC (permalink / raw)
To: Marius Storm-Olsen; +Cc: Johannes.Schindelin, msysgit, git, lznuaa, raa.lkml
In-Reply-To: <badc5d24387c28c752a45f75e8aec6bce64f81fe.1253021728.git.mstormo@gmail.com>
On Tue, Sep 15, 2009 at 5:44 PM, Marius Storm-Olsen <mstormo@gmail.com> wrote:
> +extern int _fmode;
And indeed. I just ported this patch to my custom msysgit branch
(based on v1.6.4.3) and it didn't compile:
CC git.o
cc1.exe: warnings being treated as errors
In file included from git-compat-util.h:116,
from builtin.h:4,
from git.c:1:
compat/mingw.h:243: error: '_fmode' redeclared without dllimport
attribute: previous dllimport ignored
git.c: In function 'main':
git.c:456: error: the address of '_iob' will always evaluate as 'true'
make: *** [git.o] Error 1
^ permalink raw reply
* Git crashes on pull
From: Guido Ostkamp @ 2009-09-15 18:47 UTC (permalink / raw)
To: git
Hi,
I have a clone of http://git.postgresql.org/git/postgresql.git where head
is at commit 167501570c74390dfb7a5dd71e260ab3d4fd9904.
I'm using Git version 1.6.5.rc1.10.g20f34 (should be at commit
20f34902d154f390ebaa7eed7f42ad14140b8acb from Mon Sep 14 10:49:01 2009
+0200)
Now when I 'git pull' then Git crashes with
git pull 2>&1 > /tmp/git-error
*** glibc detected *** git-remote-curl: free(): invalid pointer:
0xb7d19140 ***
======= Backtrace: =========
/lib/libc.so.6[0xb7c4f4b6]
/lib/libc.so.6(cfree+0x89)[0xb7c51179]
git-remote-curl[0x804d290]
git-remote-curl[0x804df04]
git-remote-curl[0x8065ea5]
git-remote-curl[0x804aac6]
/lib/libc.so.6(__libc_start_main+0xe0)[0xb7bfefe0]
git-remote-curl[0x804a991]
======= Memory map: ========
08048000-080a1000 r-xp 00000000 08:15 1658246
/usr/local/libexec/git-core/git-remote-curl
080a1000-080a2000 r--p 00058000 08:15 1658246
/usr/local/libexec/git-core/git-remote-curl
080a2000-080a3000 rw-p 00059000 08:15 1658246
/usr/local/libexec/git-core/git-remote-curl
080a3000-08143000 rw-p 080a3000 00:00 0 [heap]
b4400000-b4421000 rw-p b4400000 00:00 0
b4421000-b4500000 ---p b4421000 00:00 0
b45ea000-b45f4000 r-xp 00000000 08:13 1097821 /lib/libgcc_s.so.1
b45f4000-b45f6000 rw-p 00009000 08:13 1097821 /lib/libgcc_s.so.1
...
Any idea what's causing this?
Please keep me on CC, as I'm not subscribed on list.
Regards
Guido
^ permalink raw reply
* Re: [PATCH 04/14] Set _O_BINARY as default fmode for both MinGW and MSVC
From: Alexey Borzenkov @ 2009-09-15 18:40 UTC (permalink / raw)
To: Marius Storm-Olsen; +Cc: Johannes.Schindelin, msysgit, git, lznuaa, raa.lkml
In-Reply-To: <badc5d24387c28c752a45f75e8aec6bce64f81fe.1253021728.git.mstormo@gmail.com>
On Tue, Sep 15, 2009 at 5:44 PM, Marius Storm-Olsen <mstormo@gmail.com> wrote:
> +extern int _fmode;
Is it really needed? I might be wrong, but I thought _fmode needed a
more complex declaration, at least on mingw, for which you are
supposed to include stdlib.h. For example, for mingw, in stdlib.h, it
is declared this way:
#if !defined (__DECLSPEC_SUPPORTED) || defined (__IN_MINGW_RUNTIME)
#ifdef __MSVCRT__
extern int* _imp___fmode;
#define _fmode (*_imp___fmode)
#else
/* CRTDLL */
extern int* _imp___fmode_dll;
#define _fmode (*_imp___fmode_dll)
#endif
#else /* __DECLSPEC_SUPPORTED */
#ifdef __MSVCRT__
__MINGW_IMPORT int _fmode;
#else /* ! __MSVCRT__ */
__MINGW_IMPORT int _fmode_dll;
#define _fmode _fmode_dll
#endif /* ! __MSVCRT__ */
#endif /* __DECLSPEC_SUPPORTED */
As you can see it is a little more complex than a simple extern (e.g.
it uses __declspec(dllimport) when it is supported, and a bit of
manual dereferencing otherwise). So maybe you would just include
stdlib.h and use definition from there?
^ permalink raw reply
* Re: Pair Programming Workflow Suggestions
From: Jakub Narebski @ 2009-09-15 18:20 UTC (permalink / raw)
To: Tim Visher; +Cc: Git Mailing List
In-Reply-To: <c115fd3c0909151043v3216a147v35e18710fbead515@mail.gmail.com>
Tim Visher <tim.visher@gmail.com> writes:
> I'm interested in hearing how people use Git for pair programming.
> Specifically, how do you document that you are programming in pairs.
[...]
> I did find Brian Helmkamp's script
> http://www.brynary.com/2008/9/1/setting-the-git-commit-author-to-pair-programmers-names
> but that's not really what I'm looking for. [...]
I'm not sure if this would help you, but take a look at "Pair
Programming & git & github & Gravatar & You & You" blog post by Jon
"Lark" Larkowski from May 30, 2009:
http://blog.l4rk.com/2009/05/pair-programming-git-github-gravatar.html
--
Jakub Narebski
Poland
ShadeHawk on #git
^ permalink raw reply
* Re: Pair Programming Workflow Suggestions
From: Sean Estabrooks @ 2009-09-15 18:14 UTC (permalink / raw)
To: Tim Visher; +Cc: Git Mailing List
In-Reply-To: <c115fd3c0909151043v3216a147v35e18710fbead515@mail.gmail.com>
On Tue, 15 Sep 2009 13:43:17 -0400
Tim Visher <tim.visher@gmail.com> wrote:
[...]
> It would be nicer to
> have an arbitrary number of authors that can all exist separately, but
> I'm fairly certain that git does not support that.
Tim,
If you're just looking for a way to quickly switch the author information
quickly between individual commits. You could create a shell alias for
each of the programmers that does:
export GIT_AUTHOR_NAME="some name" GIT_AUTHOR_EMAIL="name@where.com"
This will override the global and per repo configured author information
for all subsequent commits.
HTH,
Sean
^ permalink raw reply
* Pair Programming Workflow Suggestions
From: Tim Visher @ 2009-09-15 17:43 UTC (permalink / raw)
To: Git Mailing List
Hello Everyone,
I'm interested in hearing how people use Git for pair programming.
Specifically, how do you document that you are programming in pairs.
Typically, of course, you have a driver and a navigator. It seems
natural to have a commit's author be the driver at the time, but that
doesn't seem to do justice to what pair programming is. Really, both
people are normally coding, but one person is doing the typing and
most of the thinking while the other is acting as an in place code
reviewer. There are even cases where there's a third person involved.
I did find [Brian Helmkamp's
script](http://www.brynary.com/2008/9/1/setting-the-git-commit-author-to-pair-programmers-names)
but that's not really what I'm looking for. For instance, that would
break the nice integration we have with Hudson at this point for
displaying when a developer was last active. It would be nicer to
have an arbitrary number of authors that can all exist separately, but
I'm fairly certain that git does not support that.
Thoughts?
--
In Christ,
Timmy V.
http://burningones.com/
http://five.sentenc.es/ - Spend less time on e-mail
^ permalink raw reply
* Re: [PATCH JGit 05/19] Made tests for listLocalPacks function on ObjectDirectory and made them pass
From: Robin Rosenberg @ 2009-09-15 16:13 UTC (permalink / raw)
To: mr.gaffo; +Cc: git, mike.gaffney
In-Reply-To: <1252867475-858-6-git-send-email-mr.gaffo@gmail.com>
söndag 13 september 2009 20:44:21 skrev mr.gaffo@gmail.com:
> From: mike.gaffney <mike.gaffney@asolutions.com>
>
> ---
> .../org/spearce/jgit/lib/ObjectDirectoryTest.java | 24 ++++++++++++++++++++
> .../jgit/lib/UpdateDirectoryInfoCacheTest.java | 11 +++++++++
> .../tst/org/spearce/jgit/util/JGitTestUtil.java | 21 ++++++++++++++++-
> .../src/org/spearce/jgit/lib/ObjectDirectory.java | 6 +++++
> .../spearce/jgit/lib/UpdateDirectoryInfoCache.java | 22 ++++++++++++++++++
> 5 files changed, 83 insertions(+), 1 deletions(-)
> create mode 100644 org.spearce.jgit.test/tst/org/spearce/jgit/lib/UpdateDirectoryInfoCacheTest.java
> create mode 100644 org.spearce.jgit/src/org/spearce/jgit/lib/UpdateDirectoryInfoCache.java
>
> diff --git a/org.spearce.jgit.test/tst/org/spearce/jgit/lib/ObjectDirectoryTest.java b/org.spearce.jgit.test/tst/org/spearce/jgit/lib/ObjectDirectoryTest.java
> index fe019af..8e4d8e5 100644
> --- a/org.spearce.jgit.test/tst/org/spearce/jgit/lib/ObjectDirectoryTest.java
> +++ b/org.spearce.jgit.test/tst/org/spearce/jgit/lib/ObjectDirectoryTest.java
> @@ -1,11 +1,17 @@
> package org.spearce.jgit.lib;
>
> import java.io.File;
> +import java.util.List;
> import java.util.UUID;
>
> +import org.spearce.jgit.util.JGitTestUtil;
> +
> import junit.framework.TestCase;
>
> public class ObjectDirectoryTest extends TestCase {
> + private static final String PACK_NAME = "pack-34be9032ac282b11fa9babdc2b2a93ca996c9c2f";
> + private static final File TEST_PACK = JGitTestUtil.getTestResourceFile(PACK_NAME + ".pack");
> + private static final File TEST_IDX = JGitTestUtil.getTestResourceFile(PACK_NAME + ".idx");
>
> private File testDir;
>
> @@ -58,6 +64,24 @@ public void testGettingObjectFile() throws Exception {
> od.fileFor(ObjectId.fromString("b052a1272310d8df34de72f60204dee7e28a43d0")));
> }
>
> + public void testListLocalPacksNotCreated() throws Exception {
> + assertEquals(0, new ObjectDirectory(testDir).listLocalPacks().size());
> + }
> +
> + public void testListLocalPacksWhenThereIsAPack() throws Exception {
> + createTestDir();
> + File packsDir = new File(testDir, "pack");
> + packsDir.mkdirs();
> +
> + JGitTestUtil.copyFile(TEST_PACK, new File(packsDir, TEST_PACK.getName()));
> + JGitTestUtil.copyFile(TEST_IDX, new File(packsDir, TEST_IDX.getName()));
> +
> + ObjectDirectory od = new ObjectDirectory(testDir);
> + List<PackFile> localPacks = od.listLocalPacks();
> + assertEquals(1, localPacks.size());
> + assertEquals(TEST_PACK.getName(), localPacks.get(0).getPackFile().getName());
> + }
> +
> public boolean deleteDir(File dir) {
> if (dir.isDirectory()) {
> String[] children = dir.list();
> diff --git a/org.spearce.jgit.test/tst/org/spearce/jgit/lib/UpdateDirectoryInfoCacheTest.java b/org.spearce.jgit.test/tst/org/spearce/jgit/lib/UpdateDirectoryInfoCacheTest.java
> new file mode 100644
> index 0000000..11d183e
> --- /dev/null
> +++ b/org.spearce.jgit.test/tst/org/spearce/jgit/lib/UpdateDirectoryInfoCacheTest.java
> @@ -0,0 +1,11 @@
> +package org.spearce.jgit.lib;
> +
> +import junit.framework.TestCase;
> +
> +public class UpdateDirectoryInfoCacheTest extends TestCase {
> +
> + public void testBase() throws Exception {
> + fail("nyi");
> + }
> +
> +}
> diff --git a/org.spearce.jgit.test/tst/org/spearce/jgit/util/JGitTestUtil.java b/org.spearce.jgit.test/tst/org/spearce/jgit/util/JGitTestUtil.java
> index eee0c14..04184d7 100644
> --- a/org.spearce.jgit.test/tst/org/spearce/jgit/util/JGitTestUtil.java
> +++ b/org.spearce.jgit.test/tst/org/spearce/jgit/util/JGitTestUtil.java
> @@ -38,6 +38,12 @@
> package org.spearce.jgit.util;
>
> import java.io.File;
> +import java.io.FileInputStream;
> +import java.io.FileNotFoundException;
> +import java.io.FileOutputStream;
> +import java.io.IOException;
> +import java.io.InputStream;
> +import java.io.OutputStream;
> import java.net.URISyntaxException;
> import java.net.URL;
>
> @@ -60,11 +66,24 @@ public static File getTestResourceFile(final String fileName) {
> }
> try {
> return new File(url.toURI());
> - } catch(URISyntaxException e) {
> + } catch (URISyntaxException e) {
> return new File(url.getPath());
> }
> }
>
> + public static void copyFile(final File fromFile, final File toFile) throws IOException {
> + InputStream in = new FileInputStream(fromFile);
> + OutputStream out = new FileOutputStream(toFile);
> +
> + byte[] buf = new byte[1024];
> + int len;
> + while ((len = in.read(buf)) > 0) {
> + out.write(buf, 0, len);
> + }
> + in.close();
> + out.close();
> + }
You need to check for short reads, i.e. read could retrieve
fewer bytes than requested, Less important, a larger buffer size could
perhaps be used too (like 8192 which is the default BufferedReader buffer size).
> private static ClassLoader cl() {
> return JGitTestUtil.class.getClassLoader();
> }
> diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/ObjectDirectory.java b/org.spearce.jgit/src/org/spearce/jgit/lib/ObjectDirectory.java
> index fe219c6..a90ae00 100644
> --- a/org.spearce.jgit/src/org/spearce/jgit/lib/ObjectDirectory.java
> +++ b/org.spearce.jgit/src/org/spearce/jgit/lib/ObjectDirectory.java
> @@ -511,6 +511,12 @@ boolean tryAgain(final long currLastModified) {
>
> @Override
> public List<PackFile> listLocalPacks() {
> + tryAgain1();
mmmm. probably good.
> + public void execute() {
> +// File objectFile = objectDatabase.
> +// String packsContents = new PacksFileContentsCreator(this.objectDatabase.listLocalPacks()).toString();
Out commented code is a no-no.
-- robin
^ permalink raw reply
* Re: [PATCH 1/2] Work around leftover temporary save file.
From: Pat Thoyts @ 2009-09-15 15:44 UTC (permalink / raw)
To: Alexey Borzenkov; +Cc: Alex Riesen, git, Paul Mackerras
In-Reply-To: <e2480c70909150714n3b7d6018rcb5bcb42d1d78218@mail.gmail.com>
Alexey Borzenkov <snaury@gmail.com> writes:
>
>Then deleting would fail, because on Windows opened files cannot be
>deleted (unless they are opened in a special way that permits it).
>
The delete occurs before we attempt to open the file which is why it
succeeds when such file is present.
--
Pat Thoyts http://www.patthoyts.tk/
PGP fingerprint 2C 6E 98 07 2C 59 C8 97 10 CE 11 E6 04 E0 B9 DD
^ permalink raw reply
* Re: [PATCH JGit 01/19] adding tests for ObjectDirectory
From: Robin Rosenberg @ 2009-09-15 15:38 UTC (permalink / raw)
To: mr.gaffo; +Cc: git, mike.gaffney
In-Reply-To: <1252867475-858-2-git-send-email-mr.gaffo@gmail.com>
söndag 13 september 2009 20:44:17 skrev mr.gaffo@gmail.com:
> From: mike.gaffney <mike.gaffney@asolutions.com>
>
> ---
> .../org/spearce/jgit/lib/ObjectDirectoryTest.java | 80 ++++++++++++++++++++
> 1 files changed, 80 insertions(+), 0 deletions(-)
> create mode 100644 org.spearce.jgit.test/tst/org/spearce/jgit/lib/ObjectDirectoryTest.java
>
> diff --git a/org.spearce.jgit.test/tst/org/spearce/jgit/lib/ObjectDirectoryTest.java b/org.spearce.jgit.test/tst/org/spearce/jgit/lib/ObjectDirectoryTest.java
> new file mode 100644
> index 0000000..fe019af
> --- /dev/null
> +++ b/org.spearce.jgit.test/tst/org/spearce/jgit/lib/ObjectDirectoryTest.java
> @@ -0,0 +1,80 @@
> +package org.spearce.jgit.lib;
> +
> +import java.io.File;
> +import java.util.UUID;
> +
> +import junit.framework.TestCase;
> +
> +public class ObjectDirectoryTest extends TestCase {
> +
> + private File testDir;
> +
> + @Override
> + protected void setUp() throws Exception {
> + testDir = new File(new File(System.getProperty("java.io.tmpdir")), UUID.randomUUID().toString());
> + }
Good. Now that we're on Java5 we might use this more.
> + public void testGettingObjectFile() throws Exception {
> + ObjectDirectory od = new ObjectDirectory(testDir);
> + assertEquals(new File(testDir, "02/829ae153935095e4223f30cfc98c835de71bee"),
> + od.fileFor(ObjectId.fromString("02829ae153935095e4223f30cfc98c835de71bee")));
> + assertEquals(new File(testDir, "b0/52a1272310d8df34de72f60204dee7e28a43d0"),
> + od.fileFor(ObjectId.fromString("b052a1272310d8df34de72f60204dee7e28a43d0")));
> + }
> +
> + public boolean deleteDir(File dir) {
RepositoryTestcase already contains a recursive delete, including a static one
that you can use even without inheritance since you are within the same package. It is rather
standalone so it could perhaps move to JGitTestUtil.
> + if (dir.isDirectory()) {
> + String[] children = dir.list();
> + for (int i=0; i<children.length; i++) {
> + boolean success = deleteDir(new File(dir, children[i]));
> + if (!success) {
> + return false;
> + }
> + }
> + }
> +
> + // The directory is now empty so delete it
> + return dir.delete();
> + }
> +
> + private void createTestDir(){
> + testDir.mkdir();
No error checking. If mkdirfails the test probably fails for mysterious reasons,
> + }
> +
> +}
^ permalink raw reply
* Re: [PATCH JGit 04/19] added utility that generates the contents of the objects/info/packs file as a string from a list of PackFiles
From: Robin Rosenberg @ 2009-09-15 15:35 UTC (permalink / raw)
To: mr.gaffo; +Cc: git, mike.gaffney
In-Reply-To: <1252867475-858-5-git-send-email-mr.gaffo@gmail.com>
> diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/PacksFileContentsCreator.java b/org.spearce.jgit/src/org/spearce/jgit/lib/PacksFileContentsCreator.java
> new file mode 100644
> index 0000000..3dd0418
> --- /dev/null
> +++ b/org.spearce.jgit/src/org/spearce/jgit/lib/PacksFileContentsCreator.java
> @@ -0,0 +1,21 @@
> +package org.spearce.jgit.lib;
> +
> +import java.util.List;
> +
> +public class PacksFileContentsCreator {
> +
> + private List<PackFile> packs;
> +
> + public PacksFileContentsCreator(List<PackFile> packs) {
We want good javadocs for (at least) all public and protected methods and
classes. (We enforce this for Eclipse users). If we had similar configuration files
for, perhaps netbeans we might have those too. (not finished thinking about that
proposition...)
> + this.packs = packs;
> + }
> +
> + public String toString(){
Don't overload toString. Let it be useful for debug like purposes. With this style we cannot
make it useful since the application depends on its exact behaviour. You may define
a toString anyway that does the exact same thing, but please provide a specific method for
assisting with the formatting of the file. A writeTo(OutputStream) is a useful interface in general.
> + StringBuilder builder = new StringBuilder();
> + for (PackFile packFile : packs) {
> + builder.append("P ").append(packFile.getPackFile().getName()).append('\r');
At least my git formats the file with \n as line terminator, so I think JGit should too..
Git ends the file with an extra \n, though I'm not sure it's relevant.
> + }
> + return builder.toString();
> + }
The name is somewhat confusing as the s is hard to spot. The suggestion InfoPacksFileGenerator
perhaps. It's a bit uglier by easier not to mix with generation of pack files.
-- robin
^ permalink raw reply
* Per-remote tracking branch
From: Matthieu Moy @ 2009-09-15 15:29 UTC (permalink / raw)
To: git
Hi,
Is there a way, with Git, to specify a tracking branch on a per-remote
basis?
At the moment, I can configure a tracking branch to let me just type
$ git pull
when I want to say
$ git pull origin master
Now, assume I have another remote "foo", I'd like to be able to just
say
$ git pull foo
and put something in my .git/config so that Git knows I mean
$ git pull foo master
Is there a simple way to do that?
(for the motivation: I mostly use Git with a 1-branch-per-repo setup,
so in 99% of my use-cases, when I have to specify a branch, it's
master).
Thanks,
--
Matthieu Moy
http://www-verimag.imag.fr/~moy/
^ permalink raw reply
* git stash list shows timestamp in stead of "stash number", when setting date = local for log in config
From: Alf Kristian Støyle @ 2009-09-15 14:56 UTC (permalink / raw)
To: git
Hi. Searched the lists, but haven't found anyone reporting this problem.
When doing a "git stash list" I get this strange stash record:
stash@{Tue Sep 15 16:28:12 2009}: WIP on master: 2262276 ...
I have a global config setting on log:
[log]
date = local
If setting the date config to default or removing the setting, the
stash record looks correct:
stash@{0}: WIP on master: 2262276 ...
I might be missing something here, but I do find this a bit strange.
Is this a bug or a feature, and is there a setting I can use (for
stash) to always show the latter line? I kind of like having local
timestamps in log.
I am using git version 1.6.4.2 on the Mac.
Thanks
- Alf
^ permalink raw reply
* Re: [PATCH 1/2] Work around leftover temporary save file.
From: Pat Thoyts @ 2009-09-15 14:47 UTC (permalink / raw)
To: Alex Riesen; +Cc: git, Alexy Borzenkov, Paul Mackerras
In-Reply-To: <81b0412b0909150601j74d40181pc2308f4f63b4817e@mail.gmail.com>
Alex Riesen <raa.lkml@gmail.com> writes:
>On Tue, Sep 15, 2009 at 11:26, Pat Thoyts
><patthoyts@users.sourceforge.net> wrote:
>>
>> If a file exists and is hidden on Windows the Tcl open command will
>> fail as the attributes provided in the CREAT call fail to match those
>> of the existing file. Forcing removal of the temporary file before we
>> begin solves any problems caused by previous failures to save the
>> application settings. An alternative would be to remove the hidden
>> attribute before calling 'open'.
>>
>> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
>> ---
>> gitk | 1 +
>> 1 files changed, 1 insertions(+), 0 deletions(-)
>>
>> diff --git a/gitk b/gitk
>> index 1306178..a0214b7 100755
>> --- a/gitk
>> +++ b/gitk
>> @@ -2526,6 +2526,7 @@ proc savestuff {w} {
>> if {$stuffsaved} return
>> if {![winfo viewable .]} return
>> catch {
>> + if {[file exists ~/.gitk-new]} {file delete -force ~/.gitk-new}
>
>maybe another gitk instance is writing it at exactly same moment
>in time? Writing is known to take a few moments. Especially on Windows.
no - 'open $file w' is translated into O_WRONLY|O_CREAT|O_TRUNC
internally and passed to the win32 layer to get converted to a call to CreateFile with
GENERIC_WRITE, CREATE_ALWAYS and FILE_ATTRIBUTE_NORMAL. The file has
got FILE_ATTRIBUTE_HIDDEN though and as it exists and our attributes
do not match we get failed.
'open $file {O_WRONLY O_TRUNC}' would open it but we'd have to check
for non-existence and redo with O_CREAT if it was not already present.
See tclWinChan.c:TclpOpenFileChannel.
--
Pat Thoyts http://www.patthoyts.tk/
PGP fingerprint 2C 6E 98 07 2C 59 C8 97 10 CE 11 E6 04 E0 B9 DD
^ permalink raw reply
* Re: [PATCH 1/2] Work around leftover temporary save file.
From: Alexey Borzenkov @ 2009-09-15 14:14 UTC (permalink / raw)
To: Alex Riesen; +Cc: Pat Thoyts, git, Paul Mackerras
In-Reply-To: <81b0412b0909150601j74d40181pc2308f4f63b4817e@mail.gmail.com>
On Tue, Sep 15, 2009 at 5:01 PM, Alex Riesen <raa.lkml@gmail.com> wrote:
> On Tue, Sep 15, 2009 at 11:26, Pat Thoyts
> <patthoyts@users.sourceforge.net> wrote:
>>
>> If a file exists and is hidden on Windows the Tcl open command will
>> fail as the attributes provided in the CREAT call fail to match those
>> of the existing file. Forcing removal of the temporary file before we
>> begin solves any problems caused by previous failures to save the
>> application settings. An alternative would be to remove the hidden
>> attribute before calling 'open'.
>>
>> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
>> ---
>> gitk | 1 +
>> 1 files changed, 1 insertions(+), 0 deletions(-)
>>
>> diff --git a/gitk b/gitk
>> index 1306178..a0214b7 100755
>> --- a/gitk
>> +++ b/gitk
>> @@ -2526,6 +2526,7 @@ proc savestuff {w} {
>> if {$stuffsaved} return
>> if {![winfo viewable .]} return
>> catch {
>> + if {[file exists ~/.gitk-new]} {file delete -force ~/.gitk-new}
>
> maybe another gitk instance is writing it at exactly same moment
> in time? Writing is known to take a few moments. Especially on Windows.
Then deleting would fail, because on Windows opened files cannot be
deleted (unless they are opened in a special way that permits it).
^ permalink raw reply
* Re: Commited to wrong branch
From: Howard Miller @ 2009-09-15 14:11 UTC (permalink / raw)
To: Martin Langhoff; +Cc: Björn Steinbrink, git
In-Reply-To: <46a038f90909150654t73cab47ckfd02f8a2f4353722@mail.gmail.com>
2009/9/15 Martin Langhoff <martin.langhoff@gmail.com>:
> 2009/9/15 Björn Steinbrink <B.Steinbrink@gmx.de>:
>> [Please stop top-posting...]
>
> Not everyone is deep in mailing-list lore :-) -- we can help anyway.
>
> Howard, I see you're wondering about it: http://www.idallen.com/topposting.html
>
>> Just don't use patch(1), there's no sane reason to do that, you're
>> sacrificing all of what git can offer there.
>
> Oh, yes there is, specially for newcomers used to patch, and how it
> handles conflicts.
>
> In this case, I happen to know that Howard is a refugee from CVS land
> (the moodle project in this case), and he is familiar with the output
> of patch if things go wrong.
>
> It's not what I'd recommend to someone that is deep in git-land. But
> even myself (with a bit of code in git) sometimes use patch when
> git-apply tries to be too clever and I just want a damn .rej file to
> review and edit with emacs.
>
> cheers,
>
>
> m
> --
> martin.langhoff@gmail.com
> martin@laptop.org -- School Server Architect
> - ask interesting questions
> - don't get distracted with shiny stuff - working code first
> - http://wiki.laptop.org/go/User:Martinlanghoff
>
...and I still don't understand cvs either :-)
(NB. I have put my reply at the bottom where nobody will see it - this
is why forums are better than mailing lists.... >ducks<)
^ permalink raw reply
* Re: [PATCH 2/2] Fix the geometry when restoring from zoomed state.
From: Alexey Borzenkov @ 2009-09-15 14:11 UTC (permalink / raw)
To: Pat Thoyts; +Cc: git, Paul Mackerras
In-Reply-To: <8763bkcsxb.fsf@users.sourceforge.net>
On Tue, Sep 15, 2009 at 1:37 PM, Pat Thoyts
<patthoyts@users.sourceforge.net> wrote:
> The patch to handle the geometry of a restored gitk by Alexy Borzenkov
> causes the position of the columns to creep each time the application
> is restarted. This patch addresses this by remembering the application
> geometry for the normal state and saving that regardless of the actual
> state when the application is closed.
I can confirm it works even when the difference between normal and
maximized window are big.
^ permalink raw reply
* Re: Commited to wrong branch
From: Johannes Sixt @ 2009-09-15 14:08 UTC (permalink / raw)
To: Howard Miller; +Cc: Martin Langhoff, git
In-Reply-To: <26ae428a0909150645s59e1fb40hbb19e672230077eb@mail.gmail.com>
Howard Miller schrieb:
> (PS. I now even know what 'top-posting' is - but not why it's bad.)
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?
^ permalink raw reply
* Re: [PATCH] gitk: restore wm state to normal before saving geometry information
From: Alexey Borzenkov @ 2009-09-15 13:58 UTC (permalink / raw)
To: Pat Thoyts; +Cc: git
In-Reply-To: <e2480c70909150554p2e211d60y18049b5534f8922e@mail.gmail.com>
On Tue, Sep 15, 2009 at 4:54 PM, Alexey Borzenkov <snaury@gmail.com> wrote:
> On the other hand, when I resize columns and then maximize/restore the
> window repeatedly I see that their sizes change in a strange way (and
> the smaller restored window they stranger are results) until hitting
> some sort of equilibrium, then maximize/restore doesn't have effect on
> their sizes anymore. So maybe there's a bug not in a way my patch
> restores the window, but in a way window resizes are handled.
It seems that I found what's the problem. When the window is very
small, and we maximize it, sash coords would initially be small. Then
we calculate their new positions and set it with $win sash place, but
unfortunately, tk limits them to the OLD pane size for some reason.
Initially I though that maybe Configure is fired too early (before
window is resized), but [winfo width $win] shows $win has the new
size. Here's some output that I got during debugging:
resizing 422 -> 1261 (winfo shows 1261)
s0: 138 1
s1: 288 1
sash0: 412 -> 412 1
sash1: 860 -> 417 1
I'm at a loss why this happens and how to lift this restriction.
^ permalink raw reply
* Re: Commited to wrong branch
From: Martin Langhoff @ 2009-09-15 13:54 UTC (permalink / raw)
To: Björn Steinbrink; +Cc: Howard Miller, git
In-Reply-To: <20090915130640.GC31846@atjola.homenet>
2009/9/15 Björn Steinbrink <B.Steinbrink@gmx.de>:
> [Please stop top-posting...]
Not everyone is deep in mailing-list lore :-) -- we can help anyway.
Howard, I see you're wondering about it: http://www.idallen.com/topposting.html
> Just don't use patch(1), there's no sane reason to do that, you're
> sacrificing all of what git can offer there.
Oh, yes there is, specially for newcomers used to patch, and how it
handles conflicts.
In this case, I happen to know that Howard is a refugee from CVS land
(the moodle project in this case), and he is familiar with the output
of patch if things go wrong.
It's not what I'd recommend to someone that is deep in git-land. But
even myself (with a bit of code in git) sometimes use patch when
git-apply tries to be too clever and I just want a damn .rej file to
review and edit with emacs.
cheers,
m
--
martin.langhoff@gmail.com
martin@laptop.org -- School Server Architect
- ask interesting questions
- don't get distracted with shiny stuff - working code first
- http://wiki.laptop.org/go/User:Martinlanghoff
^ permalink raw reply
* Re: Commited to wrong branch
From: Martin Langhoff @ 2009-09-15 13:46 UTC (permalink / raw)
To: Howard Miller; +Cc: git
In-Reply-To: <26ae428a0909150627n4e5935bcxdcdf0fdd33a44aa8@mail.gmail.com>
On Tue, Sep 15, 2009 at 3:27 PM, Howard Miller
<howard@e-learndesign.co.uk> wrote:
> What's to stop me.........
>
> * The "wrong" branch just tracks a remote so I can just dump it once I
> have this fixed - (delete it and recreate it?)
Absolutely perfect plan. In fact, there's a way to "sync" your local
branch to the remote one:
git checkout X
git reset origin/X
(assuming that the remote branch is 'origin/X')
> * after my 'reset' the files I have in my working copy (still the
> wrong branch) should be the latest version ('git reset' does not
> change the working copy I think?)
correct (git reset --hard OTOH will discard your changes)
> * So can I grab these files (they are mostly new), checkout the
> correct version, and just overwrite the existing files? I'll loose
> some history but not much and I don't care
Oh... well if there were other changes to the same files in the other
branch you could be carrying "other" changes. git diff to make sure
you're committing what you want.
> Seems too easy :-)
It is :-)
m
--
martin.langhoff@gmail.com
martin@laptop.org -- School Server Architect
- ask interesting questions
- don't get distracted with shiny stuff - working code first
- http://wiki.laptop.org/go/User:Martinlanghoff
^ permalink raw reply
* Re: Commited to wrong branch
From: Howard Miller @ 2009-09-15 13:45 UTC (permalink / raw)
To: Martin Langhoff; +Cc: git
In-Reply-To: <26ae428a0909150627n4e5935bcxdcdf0fdd33a44aa8@mail.gmail.com>
Martin et al.
Thanks for your help and sorry for ranting (also to Daniele Segato who
replied off-list).... these things always happen when you have the
least amount of time to deal with them!!
Problem solved.... well bodged actually (just copied files which were
all in one directory over to the correct branch).... but it will do. I
shall be MUCH more careful in future :-)
Howard
(PS. I now even know what 'top-posting' is - but not why it's bad.)
2009/9/15 Howard Miller <howard@e-learndesign.co.uk>:
> What's to stop me.........
>
> * The "wrong" branch just tracks a remote so I can just dump it once I
> have this fixed - (delete it and recreate it?)
> * after my 'reset' the files I have in my working copy (still the
> wrong branch) should be the latest version ('git reset' does not
> change the working copy I think?)
> * So can I grab these files (they are mostly new), checkout the
> correct version, and just overwrite the existing files? I'll loose
> some history but not much and I don't care
>
> Seems too easy :-)
>
> 2009/9/15 Howard Miller <howard@e-learndesign.co.uk>:
>> Martin,
>>
>> Got as far as applying the temporary patch and I now get a load of...
>>
>> Reversed (or previously applied) patch detected! Assume -R? [n]
>> Apply anyway? [n]
>> Skipping patch.
>> 1 out of 1 hunk ignored -- saving rejects to file
>> theme/onepointnine/local.css.rej
>> The next patch would create the file theme/onepointnine/local.css,
>>
>> funnily I didn't think that file had anything to do with it, but when
>> I changed branched I got
>>
>> T theme/onepointnine/local.css
>>
>> Not sure what the T means :-(
>>
>> H.
>>
>> 2009/9/15 Martin Langhoff <martin.langhoff@gmail.com>:
>>> On Tue, Sep 15, 2009 at 2:10 PM, Howard Miller
>>> <howard@e-learndesign.co.uk> wrote:
>>>> Martin,
>>>>
>>>> Looked at gitk - yes there is definitely one more commit still on the
>>>> current (wrong) branch.
>>>>
>>>> I deleted the offending file and have now successfully switched to the
>>>> other (correct) branch.
>>>
>>> ok!
>>>
>>> so you have
>>>
>>> A - The commit you undid, and have in the temp patch. Note that this
>>> patch file is missing the file you've rm'd.
>>>
>>> B - A commit you haven't "undone" on the "wrong" branch X.
>>>
>>> and you are on branch Y
>>>
>>> so now...
>>>
>>> 1 - git format-patch Y^..Y # will export that patch B into a file for you.
>>> 2 - git am 0001-whatever-the-name-of-the-file.txt # patch B
>>> this may need conflict resolution - read the notes it prints! If
>>> it refuses to apply the patch, do "git am --skip" to indicate you
>>> won't use git-am no more for this, and try applying it with the patch
>>> utility.
>>> 3 - patch -p1 < your-patch-A.patch
>>> 4 - find and readd the file you rm'd earlier -- if you don't have
>>> another copy, we can get it from git reflog but that'll take extra
>>> steps :-)
>>> 5 - git commit # you're committing your patch A here
>>>
>>> Now, review with gitk to see that you have what you want to have
>>> there. If it's all ok...
>>>
>>> 6 - git checkout X
>>> 7 - git reset --hard # unstich that last stray commit
>>> --
>>>
>>> hope the above helps. Git pros will see that the process could be much
>>> shorter :-) I chose this specific path because in exporting your
>>> patches and applying them again you can see each step.
>>>
>>> If we were to start again, and the branches are reasonably close to
>>> eachother (not 19_STABLE vs cvshead :-) ) then you can say
>>>
>>> - X has 2 bad commits that belong to Y, then
>>> 1 - gitk X & # open gitk to visualise the commits, send it to the background
>>> 2 - git checkout Y
>>> 3 - git cherry-pick X^ # takes the next-to-last commit from X and
>>> tries to apply it here - conflict resolution may be needed
>>> 4 - git cherry-pick X # same with the very last commit on X
>>> 5 - gitk # check that is all as you want it
>>> 6 - git checkout X
>>> 7 - git reset --hard X^^ # "rewind 2 commits"
>>>
>>> hth,
>>>
>>>
>>>
>>> m
>>> --
>>> martin.langhoff@gmail.com
>>> martin@laptop.org -- School Server Architect
>>> - ask interesting questions
>>> - don't get distracted with shiny stuff - working code first
>>> - http://wiki.laptop.org/go/User:Martinlanghoff
>>> --
>>> To unsubscribe from this list: send the line "unsubscribe git" in
>>> the body of a message to majordomo@vger.kernel.org
>>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>>>
>>
>
^ permalink raw reply
* R: Commited to wrong branch
From: Daniele Segato @ 2009-09-15 13:45 UTC (permalink / raw)
To: Git Mailing List
I replied to Howard directly without CCing the Git ML (as a mistake)
anyway he solved the problem on his own now.
this was my first reply that didn't reached the list
On Tue, Sep 15, 2009 at 12:31 PM, Howard Miller
<howard@e-learndesign.co.uk> wrote:
> I had made some changes to some files and then done a commit. Only
> then did I realise that I had the wrong branch checked out. To make
> matters worse I then did a 'git reset HEAD^' which means that I can
> now no longer switch branches. I am stuck. I had some advice (thanks!)
> but it was not complete. I'd appreciate some more help.
I think that explaining what you did and what happened along your
modification will help you to understand.
It's not that hard, really :)
so this are the steps you followed (confirmed by your reply to Martin)
1 - you were on branch X, thinking your were on branch Y
Branch X point to a commit which is the last commit of branch X:
you can visualize the situation like this
BRANCH Y
|
c1 - c2 - c3 - c5
\
c4 - c6
|
BRANCH X (and your current HEAD)
the cN stuffs are commits
BranchX, BranchY and HEAD are only pointers to a commit
2 - you worked on on branch X
modified some files/added new one/whatever
now you may have some untracked files (new files)
and some untracked modification (modified files)
untracked means that those files/modification aren't in the git
repository, they are not indexed
3 - git add .
You ask git to index the modification to prepare a commit: we say that
files are "staged"
At this time HEAD and BRANCH X are still on c6 commit (see graphic above)
4 - git commit
Ok what happen here?
BRANCH Y
|
c1 - c2 - c3 - c5
\
c4 - c6 - c7
|
BRANCH X (and your current HEAD)
you created a new commit and moved the 2 pointers.
6 - you realized the mistake
now what you want here is to make your Branch X point again the c6
commit and, probably,
save your modification for c7
but you actually panicked :)
and you did:
5 - git reset HEAD^
Let's see what happen to the index:
BRANCH Y
|
c1 - c2 - c3 - c5
\
c4 - c6 -c7
|
BRANCH X (and your current HEAD)
seems right uh?
no you have a lot of untracked files in your directory
that's because git reset doesn't change your directory content
it only work on indexes.
So what you now have in your project directory is what you did on the
top of your initial Branch X
try a
gitk --all
it should show you that
Now you have 2 options:
1) discard what you did for the wrong commit c7 (and restart again on branch Y)
2) try to backup your work and migrate it to branch Y
the 1) is the easiest one: just execute
git reset HEAD --hard
the option --hard ask git to give you a "clean" reset modifying your
working directory to be exactly
like the indexed c6 commit.
then checkout branch Y:
git checkout Y
and restart to work on that branch
if you want to recover what you did to avoid re-doing it then the
things became a little harder but not
that much :)
there are many way to do it because git gave you a lot of tools
we can help if you calm down :)
for now: question about this?
regards,
Daniele
^ permalink raw reply
* [PATCH 11/14] Define strncasecmp and ftruncate for MSVC
From: Marius Storm-Olsen @ 2009-09-15 13:44 UTC (permalink / raw)
To: Johannes.Schindelin
Cc: msysgit, git, lznuaa, raa.lkml, snaury, Marius Storm-Olsen
In-Reply-To: <cover.1253021728.git.mstormo@gmail.com>
Signed-off-by: Marius Storm-Olsen <mstormo@gmail.com>
---
compat/msvc.h | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/compat/msvc.h b/compat/msvc.h
index 53a6d30..9c753a5 100644
--- a/compat/msvc.h
+++ b/compat/msvc.h
@@ -10,6 +10,8 @@
#define __inline__ __inline
#define __attribute__(x)
#define va_copy(dst, src) ((dst) = (src))
+#define strncasecmp _strnicmp
+#define ftruncate _chsize
static __inline int strcasecmp (const char *s1, const char *s2)
{
--
1.6.2.1.418.g33d56.dirty
^ permalink raw reply related
* [PATCH 10/14] Make usage of windows.h lean and mean
From: Marius Storm-Olsen @ 2009-09-15 13:44 UTC (permalink / raw)
To: Johannes.Schindelin
Cc: msysgit, git, lznuaa, raa.lkml, snaury, Marius Storm-Olsen
In-Reply-To: <cover.1253021728.git.mstormo@gmail.com>
Centralize the include of windows.h in git-compat-util.h, turn on
WIN32_LEAN_AND_MEAN to avoid including plenty of other header files
which is not needed in Git. Also ensure we load winsock2.h first,
so we don't load the older winsock definitions at a later stage,
since they contain duplicate definitions.
When moving windows.h into git-compat-util.h, we need to protect
the definition of struct pollfd in mingw.h, since this file is used
by both MinGW and MSVC, and the latter defines this struct in
winsock2.h.
We need to keep the windows.h include in compat/win32.h, since its
shared by both MinGW and Cygwin, and we're not touching Cygwin in
this commit. The include in git-compat-util.h is protected with an
ifdef WIN32, which is not the case when compiling for Cygwin.
Signed-off-by: Marius Storm-Olsen <mstormo@gmail.com>
---
compat/mingw.c | 2 ++
compat/mingw.h | 2 ++
compat/msvc.h | 7 -------
compat/win32.h | 2 ++
compat/winansi.c | 1 -
git-compat-util.h | 6 ++++++
thread-utils.c | 5 +----
7 files changed, 13 insertions(+), 12 deletions(-)
diff --git a/compat/mingw.c b/compat/mingw.c
index 34ee427..6b5b5b2 100644
--- a/compat/mingw.c
+++ b/compat/mingw.c
@@ -3,6 +3,8 @@
#include <conio.h>
#include "../strbuf.h"
+#include <shellapi.h>
+
static int err_win_to_posix(DWORD winerr)
{
int error = ENOSYS;
diff --git a/compat/mingw.h b/compat/mingw.h
index 384b667..544b576 100644
--- a/compat/mingw.h
+++ b/compat/mingw.h
@@ -41,6 +41,7 @@ struct passwd {
extern char *getpass(const char *prompt);
+#ifndef POLLIN
struct pollfd {
int fd; /* file descriptor */
short events; /* requested events */
@@ -48,6 +49,7 @@ struct pollfd {
};
#define POLLIN 1
#define POLLHUP 2
+#endif
typedef void (__cdecl *sig_handler_t)(int);
struct sigaction {
diff --git a/compat/msvc.h b/compat/msvc.h
index 6daf313..53a6d30 100644
--- a/compat/msvc.h
+++ b/compat/msvc.h
@@ -1,13 +1,6 @@
#ifndef __MSVC__HEAD
#define __MSVC__HEAD
-/* Define minimize windows version */
-#define WINVER 0x0500
-#define _WIN32_WINNT 0x0500
-#define _WIN32_WINDOWS 0x0410
-#define _WIN32_IE 0x0700
-#define NTDDI_VERSION NTDDI_WIN2KSP1
-#include <winsock2.h>
#include <direct.h>
#include <process.h>
#include <malloc.h>
diff --git a/compat/win32.h b/compat/win32.h
index e8c178d..8ce9104 100644
--- a/compat/win32.h
+++ b/compat/win32.h
@@ -2,7 +2,9 @@
#define WIN32_H
/* common Win32 functions for MinGW and Cygwin */
+#ifndef WIN32 /* Not defined by Cygwin */
#include <windows.h>
+#endif
static inline int file_attr_to_st_mode (DWORD attr)
{
diff --git a/compat/winansi.c b/compat/winansi.c
index 9217c24..dedce21 100644
--- a/compat/winansi.c
+++ b/compat/winansi.c
@@ -2,7 +2,6 @@
* Copyright 2008 Peter Harris <git@peter.is-a-geek.org>
*/
-#include <windows.h>
#include "../git-compat-util.h"
/*
diff --git a/git-compat-util.h b/git-compat-util.h
index 8ea444f..8d6e29c 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -65,6 +65,12 @@
#define _NETBSD_SOURCE 1
#define _SGI_SOURCE 1
+#ifdef WIN32 /* Both MinGW and MSVC */
+#define WIN32_LEAN_AND_MEAN /* stops windows.h including winsock.h */
+#include <winsock2.h>
+#include <windows.h>
+#endif
+
#include <unistd.h>
#include <stdio.h>
#include <sys/stat.h>
diff --git a/thread-utils.c b/thread-utils.c
index 55e7e29..4f9c829 100644
--- a/thread-utils.c
+++ b/thread-utils.c
@@ -1,9 +1,6 @@
#include "cache.h"
-#ifdef _WIN32
-# define WIN32_LEAN_AND_MEAN
-# include <windows.h>
-#elif defined(hpux) || defined(__hpux) || defined(_hpux)
+#if defined(hpux) || defined(__hpux) || defined(_hpux)
# include <sys/pstat.h>
#endif
--
1.6.2.1.418.g33d56.dirty
^ permalink raw reply related
* [PATCH 12/14] Add MSVC to Makefile
From: Marius Storm-Olsen @ 2009-09-15 13:44 UTC (permalink / raw)
To: Johannes.Schindelin
Cc: msysgit, git, lznuaa, raa.lkml, snaury, Marius Storm-Olsen
In-Reply-To: <cover.1253021728.git.mstormo@gmail.com>
Enable MSVC builds with GNU Make by simply calling
make MSVC=1
(Debug build possible by adding DEBUG=1 as well)
Two scripts, clink.pl and lib.pl, are used to convert certain GCC
specific command line options into something MSVC understands.
By building for MSVC with GNU Make, we can ensure that the MSVC
port always follows the latest code, and does not lag behind due
to unmaintained NMake Makefile or IDE projects.
Signed-off-by: Marius Storm-Olsen <mstormo@gmail.com>
---
Makefile | 54 ++++++++++++++++++++++++++++++++++++++-
compat/vcbuild/scripts/clink.pl | 48 ++++++++++++++++++++++++++++++++++
compat/vcbuild/scripts/lib.pl | 26 ++++++++++++++++++
3 files changed, 127 insertions(+), 1 deletions(-)
create mode 100644 compat/vcbuild/scripts/clink.pl
create mode 100644 compat/vcbuild/scripts/lib.pl
diff --git a/Makefile b/Makefile
index bde2acd..761cef1 100644
--- a/Makefile
+++ b/Makefile
@@ -877,6 +877,57 @@ ifneq (,$(findstring CYGWIN,$(uname_S)))
COMPAT_OBJS += compat/cygwin.o
UNRELIABLE_FSTAT = UnfortunatelyYes
endif
+ifdef MSVC
+ pathsep = ;
+ NO_PREAD = YesPlease
+ NO_OPENSSL = YesPlease
+ NO_LIBGEN_H = YesPlease
+ NO_SYMLINK_HEAD = YesPlease
+ NO_IPV6 = YesPlease
+ NO_SETENV = YesPlease
+ NO_UNSETENV = YesPlease
+ NO_STRCASESTR = YesPlease
+ NO_STRLCPY = YesPlease
+ NO_MEMMEM = YesPlease
+ # NEEDS_LIBICONV = YesPlease
+ NO_ICONV = YesPlease
+ NO_C99_FORMAT = YesPlease
+ NO_STRTOUMAX = YesPlease
+ NO_STRTOULL = YesPlease
+ NO_MKDTEMP = YesPlease
+ NO_MKSTEMPS = YesPlease
+ SNPRINTF_RETURNS_BOGUS = YesPlease
+ NO_SVN_TESTS = YesPlease
+ NO_PERL_MAKEMAKER = YesPlease
+ RUNTIME_PREFIX = YesPlease
+ NO_POSIX_ONLY_PROGRAMS = YesPlease
+ NO_ST_BLOCKS_IN_STRUCT_STAT = YesPlease
+ NO_NSEC = YesPlease
+ USE_WIN32_MMAP = YesPlease
+ # USE_NED_ALLOCATOR = YesPlease
+ UNRELIABLE_FSTAT = UnfortunatelyYes
+ OBJECT_CREATION_USES_RENAMES = UnfortunatelyNeedsTo
+ NO_REGEX = YesPlease
+ NO_CURL = YesPlease
+ NO_PTHREADS = YesPlease
+
+ CC = compat/vcbuild/scripts/clink.pl
+ AR = compat/vcbuild/scripts/lib.pl
+ CFLAGS =
+ BASIC_CFLAGS = -nologo -I. -I../zlib -Icompat/vcbuild -Icompat/vcbuild/include -DWIN32-D_CONSOLE -DHAVE_STRING_H -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE
+ COMPAT_OBJS = compat/msvc.o compat/fnmatch/fnmatch.o compat/winansi.o
+ COMPAT_CFLAGS = -D__USE_MINGW_ACCESS -DNOGDI -DHAVE_STRING_H -DHAVE_ALLOCA_H -Icompat -Icompat/fnmatch -Icompat/regex -Icompat/fnmatch -DSTRIP_EXTENSION=\".exe\"
+ BASIC_LDFLAGS = -IGNORE:4217 -IGNORE:4049 -NOLOGO -SUBSYSTEM:CONSOLE -NODEFAULTLIB:MSVCRT.lib
+ EXTLIBS = advapi32.lib shell32.lib wininet.lib ws2_32.lib
+ lib =
+ifndef DEBUG
+ BASIC_CFLAGS += -GL -Os -MT
+ BASIC_LDFLAGS += -LTCG
+else
+ BASIC_CFLAGS += -Zi -MTd
+endif
+ X = .exe
+else
ifneq (,$(findstring MINGW,$(uname_S)))
pathsep = ;
NO_PREAD = YesPlease
@@ -925,6 +976,7 @@ else
NO_PTHREADS = YesPlease
endif
endif
+endif
-include config.mak.autogen
-include config.mak
@@ -1327,7 +1379,7 @@ strip: $(PROGRAMS) git$X
git.o: git.c common-cmds.h GIT-CFLAGS
$(QUIET_CC)$(CC) -DGIT_VERSION='"$(GIT_VERSION)"' \
'-DGIT_HTML_PATH="$(htmldir_SQ)"' \
- $(ALL_CFLAGS) -c $(filter %.c,$^)
+ $(ALL_CFLAGS) -o $@ -c $(filter %.c,$^)
git$X: git.o $(BUILTIN_OBJS) $(GITLIBS)
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ git.o \
diff --git a/compat/vcbuild/scripts/clink.pl b/compat/vcbuild/scripts/clink.pl
new file mode 100644
index 0000000..0ffd59f
--- /dev/null
+++ b/compat/vcbuild/scripts/clink.pl
@@ -0,0 +1,48 @@
+#!/usr/bin/perl -w
+######################################################################
+# Compiles or links files
+#
+# This is a wrapper to facilitate the compilation of Git with MSVC
+# using GNU Make as the build system. So, instead of manipulating the
+# Makefile into something nasty, just to support non-space arguments
+# etc, we use this wrapper to fix the command line options
+#
+# Copyright (C) 2009 Marius Storm-Olsen <mstormo@gmail.com>
+######################################################################
+use strict;
+my @args = ();
+my @cflags = ();
+my $is_linking = 0;
+while (@ARGV) {
+ my $arg = shift @ARGV;
+ if ("$arg" =~ /^-[DIMGO]/) {
+ push(@cflags, $arg);
+ } elsif ("$arg" eq "-o") {
+ my $file_out = shift @ARGV;
+ if ("$file_out" =~ /exe$/) {
+ $is_linking = 1;
+ push(@args, "-OUT:$file_out");
+ } else {
+ push(@args, "-Fo$file_out");
+ }
+ } elsif ("$arg" eq "-lz") {
+ push(@args, "zlib.lib");
+ } elsif ("$arg" eq "-liconv") {
+ push(@args, "iconv.lib");
+ } elsif ("$arg" =~ /^-L/ && "$arg" ne "-LTCG") {
+ $arg =~ s/^-L/-LIBPATH:/;
+ push(@args, $arg);
+ } elsif ("$arg" =~ /^-R/) {
+ # eat
+ } else {
+ push(@args, $arg);
+ }
+}
+if ($is_linking) {
+ unshift(@args, "link.exe");
+} else {
+ unshift(@args, "cl.exe");
+ push(@args, @cflags);
+}
+#printf("**** @args\n");
+exit system(@args);
diff --git a/compat/vcbuild/scripts/lib.pl b/compat/vcbuild/scripts/lib.pl
new file mode 100644
index 0000000..68f6644
--- /dev/null
+++ b/compat/vcbuild/scripts/lib.pl
@@ -0,0 +1,26 @@
+#!/usr/bin/perl -w
+######################################################################
+# Libifies files on Windows
+#
+# This is a wrapper to facilitate the compilation of Git with MSVC
+# using GNU Make as the build system. So, instead of manipulating the
+# Makefile into something nasty, just to support non-space arguments
+# etc, we use this wrapper to fix the command line options
+#
+# Copyright (C) 2009 Marius Storm-Olsen <mstormo@gmail.com>
+######################################################################
+use strict;
+my @args = ();
+while (@ARGV) {
+ my $arg = shift @ARGV;
+ if ("$arg" eq "rcs") {
+ # Consume the rcs option
+ } elsif ("$arg" =~ /\.a$/) {
+ push(@args, "-OUT:$arg");
+ } else {
+ push(@args, $arg);
+ }
+}
+unshift(@args, "lib.exe");
+# printf("**** @args\n");
+exit system(@args);
--
1.6.2.1.418.g33d56.dirty
^ permalink raw reply related
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