* [JGIT PATCH 2/2] Update the reflog for HEAD when the referenced branch is modified
From: Robin Rosenberg @ 2009-08-16 21:36 UTC (permalink / raw)
To: spearce; +Cc: git, Robin Rosenberg
In-Reply-To: <1250458612-21095-1-git-send-email-robin.rosenberg@dewire.com>
This omission was mentioned in http://code.google.com/p/egit/issues/detail?id=5
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
---
.../tst/org/spearce/jgit/lib/RefUpdateTest.java | 32 ++++++++++++++++++++
.../src/org/spearce/jgit/lib/RefLogWriter.java | 6 ++-
.../src/org/spearce/jgit/lib/RefRename.java | 6 +++-
.../src/org/spearce/jgit/lib/RefUpdate.java | 11 ++++++-
4 files changed, 51 insertions(+), 4 deletions(-)
diff --git a/org.spearce.jgit.test/tst/org/spearce/jgit/lib/RefUpdateTest.java b/org.spearce.jgit.test/tst/org/spearce/jgit/lib/RefUpdateTest.java
index 655e54e..edccf37 100644
--- a/org.spearce.jgit.test/tst/org/spearce/jgit/lib/RefUpdateTest.java
+++ b/org.spearce.jgit.test/tst/org/spearce/jgit/lib/RefUpdateTest.java
@@ -82,6 +82,15 @@ public void testNoCacheObjectIdSubclass() throws IOException {
assertNotSame(newid, r.getObjectId());
assertSame(ObjectId.class, r.getObjectId().getClass());
assertEquals(newid.copy(), r.getObjectId());
+ List<org.spearce.jgit.lib.ReflogReader.Entry> reverseEntries1 = db.getReflogReader("refs/heads/abc").getReverseEntries();
+ org.spearce.jgit.lib.ReflogReader.Entry entry1 = reverseEntries1.get(0);
+ assertEquals(1, reverseEntries1.size());
+ assertEquals(ObjectId.zeroId(), entry1.getOldId());
+ assertEquals(r.getObjectId(), entry1.getNewId());
+ assertEquals(new PersonIdent(db).toString(), entry1.getWho().toString());
+ assertEquals("", entry1.getComment());
+ List<org.spearce.jgit.lib.ReflogReader.Entry> reverseEntries2 = db.getReflogReader("HEAD").getReverseEntries();
+ assertEquals(0, reverseEntries2.size());
}
public void testNewNamespaceConflictWithLoosePrefixNameExists()
@@ -103,6 +112,8 @@ public void testNewNamespaceConflictWithLoosePrefixNameExists()
ru.setNewObjectId(newid2);
Result update2 = ru2.update();
assertEquals(Result.LOCK_FAILURE, update2);
+ assertEquals(1, db.getReflogReader("refs/heads/z").getReverseEntries().size());
+ assertEquals(0, db.getReflogReader("HEAD").getReverseEntries().size());
}
public void testNewNamespaceConflictWithPackedPrefixNameExists()
@@ -115,6 +126,8 @@ public void testNewNamespaceConflictWithPackedPrefixNameExists()
ru.setNewObjectId(newid);
Result update = ru.update();
assertEquals(Result.LOCK_FAILURE, update);
+ assertNull(db.getReflogReader("refs/heads/master/x"));
+ assertEquals(0, db.getReflogReader("HEAD").getReverseEntries().size());
}
public void testNewNamespaceConflictWithLoosePrefixOfExisting()
@@ -136,6 +149,9 @@ public void testNewNamespaceConflictWithLoosePrefixOfExisting()
ru.setNewObjectId(newid2);
Result update2 = ru2.update();
assertEquals(Result.LOCK_FAILURE, update2);
+ assertEquals(1, db.getReflogReader("refs/heads/z/a").getReverseEntries().size());
+ assertNull(db.getReflogReader("refs/heads/z"));
+ assertEquals(0, db.getReflogReader("HEAD").getReverseEntries().size());
}
public void testNewNamespaceConflictWithPackedPrefixOfExisting()
@@ -148,6 +164,8 @@ public void testNewNamespaceConflictWithPackedPrefixOfExisting()
ru.setNewObjectId(newid);
Result update = ru.update();
assertEquals(Result.LOCK_FAILURE, update);
+ assertNull(db.getReflogReader("refs/heads/prefix"));
+ assertEquals(0, db.getReflogReader("HEAD").getReverseEntries().size());
}
/**
@@ -167,6 +185,8 @@ public void testDeleteHEADreferencedRef() throws IOException {
Result delete = updateRef2.delete();
assertEquals(Result.REJECTED_CURRENT_BRANCH, delete);
assertEquals(pid, db.resolve("refs/heads/master"));
+ assertEquals(1,db.getReflogReader("refs/heads/master").getReverseEntries().size());
+ assertEquals(0,db.getReflogReader("HEAD").getReverseEntries().size());
}
public void testLooseDelete() throws IOException {
@@ -175,11 +195,14 @@ public void testLooseDelete() throws IOException {
ref.update(); // create loose ref
ref = updateRef(newRef); // refresh
delete(ref, Result.NO_CHANGE);
+ assertNull(db.getReflogReader("refs/heads/abc"));
}
public void testDeleteHead() throws IOException {
final RefUpdate ref = updateRef(Constants.HEAD);
delete(ref, Result.REJECTED_CURRENT_BRANCH, true, false);
+ assertEquals(0, db.getReflogReader("refs/heads/master").getReverseEntries().size());
+ assertEquals(0, db.getReflogReader("HEAD").getReverseEntries().size());
}
/**
@@ -498,6 +521,10 @@ public void testRenameBranchAlsoInPack() throws IOException {
assertNull(db.resolve("refs/heads/b"));
assertEquals("Branch: renamed b to new/name", db.getReflogReader(
"new/name").getLastEntry().getComment());
+ assertEquals(3, db.getReflogReader("refs/heads/new/name").getReverseEntries().size());
+ assertEquals("Branch: renamed b to new/name", db.getReflogReader("refs/heads/new/name").getReverseEntries().get(0).getComment());
+ assertEquals(0, db.getReflogReader("HEAD").getReverseEntries().size());
+ // make sure b's log file is gone too.
assertFalse(new File(db.getDirectory(), "logs/refs/heads/b").exists());
// Create new Repository instance, to reread caches and make sure our
@@ -640,6 +667,9 @@ public void testRenameRefNameColission1avoided() throws IOException {
.getReverseEntries().get(1).getComment());
assertEquals("Setup", db.getReflogReader("a/b").getReverseEntries()
.get(2).getComment());
+ // same thing was logged to HEAD
+ assertEquals("Branch: renamed a to a/b", db.getReflogReader("HEAD")
+ .getReverseEntries().get(0).getComment());
}
public void testRenameRefNameColission2avoided() throws IOException {
@@ -673,5 +703,7 @@ public void testRenameRefNameColission2avoided() throws IOException {
.getReverseEntries().get(1).getComment());
assertEquals("Setup", db.getReflogReader("prefix").getReverseEntries()
.get(2).getComment());
+ assertEquals("Branch: renamed prefix/a to prefix", db.getReflogReader(
+ "HEAD").getReverseEntries().get(0).getComment());
}
}
diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/RefLogWriter.java b/org.spearce.jgit/src/org/spearce/jgit/lib/RefLogWriter.java
index 0864209..4aad809 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/lib/RefLogWriter.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/RefLogWriter.java
@@ -56,13 +56,15 @@ static void append(final RefUpdate u, final String msg) throws IOException {
final PersonIdent ident = u.getRefLogIdent();
appendOneRecord(oldId, newId, ident, msg, db, u.getName());
+ if (!u.getName().equals(u.getOrigName()))
+ appendOneRecord(oldId, newId, ident, msg, db, u.getOrigName());
}
- static void append(RefRename refRename, String msg) throws IOException {
+ static void append(RefRename refRename, String logName, String msg) throws IOException {
final ObjectId id = refRename.getObjectId();
final Repository db = refRename.getRepository();
final PersonIdent ident = refRename.getRefLogIdent();
- appendOneRecord(id, id, ident, msg, db, refRename.getToName());
+ appendOneRecord(id, id, ident, msg, db, logName);
}
static void renameTo(final Repository db, final RefUpdate from,
diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/RefRename.java b/org.spearce.jgit/src/org/spearce/jgit/lib/RefRename.java
index c89459b..0718620 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/lib/RefRename.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/RefRename.java
@@ -136,9 +136,13 @@ public Result rename() throws IOException {
} else {
db.fireRefsMaybeChanged();
}
- RefLogWriter.append(this, "Branch: renamed "
+ RefLogWriter.append(this, newToUpdate.getName(), "Branch: renamed "
+ db.shortenRefName(oldFromDelete.getName()) + " to "
+ db.shortenRefName(newToUpdate.getName()));
+ if (renameHEADtoo)
+ RefLogWriter.append(this, Constants.HEAD, "Branch: renamed "
+ + db.shortenRefName(oldFromDelete.getName()) + " to "
+ + db.shortenRefName(newToUpdate.getName()));
return renameResult = Result.RENAMED;
} catch (RuntimeException e) {
throw e;
diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/RefUpdate.java b/org.spearce.jgit/src/org/spearce/jgit/lib/RefUpdate.java
index f8ecc3c..69399ec 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/lib/RefUpdate.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/RefUpdate.java
@@ -182,13 +182,22 @@ public Repository getRepository() {
/**
* Get the name of the ref this update will operate on.
*
- * @return name of this ref.
+ * @return name of underlying ref.
*/
public String getName() {
return ref.getName();
}
/**
+ * Get the requested name of the ref thit update will operate on
+ *
+ * @return original (requested) name of the underlying ref.
+ */
+ public String getOrigName() {
+ return ref.getOrigName();
+ }
+
+ /**
* Get the new value the ref will be (or was) updated to.
*
* @return new value. Null if the caller has not configured it.
--
1.6.4.115.gc0eb0
^ permalink raw reply related
* [JGIT PATCH 1/2] Add time and timezone to SystemReader properties
From: Robin Rosenberg @ 2009-08-16 21:36 UTC (permalink / raw)
To: spearce; +Cc: git, Robin Rosenberg
Having an uncontrollable variable time and timezone is
inconvenient for unit testing.
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
---
.../tst/org/spearce/jgit/lib/MockSystemReader.java | 11 ++++++++++
.../src/org/spearce/jgit/lib/PersonIdent.java | 6 +++-
.../src/org/spearce/jgit/util/SystemReader.java | 22 ++++++++++++++++++++
3 files changed, 37 insertions(+), 2 deletions(-)
diff --git a/org.spearce.jgit.test/tst/org/spearce/jgit/lib/MockSystemReader.java b/org.spearce.jgit.test/tst/org/spearce/jgit/lib/MockSystemReader.java
index 7a65f99..e51df7e 100644
--- a/org.spearce.jgit.test/tst/org/spearce/jgit/lib/MockSystemReader.java
+++ b/org.spearce.jgit.test/tst/org/spearce/jgit/lib/MockSystemReader.java
@@ -39,6 +39,7 @@
import java.util.HashMap;
import java.util.Map;
+import java.util.TimeZone;
import org.spearce.jgit.util.SystemReader;
@@ -75,4 +76,14 @@ public FileBasedConfig openUserConfig() {
public String getHostname() {
return "fake.host.example.com";
}
+
+ @Override
+ public long getCurrentTime() {
+ return 1250379778668L; // Sat Aug 15 20:12:58 GMT-03:30 2009
+ }
+
+ @Override
+ public int getTimezone(long when) {
+ return TimeZone.getTimeZone("GMT-3:30").getOffset(when);
+ }
}
diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/PersonIdent.java b/org.spearce.jgit/src/org/spearce/jgit/lib/PersonIdent.java
index 393e177..a0418ab 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/lib/PersonIdent.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/PersonIdent.java
@@ -44,6 +44,8 @@
import java.util.Locale;
import java.util.TimeZone;
+import org.spearce.jgit.util.SystemReader;
+
/**
* A combination of a person identity and time in Git.
*
@@ -70,8 +72,8 @@ public PersonIdent(final Repository repo) {
final RepositoryConfig config = repo.getConfig();
name = config.getCommitterName();
emailAddress = config.getCommitterEmail();
- when = System.currentTimeMillis();
- tzOffset = TimeZone.getDefault().getOffset(when) / (60 * 1000);
+ when = SystemReader.getInstance().getCurrentTime();
+ tzOffset = SystemReader.getInstance().getTimezone(when);
}
/**
diff --git a/org.spearce.jgit/src/org/spearce/jgit/util/SystemReader.java b/org.spearce.jgit/src/org/spearce/jgit/util/SystemReader.java
index 51a0d29..083d120 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/util/SystemReader.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/util/SystemReader.java
@@ -40,6 +40,7 @@
import java.io.File;
import java.net.InetAddress;
import java.net.UnknownHostException;
+import java.util.TimeZone;
import org.spearce.jgit.lib.FileBasedConfig;
@@ -81,6 +82,16 @@ public String getHostname() {
}
return hostname;
}
+
+ @Override
+ public long getCurrentTime() {
+ return System.currentTimeMillis();
+ }
+
+ @Override
+ public int getTimezone(long when) {
+ return TimeZone.getDefault().getOffset(when) / (60 * 1000);
+ }
};
/** @return the live instance to read system properties. */
@@ -120,4 +131,15 @@ public static void setInstance(SystemReader newReader) {
* @return the git configuration found in the user home
*/
public abstract FileBasedConfig openUserConfig();
+
+ /**
+ * @return the current system time
+ */
+ public abstract long getCurrentTime();
+
+ /**
+ * @param when TODO
+ * @return the local time zone
+ */
+ public abstract int getTimezone(long when);
}
--
1.6.4.115.gc0eb0
^ permalink raw reply related
* [PATCH v2 2/2] git_remote_cvs: Use $(shell) in the Makefile
From: David Aguilar @ 2009-08-16 21:25 UTC (permalink / raw)
To: gitster, johan; +Cc: git, barkalow, Johannes.Schindelin, mhagger, David Aguilar
In-Reply-To: <1250457908-27376-1-git-send-email-davvid@gmail.com>
This updates the git_remote_cvs Makefile to use the same
$(shell <cmd>) style used by the top-level git Makefile.
Signed-off-by: David Aguilar <davvid@gmail.com>
---
git_remote_cvs/Makefile | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/git_remote_cvs/Makefile b/git_remote_cvs/Makefile
index 2e26dbe..061c247 100644
--- a/git_remote_cvs/Makefile
+++ b/git_remote_cvs/Makefile
@@ -17,15 +17,19 @@ ifndef V
QUIETSETUP = --quiet
endif
-PYLIBDIR=`$(PYTHON_PATH) -c "import sys; print 'lib/python%i.%i/site-packages' % sys.version_info[:2]"`
+PYLIBDIR=$(shell $(PYTHON_PATH) -c \
+ "import sys; \
+ print 'lib/python%i.%i/site-packages' % sys.version_info[:2]")
all: $(pysetupfile)
$(QUIET)$(PYTHON_PATH) $(pysetupfile) $(QUIETSETUP) build
+
install: $(pysetupfile)
$(PYTHON_PATH) $(pysetupfile) install --prefix $(DESTDIR_SQ)$(prefix)
instlibdir: $(pysetupfile)
@echo "$(prefix)/$(PYLIBDIR)"
+
clean:
$(QUIET)$(PYTHON_PATH) $(pysetupfile) $(QUIETSETUP) clean -a
$(RM) *.pyo *.pyc
--
1.6.4.314.g034e1
^ permalink raw reply related
* [PATCH v2 1/2] git_remote_cvs: Honor DESTDIR in the Makefile
From: David Aguilar @ 2009-08-16 21:25 UTC (permalink / raw)
To: gitster, johan; +Cc: git, barkalow, Johannes.Schindelin, mhagger, David Aguilar
In-Reply-To: <alpine.DEB.1.00.0908162251360.8306@pacific.mpi-cbg.de>
This modifies the setup.py invocation so that user-defined
DESTDIRs are taken into account.
Signed-off-by: David Aguilar <davvid@gmail.com>
---
setup.py gets confused if we use --root like in v1 of this patch.
I think this is simpler. Thoughts?
git_remote_cvs/Makefile | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/git_remote_cvs/Makefile b/git_remote_cvs/Makefile
index 8dbf3fa..2e26dbe 100644
--- a/git_remote_cvs/Makefile
+++ b/git_remote_cvs/Makefile
@@ -3,6 +3,9 @@
#
pysetupfile:=setup.py
+# Shell quote (do not use $(call) to accommodate ancient setups);
+DESTDIR_SQ = $(subst ','\'',$(DESTDIR))
+
ifndef PYTHON_PATH
PYTHON_PATH = /usr/bin/python
endif
@@ -19,7 +22,8 @@ PYLIBDIR=`$(PYTHON_PATH) -c "import sys; print 'lib/python%i.%i/site-packages' %
all: $(pysetupfile)
$(QUIET)$(PYTHON_PATH) $(pysetupfile) $(QUIETSETUP) build
install: $(pysetupfile)
- $(PYTHON_PATH) $(pysetupfile) install --prefix $(prefix)
+ $(PYTHON_PATH) $(pysetupfile) install --prefix $(DESTDIR_SQ)$(prefix)
+
instlibdir: $(pysetupfile)
@echo "$(prefix)/$(PYLIBDIR)"
clean:
--
1.6.4.314.g034e1
^ permalink raw reply related
* [PATCH] svn: assume URLs from the command-line are URI-encoded
From: Eric Wong @ 2009-08-16 21:22 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Mike Smullin, Björn Steinbrink, git
In-Reply-To: <20090815181637.GC19833@atjola.homenet>
And then unescape them when writing to $GIT_CONFIG.
SVN has different rules for repository URLs (usually the root)
and for paths within that repository (below the HTTP layer).
Thus, for the request URI path at the HTTP level, the URI needs
to be encoded. However, in the body of the HTTP request (the
with underlying SVN XML protocol), those paths should not be
URI-encoded[1]. For non-HTTP(S) requests, SVN appears to be
more flexible and will except weird characters in the URL as
well as URI-encoded ones.
Since users are used to using URLs being entirely URI-encoded,
git svn will now attempt to unescape the path portion of URLs
while leaving the actual repository URL untouched.
This change will be reflected in newly-created $GIT_CONFIG files
only. This allows users to switch between svn(+ssh)://, file://
and http(s):// urls without changing the fetch/branches/tags
config keys. This won't affect existing imports at all (since
things didn't work before this commit anyways), and will allow
users to force escaping into repository paths that look like
they're escaped (but are not).
Thanks to Mike Smullin for the original bug report and Björn
Steinbrink for summarizing it into testable cases for me.
[1] Except when committing copies/renames, see
commit 29633bb91c7bcff31ff3bb59378709e3e3ef627d
Signed-off-by: Eric Wong <normalperson@yhbt.net>
---
When I first wrote git svn back in early 2006, I remember
telling a friend I hope I'd never have to deal with SVN ever
again...
git-svn.perl | 2 +
t/t9120-git-svn-clone-with-percent-escapes.sh | 52 +++++++++++++++++++++++++
2 files changed, 54 insertions(+), 0 deletions(-)
diff --git a/git-svn.perl b/git-svn.perl
index b0bfb74..5083c30 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -1211,6 +1211,7 @@ sub complete_url_ls_init {
}
command_oneline('config', $k, $gs->{url}) unless $orig_url;
my $remote_path = "$gs->{path}/$repo_path";
+ $remote_path =~ s{%([0-9A-F]{2})}{chr hex($1)}ieg;
$remote_path =~ s#/+#/#g;
$remote_path =~ s#^/##g;
$remote_path .= "/*" if $remote_path !~ /\*/;
@@ -1879,6 +1880,7 @@ sub init_remote_config {
command_noisy('config',
"svn-remote.$self->{repo_id}.url", $url);
$self->{path} =~ s{^/}{};
+ $self->{path} =~ s{%([0-9A-F]{2})}{chr hex($1)}ieg;
command_noisy('config', '--add',
"svn-remote.$self->{repo_id}.fetch",
"$self->{path}:".$self->refname);
diff --git a/t/t9120-git-svn-clone-with-percent-escapes.sh b/t/t9120-git-svn-clone-with-percent-escapes.sh
index f159ab6..9d9ebd5 100755
--- a/t/t9120-git-svn-clone-with-percent-escapes.sh
+++ b/t/t9120-git-svn-clone-with-percent-escapes.sh
@@ -10,6 +10,10 @@ test_expect_success 'setup svnrepo' '
mkdir project project/trunk project/branches project/tags &&
echo foo > project/trunk/foo &&
svn_cmd import -m "$test_description" project "$svnrepo/pr ject" &&
+ svn_cmd cp -m "branch" "$svnrepo/pr ject/trunk" \
+ "$svnrepo/pr ject/branches/b" &&
+ svn_cmd cp -m "tag" "$svnrepo/pr ject/trunk" \
+ "$svnrepo/pr ject/tags/v1" &&
rm -rf project &&
start_httpd
'
@@ -21,6 +25,54 @@ test_expect_success 'test clone with percent escapes' '
cd ..
'
+# SVN works either way, so should we...
+
+test_expect_success 'svn checkout with percent escapes' '
+ svn_cmd checkout "$svnrepo/pr%20ject" svn.percent &&
+ svn_cmd checkout "$svnrepo/pr%20ject/trunk" svn.percent.trunk
+'
+
+test_expect_success 'svn checkout with space' '
+ svn_cmd checkout "$svnrepo/pr ject" svn.space &&
+ svn_cmd checkout "$svnrepo/pr ject/trunk" svn.space.trunk
+'
+
+test_expect_success 'test clone trunk with percent escapes and minimize-url' '
+ git svn clone --minimize-url "$svnrepo/pr%20ject/trunk" minimize &&
+ (
+ cd minimize &&
+ git rev-parse refs/${remotes_git_svn}
+ )
+'
+
+test_expect_success 'test clone trunk with percent escapes' '
+ git svn clone "$svnrepo/pr%20ject/trunk" trunk &&
+ (
+ cd trunk &&
+ git rev-parse refs/${remotes_git_svn}
+ )
+'
+
+test_expect_success 'test clone --stdlayout with percent escapes' '
+ git svn clone --stdlayout "$svnrepo/pr%20ject" percent &&
+ (
+ cd percent &&
+ git rev-parse refs/remotes/trunk^0 &&
+ git rev-parse refs/remotes/b^0 &&
+ git rev-parse refs/remotes/tags/v1^0
+ )
+'
+
+test_expect_success 'test clone -s with unescaped space' '
+ git svn clone -s "$svnrepo/pr ject" space &&
+ (
+ cd space &&
+ git rev-parse refs/remotes/trunk^0 &&
+ git rev-parse refs/remotes/b^0 &&
+ git rev-parse refs/remotes/tags/v1^0
+ )
+'
+
stop_httpd
test_done
--
Eric Wong
^ permalink raw reply related
* Re: [PATCH 1/2] git_remote_cvs: Honor DESTDIR in the Makefile
From: Johannes Schindelin @ 2009-08-16 21:21 UTC (permalink / raw)
To: David Aguilar; +Cc: gitster, johan, git, barkalow, mhagger
In-Reply-To: <20090816210300.GB23522@gmail.com>
Hi,
On Sun, 16 Aug 2009, David Aguilar wrote:
> On Sun, Aug 16, 2009 at 10:55:29PM +0200, Johannes Schindelin wrote:
>
> > On Sun, 16 Aug 2009, David Aguilar wrote:
> >
> > > diff --git a/git_remote_cvs/Makefile b/git_remote_cvs/Makefile
> > > index 8dbf3fa..f52c096 100644
> > > --- a/git_remote_cvs/Makefile
> > > +++ b/git_remote_cvs/Makefile
> > > @@ -3,6 +3,15 @@
> > > #
> > > pysetupfile:=setup.py
> > >
> > > +# Setup the DESTDIR for Python.
> > > +ifeq ($(DESTDIR),)
> > > +PYTHON_DESTDIR = /
> >
> > Hmm. I think this would break on msysGit. Not that anybody worked on
> > getting Python to compile on msysGit.
> >
> > (Just to make sure you understand the issue: on msysGit, we set prefix to
> > "" (and I think DESTDIR somehow ends up taking on the same value). Now,
> > when DESTDIR is set to "/" and something wants to be copied to
> > $(DESTDIR)/something, the latter expands to //something, which tells MSys
> > not to expand //something to the correct Windows path.
>
>
> I see. Hmm.. setup.py is a real pain.
>
> I'll see if we rework this so that we end up passing "" to
> --root instead of /. I'm going to be gone for a few hours so
> probably won't be able to try it out until tonight.
Thinking about it a bit more: you might not need to do anything. I think
that msysGit should move to prefix = /mingw anyway.
I hesitated to do that earlier, as all .perl and .sh scripts need MSys.
But the Git .exe files are MinGW programs, so technically they belong into
/mingw/bin/ anyway.
But the issue would only really become relevant if anybody supported
Python on msysGit (and thereby git-remote-cvs, before that, we cannot make
use of it).
Just a thing to keep in mind.
Ciao,
Dscho
^ permalink raw reply
* Re: [PATCH 1/2] git_remote_cvs: Honor DESTDIR in the Makefile
From: David Aguilar @ 2009-08-16 21:03 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: gitster, johan, git, barkalow, mhagger
In-Reply-To: <alpine.DEB.1.00.0908162251360.8306@pacific.mpi-cbg.de>
On Sun, Aug 16, 2009 at 10:55:29PM +0200, Johannes Schindelin wrote:
> Hi,
>
> On Sun, 16 Aug 2009, David Aguilar wrote:
>
> > diff --git a/git_remote_cvs/Makefile b/git_remote_cvs/Makefile
> > index 8dbf3fa..f52c096 100644
> > --- a/git_remote_cvs/Makefile
> > +++ b/git_remote_cvs/Makefile
> > @@ -3,6 +3,15 @@
> > #
> > pysetupfile:=setup.py
> >
> > +# Setup the DESTDIR for Python.
> > +ifeq ($(DESTDIR),)
> > +PYTHON_DESTDIR = /
>
> Hmm. I think this would break on msysGit. Not that anybody worked on
> getting Python to compile on msysGit.
>
> (Just to make sure you understand the issue: on msysGit, we set prefix to
> "" (and I think DESTDIR somehow ends up taking on the same value). Now,
> when DESTDIR is set to "/" and something wants to be copied to
> $(DESTDIR)/something, the latter expands to //something, which tells MSys
> not to expand //something to the correct Windows path.
I see. Hmm.. setup.py is a real pain.
I'll see if we rework this so that we end up passing "" to
--root instead of /. I'm going to be gone for a few hours so
probably won't be able to try it out until tonight.
Another thing to consider --
Debian once submitted a bug against another Python app asking
that we not place modules in site-packages unless we
plan on having other applications importing those modules.
The more appropriate place for them if we don't plan on that is
$(prefix)/share/git-core/git_remote_cvs or something like that.
I guess that's another thing to think about.
--
David
^ permalink raw reply
* Re: [PATCH 1/2] git_remote_cvs: Honor DESTDIR in the Makefile
From: Johannes Schindelin @ 2009-08-16 20:55 UTC (permalink / raw)
To: David Aguilar; +Cc: gitster, johan, git, barkalow, mhagger
In-Reply-To: <1250455088-23457-1-git-send-email-davvid@gmail.com>
Hi,
On Sun, 16 Aug 2009, David Aguilar wrote:
> diff --git a/git_remote_cvs/Makefile b/git_remote_cvs/Makefile
> index 8dbf3fa..f52c096 100644
> --- a/git_remote_cvs/Makefile
> +++ b/git_remote_cvs/Makefile
> @@ -3,6 +3,15 @@
> #
> pysetupfile:=setup.py
>
> +# Setup the DESTDIR for Python.
> +ifeq ($(DESTDIR),)
> +PYTHON_DESTDIR = /
Hmm. I think this would break on msysGit. Not that anybody worked on
getting Python to compile on msysGit.
(Just to make sure you understand the issue: on msysGit, we set prefix to
"" (and I think DESTDIR somehow ends up taking on the same value). Now,
when DESTDIR is set to "/" and something wants to be copied to
$(DESTDIR)/something, the latter expands to //something, which tells MSys
not to expand //something to the correct Windows path.
Ciao,
Dscho
^ permalink raw reply
* Re: [PATCH 2/2] git_remote_cvs: Use $(shell) in the Makefile
From: David Aguilar @ 2009-08-16 20:47 UTC (permalink / raw)
To: gitster, johan; +Cc: git, barkalow, Johannes.Schindelin, mhagger
In-Reply-To: <1250455088-23457-2-git-send-email-davvid@gmail.com>
On Sun, Aug 16, 2009 at 01:38:08PM -0700, David Aguilar wrote:
> This updates the git_remote_cvs Makefile to use the same
> $(shell <cmd>) style used by the top-level git Makefile.
>
> Signed-off-by: David Aguilar <davvid@gmail.com>
> ---
I should have mentioned here that I also spaced stuff out and
chopped the long line so that it fits within 78 chars.
I intentionally broke this out as a 2nd patch in case using
$(shell ...) was not the right thing to do.
> git_remote_cvs/Makefile | 6 +++++-
> 1 files changed, 5 insertions(+), 1 deletions(-)
>
> diff --git a/git_remote_cvs/Makefile b/git_remote_cvs/Makefile
> index f52c096..d281d48 100644
> --- a/git_remote_cvs/Makefile
> +++ b/git_remote_cvs/Makefile
> @@ -23,10 +23,13 @@ ifndef V
> QUIETSETUP = --quiet
> endif
>
> -PYLIBDIR=`$(PYTHON_PATH) -c "import sys; print 'lib/python%i.%i/site-packages' % sys.version_info[:2]"`
> +PYLIBDIR=$(shell $(PYTHON_PATH) -c \
> + "import sys; \
> + print 'lib/python%i.%i/site-packages' % sys.version_info[:2]")
>
> all: $(pysetupfile)
> $(QUIET)$(PYTHON_PATH) $(pysetupfile) $(QUIETSETUP) build
> +
> install: $(pysetupfile)
> $(PYTHON_PATH) $(pysetupfile) install \
> --prefix $(prefix) \
> @@ -34,6 +37,7 @@ install: $(pysetupfile)
>
> instlibdir: $(pysetupfile)
> @echo "$(prefix)/$(PYLIBDIR)"
> +
> clean:
> $(QUIET)$(PYTHON_PATH) $(pysetupfile) $(QUIETSETUP) clean -a
> $(RM) *.pyo *.pyc
> --
> 1.6.4.169.g64d5
>
--
David
^ permalink raw reply
* [PATCH 2/2] git_remote_cvs: Use $(shell) in the Makefile
From: David Aguilar @ 2009-08-16 20:38 UTC (permalink / raw)
To: gitster, johan; +Cc: git, barkalow, Johannes.Schindelin, mhagger, David Aguilar
In-Reply-To: <1250455088-23457-1-git-send-email-davvid@gmail.com>
This updates the git_remote_cvs Makefile to use the same
$(shell <cmd>) style used by the top-level git Makefile.
Signed-off-by: David Aguilar <davvid@gmail.com>
---
git_remote_cvs/Makefile | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/git_remote_cvs/Makefile b/git_remote_cvs/Makefile
index f52c096..d281d48 100644
--- a/git_remote_cvs/Makefile
+++ b/git_remote_cvs/Makefile
@@ -23,10 +23,13 @@ ifndef V
QUIETSETUP = --quiet
endif
-PYLIBDIR=`$(PYTHON_PATH) -c "import sys; print 'lib/python%i.%i/site-packages' % sys.version_info[:2]"`
+PYLIBDIR=$(shell $(PYTHON_PATH) -c \
+ "import sys; \
+ print 'lib/python%i.%i/site-packages' % sys.version_info[:2]")
all: $(pysetupfile)
$(QUIET)$(PYTHON_PATH) $(pysetupfile) $(QUIETSETUP) build
+
install: $(pysetupfile)
$(PYTHON_PATH) $(pysetupfile) install \
--prefix $(prefix) \
@@ -34,6 +37,7 @@ install: $(pysetupfile)
instlibdir: $(pysetupfile)
@echo "$(prefix)/$(PYLIBDIR)"
+
clean:
$(QUIET)$(PYTHON_PATH) $(pysetupfile) $(QUIETSETUP) clean -a
$(RM) *.pyo *.pyc
--
1.6.4.169.g64d5
^ permalink raw reply related
* [PATCH 1/2] git_remote_cvs: Honor DESTDIR in the Makefile
From: David Aguilar @ 2009-08-16 20:38 UTC (permalink / raw)
To: gitster, johan; +Cc: git, barkalow, Johannes.Schindelin, mhagger, David Aguilar
In-Reply-To: <7v7hx35ym1.fsf@alter.siamese.dyndns.org>
This adds the --root=<path> flag to setup.py so that the
user-provided DESTDIR is honored.
Signed-off-by: David Aguilar <davvid@gmail.com>
---
git_remote_cvs/Makefile | 14 +++++++++++++-
1 files changed, 13 insertions(+), 1 deletions(-)
diff --git a/git_remote_cvs/Makefile b/git_remote_cvs/Makefile
index 8dbf3fa..f52c096 100644
--- a/git_remote_cvs/Makefile
+++ b/git_remote_cvs/Makefile
@@ -3,6 +3,15 @@
#
pysetupfile:=setup.py
+# Setup the DESTDIR for Python.
+ifeq ($(DESTDIR),)
+PYTHON_DESTDIR = /
+else
+PYTHON_DESTDIR = $(DESTDIR)
+endif
+# Shell quote (do not use $(call) to accommodate ancient setups);
+PYTHON_DESTDIR_SQ = $(subst ','\'',$(PYTHON_DESTDIR))
+
ifndef PYTHON_PATH
PYTHON_PATH = /usr/bin/python
endif
@@ -19,7 +28,10 @@ PYLIBDIR=`$(PYTHON_PATH) -c "import sys; print 'lib/python%i.%i/site-packages' %
all: $(pysetupfile)
$(QUIET)$(PYTHON_PATH) $(pysetupfile) $(QUIETSETUP) build
install: $(pysetupfile)
- $(PYTHON_PATH) $(pysetupfile) install --prefix $(prefix)
+ $(PYTHON_PATH) $(pysetupfile) install \
+ --prefix $(prefix) \
+ --root $(PYTHON_DESTDIR_SQ)
+
instlibdir: $(pysetupfile)
@echo "$(prefix)/$(PYLIBDIR)"
clean:
--
1.6.4.169.g64d5
^ permalink raw reply related
* Re: Linus' sha1 is much faster!
From: Linus Torvalds @ 2009-08-16 20:10 UTC (permalink / raw)
To: Giuseppe Scrivano; +Cc: Bug-coreutils, Pádraig Brady, Git Mailing List
In-Reply-To: <87eirbef3c.fsf@master.homenet>
On Sun, 16 Aug 2009, Giuseppe Scrivano wrote:
>
> My GCC version is "gcc (Debian 4.3.3-14) 4.3.3" and the CPU is: Intel(R)
> Pentium(R) D CPU 3.20GHz.
Netburst is very sensitive to random spill effects, and you can basically
tune things by just code shuffling that just has random effects on the
generated asm code.
> I also spent some time trying to improve the gnulib SHA1 implementation
> and it seems a lookup table can improve things a bit.
I pretty much can guarantee you that it improves things only because it
makes gcc generate crap code, which then hides some of the P4 issues.
I'd also suggest you try gcc-4.4, since that apparently fixes some of the
oddest spill issues.
Linus
^ permalink raw reply
* Re: [RFCv3 2/4] Add Python support library for CVS remote helper
From: Junio C Hamano @ 2009-08-16 19:48 UTC (permalink / raw)
To: Johan Herland
Cc: git, barkalow, Johannes.Schindelin, David Aguilar,
Michael Haggerty
In-Reply-To: <1250036031-32272-3-git-send-email-johan@herland.net>
It appears that the "make install" step with this patch is broken, trying
to write into /usr/lib/python2.6/ without honoring DESTDIR.
It needs to be resolved before the series nears 'master', preferrably
before it hits 'next', as "make rpm" step is one of the things that is
broken by this.
I am sure people who are more savvy on Python can offer help.
Thanks.
^ permalink raw reply
* Re: git http-push and MKCOL error (22/409)
From: Junio C Hamano @ 2009-08-16 19:34 UTC (permalink / raw)
To: Tay Ray Chuan; +Cc: Thomas Schlichter, willievu, Sean Davis, git
In-Reply-To: <be6fef0d0908160727r7dfa9b46l4d493e3954c21de3@mail.gmail.com>
Tay Ray Chuan <rctay89@gmail.com> writes:
> On Sun, Aug 16, 2009 at 9:57 PM, Thomas
> Schlichter<thomas.schlichter@web.de> wrote:
>> Current "master" and "next" trees also have this problem. But as git version
>> 1.6.4 does not have this problem, I was able to bisect it down to commit:
>>
>> 5424bc557fc6414660830b470dd45774b8f5f281
>> http*: add helper methods for fetching objects (loose)
>
> Interesting. Please do provide:
>
> -steps to reproduce,
> -your server's access log.
The report said:
MKCOL 98fd7fb8f32843c1bb40bd195a2f1cd6cab0751d failed, aborting (22/409)
As far as I can see you are trying (in http-push.c::start_mkcol()) to
create the two-hexdigit fan-out directory (i.e. "98" for this example); it
is strange to see a request to create the full 40-hexdigit collection in
the first place.
In another thread you responded to earlier:
http://thread.gmane.org/gmane.comp.version-control.git/125933/focus=125972
the original report did not give the exact error message, but in that one,
instead of failing to create 40-hexdigit collection like this, I am
guessing that it fails with something like "MKCOL 'refs' failed".
So are these unrelated "breakages"[1]?
[Foornote]
*1* Not necessarily in the sense the client is broken but in the sense
that the server-client combination does not work for the reporter.
^ permalink raw reply
* Re: Linus' sha1 is much faster!
From: Giuseppe Scrivano @ 2009-08-16 19:25 UTC (permalink / raw)
To: Pádraig Brady; +Cc: Linus Torvalds, Bug-coreutils, Git Mailing List
In-Reply-To: <4A85F270.20703@draigBrady.com>
[-- Attachment #1: Type: text/plain, Size: 575 bytes --]
Hi Pádraig,
I tried to reproduce your results but I wasn't able to do it. The
biggest difference on a 300MB file I noticed was approximately 15% using
on both implementations -O2, and 5% using -O3.
My GCC version is "gcc (Debian 4.3.3-14) 4.3.3" and the CPU is: Intel(R)
Pentium(R) D CPU 3.20GHz.
I also spent some time trying to improve the gnulib SHA1 implementation
and it seems a lookup table can improve things a bit.
Can you please try the patch that I have attached and tell me which
performance difference (if any) you get?
Thanks,
Giuseppe
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-SHA1-use-a-lookup-table-for-faster-hashing.patch --]
[-- Type: text/x-diff, Size: 8582 bytes --]
>From b975a5e0849eaa46e5cf410c5bf6e2308f044d61 Mon Sep 17 00:00:00 2001
From: Giuseppe Scrivano <gscrivano@gnu.org>
Date: Sun, 16 Aug 2009 20:53:54 +0200
Subject: [PATCH] SHA1: use a lookup table for faster hashing
* lib/sha1.c (struct sha1_pre): New member.
* lib/sha1.c (sha1_process_block): Use the lookup table to quickly find
indices to use in the current round.
---
lib/sha1.c | 160 ++++++++++++++++++++++++++++++++++-------------------------
1 files changed, 92 insertions(+), 68 deletions(-)
diff --git a/lib/sha1.c b/lib/sha1.c
index 9c6c7ae..ec18ba7 100644
--- a/lib/sha1.c
+++ b/lib/sha1.c
@@ -283,6 +283,32 @@ sha1_process_bytes (const void *buffer, size_t len, struct sha1_ctx *ctx)
#define F3(B,C,D) ( ( B & C ) | ( D & ( B | C ) ) )
#define F4(B,C,D) (B ^ C ^ D)
+struct lookup_t
+{
+ unsigned char l1 : 4;
+ unsigned char l2 : 4;
+ unsigned char l3 : 4;
+ unsigned char l4 : 4;
+};
+
+const static struct lookup_t
+sha1_pre[16] = {{(0 - 3) & 0x0f, (0 - 8) & 0x0f, (0 - 14) & 0x0f},
+ {(1 - 3) & 0x0f, (1 - 8) & 0x0f, (1 - 14) & 0x0f},
+ {(2 - 3) & 0x0f, (2 - 8) & 0x0f, (2 - 14) & 0x0f},
+ {(3 - 3) & 0x0f, (3 - 8) & 0x0f, (3 - 14) & 0x0f},
+ {(4 - 3) & 0x0f, (4 - 8) & 0x0f, (4 - 14) & 0x0f},
+ {(5 - 3) & 0x0f, (5 - 8) & 0x0f, (5 - 14) & 0x0f},
+ {(6 - 3) & 0x0f, (6 - 8) & 0x0f, (6 - 14) & 0x0f},
+ {(7 - 3) & 0x0f, (7 - 8) & 0x0f, (7 - 14) & 0x0f},
+ {(8 - 3) & 0x0f, (8 - 8) & 0x0f, (8 - 14) & 0x0f},
+ {(9 - 3) & 0x0f, (9 - 8) & 0x0f, (9 - 14) & 0x0f},
+ {(10 - 3) & 0x0f, (10 - 8) & 0x0f, (10 - 14) & 0x0f},
+ {(11 - 3) & 0x0f, (11 - 8) & 0x0f, (11 - 14) & 0x0f},
+ {(12 - 3) & 0x0f, (12 - 8) & 0x0f, (12 - 14) & 0x0f},
+ {(13 - 3) & 0x0f, (13 - 8) & 0x0f, (13 - 14) & 0x0f},
+ {(14 - 3) & 0x0f, (14 - 8) & 0x0f, (14 - 14) & 0x0f},
+ {(15 - 3) & 0x0f, (15 - 8) & 0x0f, (15 - 14) & 0x0f}};
+
/* Process LEN bytes of BUFFER, accumulating context into CTX.
It is assumed that LEN % 64 == 0.
Most of this code comes from GnuPG's cipher/sha1.c. */
@@ -309,9 +335,8 @@ sha1_process_block (const void *buffer, size_t len, struct sha1_ctx *ctx)
#define rol(x, n) (((x) << (n)) | ((uint32_t) (x) >> (32 - (n))))
-#define M(I) ( tm = x[I&0x0f] ^ x[(I-14)&0x0f] \
- ^ x[(I-8)&0x0f] ^ x[(I-3)&0x0f] \
- , (x[I&0x0f] = rol(tm, 1)) )
+#define M(I) (x[I] = rol (x[sha1_pre[I].l1] ^ x[sha1_pre[I].l2] \
+ ^ x[sha1_pre[I].l3] ^ x[I], 1))
#define R(A,B,C,D,E,F,K,M) do { E += rol( A, 5 ) \
+ F( B, C, D ) \
@@ -322,7 +347,6 @@ sha1_process_block (const void *buffer, size_t len, struct sha1_ctx *ctx)
while (words < endp)
{
- uint32_t tm;
int t;
for (t = 0; t < 16; t++)
{
@@ -346,70 +370,70 @@ sha1_process_block (const void *buffer, size_t len, struct sha1_ctx *ctx)
R( c, d, e, a, b, F1, K1, x[13] );
R( b, c, d, e, a, F1, K1, x[14] );
R( a, b, c, d, e, F1, K1, x[15] );
- R( e, a, b, c, d, F1, K1, M(16) );
- R( d, e, a, b, c, F1, K1, M(17) );
- R( c, d, e, a, b, F1, K1, M(18) );
- R( b, c, d, e, a, F1, K1, M(19) );
- R( a, b, c, d, e, F2, K2, M(20) );
- R( e, a, b, c, d, F2, K2, M(21) );
- R( d, e, a, b, c, F2, K2, M(22) );
- R( c, d, e, a, b, F2, K2, M(23) );
- R( b, c, d, e, a, F2, K2, M(24) );
- R( a, b, c, d, e, F2, K2, M(25) );
- R( e, a, b, c, d, F2, K2, M(26) );
- R( d, e, a, b, c, F2, K2, M(27) );
- R( c, d, e, a, b, F2, K2, M(28) );
- R( b, c, d, e, a, F2, K2, M(29) );
- R( a, b, c, d, e, F2, K2, M(30) );
- R( e, a, b, c, d, F2, K2, M(31) );
- R( d, e, a, b, c, F2, K2, M(32) );
- R( c, d, e, a, b, F2, K2, M(33) );
- R( b, c, d, e, a, F2, K2, M(34) );
- R( a, b, c, d, e, F2, K2, M(35) );
- R( e, a, b, c, d, F2, K2, M(36) );
- R( d, e, a, b, c, F2, K2, M(37) );
- R( c, d, e, a, b, F2, K2, M(38) );
- R( b, c, d, e, a, F2, K2, M(39) );
- R( a, b, c, d, e, F3, K3, M(40) );
- R( e, a, b, c, d, F3, K3, M(41) );
- R( d, e, a, b, c, F3, K3, M(42) );
- R( c, d, e, a, b, F3, K3, M(43) );
- R( b, c, d, e, a, F3, K3, M(44) );
- R( a, b, c, d, e, F3, K3, M(45) );
- R( e, a, b, c, d, F3, K3, M(46) );
- R( d, e, a, b, c, F3, K3, M(47) );
- R( c, d, e, a, b, F3, K3, M(48) );
- R( b, c, d, e, a, F3, K3, M(49) );
- R( a, b, c, d, e, F3, K3, M(50) );
- R( e, a, b, c, d, F3, K3, M(51) );
- R( d, e, a, b, c, F3, K3, M(52) );
- R( c, d, e, a, b, F3, K3, M(53) );
- R( b, c, d, e, a, F3, K3, M(54) );
- R( a, b, c, d, e, F3, K3, M(55) );
- R( e, a, b, c, d, F3, K3, M(56) );
- R( d, e, a, b, c, F3, K3, M(57) );
- R( c, d, e, a, b, F3, K3, M(58) );
- R( b, c, d, e, a, F3, K3, M(59) );
- R( a, b, c, d, e, F4, K4, M(60) );
- R( e, a, b, c, d, F4, K4, M(61) );
- R( d, e, a, b, c, F4, K4, M(62) );
- R( c, d, e, a, b, F4, K4, M(63) );
- R( b, c, d, e, a, F4, K4, M(64) );
- R( a, b, c, d, e, F4, K4, M(65) );
- R( e, a, b, c, d, F4, K4, M(66) );
- R( d, e, a, b, c, F4, K4, M(67) );
- R( c, d, e, a, b, F4, K4, M(68) );
- R( b, c, d, e, a, F4, K4, M(69) );
- R( a, b, c, d, e, F4, K4, M(70) );
- R( e, a, b, c, d, F4, K4, M(71) );
- R( d, e, a, b, c, F4, K4, M(72) );
- R( c, d, e, a, b, F4, K4, M(73) );
- R( b, c, d, e, a, F4, K4, M(74) );
- R( a, b, c, d, e, F4, K4, M(75) );
- R( e, a, b, c, d, F4, K4, M(76) );
- R( d, e, a, b, c, F4, K4, M(77) );
- R( c, d, e, a, b, F4, K4, M(78) );
- R( b, c, d, e, a, F4, K4, M(79) );
+ R( e, a, b, c, d, F1, K1, M( 0) );
+ R( d, e, a, b, c, F1, K1, M( 1) );
+ R( c, d, e, a, b, F1, K1, M( 2) );
+ R( b, c, d, e, a, F1, K1, M( 3) );
+ R( a, b, c, d, e, F2, K2, M( 4) );
+ R( e, a, b, c, d, F2, K2, M( 5) );
+ R( d, e, a, b, c, F2, K2, M( 6) );
+ R( c, d, e, a, b, F2, K2, M( 7) );
+ R( b, c, d, e, a, F2, K2, M( 8) );
+ R( a, b, c, d, e, F2, K2, M( 9) );
+ R( e, a, b, c, d, F2, K2, M(10) );
+ R( d, e, a, b, c, F2, K2, M(11) );
+ R( c, d, e, a, b, F2, K2, M(12) );
+ R( b, c, d, e, a, F2, K2, M(13) );
+ R( a, b, c, d, e, F2, K2, M(14) );
+ R( e, a, b, c, d, F2, K2, M(15) );
+ R( d, e, a, b, c, F2, K2, M( 0) );
+ R( c, d, e, a, b, F2, K2, M( 1) );
+ R( b, c, d, e, a, F2, K2, M( 2) );
+ R( a, b, c, d, e, F2, K2, M( 3) );
+ R( e, a, b, c, d, F2, K2, M( 4) );
+ R( d, e, a, b, c, F2, K2, M( 5) );
+ R( c, d, e, a, b, F2, K2, M( 6) );
+ R( b, c, d, e, a, F2, K2, M( 7) );
+ R( a, b, c, d, e, F3, K3, M( 8) );
+ R( e, a, b, c, d, F3, K3, M( 9) );
+ R( d, e, a, b, c, F3, K3, M(10) );
+ R( c, d, e, a, b, F3, K3, M(11) );
+ R( b, c, d, e, a, F3, K3, M(12) );
+ R( a, b, c, d, e, F3, K3, M(13) );
+ R( e, a, b, c, d, F3, K3, M(14) );
+ R( d, e, a, b, c, F3, K3, M(15) );
+ R( c, d, e, a, b, F3, K3, M( 0) );
+ R( b, c, d, e, a, F3, K3, M( 1) );
+ R( a, b, c, d, e, F3, K3, M( 2) );
+ R( e, a, b, c, d, F3, K3, M( 3) );
+ R( d, e, a, b, c, F3, K3, M( 4) );
+ R( c, d, e, a, b, F3, K3, M( 5) );
+ R( b, c, d, e, a, F3, K3, M( 6) );
+ R( a, b, c, d, e, F3, K3, M( 7) );
+ R( e, a, b, c, d, F3, K3, M( 8) );
+ R( d, e, a, b, c, F3, K3, M( 9) );
+ R( c, d, e, a, b, F3, K3, M(10) );
+ R( b, c, d, e, a, F3, K3, M(11) );
+ R( a, b, c, d, e, F4, K4, M(12) );
+ R( e, a, b, c, d, F4, K4, M(13) );
+ R( d, e, a, b, c, F4, K4, M(14) );
+ R( c, d, e, a, b, F4, K4, M(15) );
+ R( b, c, d, e, a, F4, K4, M( 0) );
+ R( a, b, c, d, e, F4, K4, M( 1) );
+ R( e, a, b, c, d, F4, K4, M( 2) );
+ R( d, e, a, b, c, F4, K4, M( 3) );
+ R( c, d, e, a, b, F4, K4, M( 4) );
+ R( b, c, d, e, a, F4, K4, M( 5) );
+ R( a, b, c, d, e, F4, K4, M( 6) );
+ R( e, a, b, c, d, F4, K4, M( 7) );
+ R( d, e, a, b, c, F4, K4, M( 8) );
+ R( c, d, e, a, b, F4, K4, M( 9) );
+ R( b, c, d, e, a, F4, K4, M(10) );
+ R( a, b, c, d, e, F4, K4, M(11) );
+ R( e, a, b, c, d, F4, K4, M(12) );
+ R( d, e, a, b, c, F4, K4, M(13) );
+ R( c, d, e, a, b, F4, K4, M(14) );
+ R( b, c, d, e, a, F4, K4, M(15) );
a = ctx->A += a;
b = ctx->B += b;
--
1.6.3.3
^ permalink raw reply related
* Re: How to stop sharing objects between repositories
From: Junio C Hamano @ 2009-08-16 19:16 UTC (permalink / raw)
To: Jeff King; +Cc: Johannes Schindelin, Jon Jensen, git
In-Reply-To: <20090816135703.GA31638@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
> Subject: [PATCH] docs: mention how to break alternates dependency
>
> A user who has created a repository dependency by using "git
> clone -s" does not necessarily know where to look to find
> out how to break that dependency. Let's mention it right
> under "-s", where they are most likely to find it.
>
> Signed-off-by: Jeff King <peff@peff.net>
> ---
> Documentation/git-clone.txt | 5 +++++
> 1 files changed, 5 insertions(+), 0 deletions(-)
>
> diff --git a/Documentation/git-clone.txt b/Documentation/git-clone.txt
> index b14de6c..87fa687 100644
> --- a/Documentation/git-clone.txt
> +++ b/Documentation/git-clone.txt
> @@ -72,6 +72,11 @@ These objects may be removed by normal git operations (such as 'git-commit')
> which automatically call `git gc --auto`. (See linkgit:git-gc[1].)
> If these objects are removed and were referenced by the cloned repository,
> then the cloned repository will become corrupt.
> ++
> +To break the dependency of the cloned repository to the source
> +repository, run `git repack -a` in the cloned repository, which will
> +create a new pack in that repository with all referenced objects,
> +including those in the source repository.
After reading this, two points come to my mind. They may or may not be
issues.
(1) Such a user does not necessarily know a casual "git repack -a" breaks
the dependency, defeating the -s option s/he deliberately used in
order to save disk space in the first place. Perhaps we can reword
this further to kill two penguins with a single stone?
Note that the pack resulting from running `git repack -a` in the
repository cloned with the `-s` option will include objects that
are borrowed from the source repository. It essentially breaks
the dependency created by cloning with the `-s` option by copying
the objects from the source repository. To keep borrowing from
the source repository to save disk space, do not use `repack -a`.
We should suggest an alternative immediately after this sentence,
e.g. "Instead, use `repack -l`" or something, but somebody should
check if it is a valid/viable alternative.
(2) IIRC, "git gc --auto" runs "repack -A". What is its effect with
respect to this dependency between object stores? I suspect it would
also break the dependency, but if so, is it a good thing? Perhaps
should we change it to use a version that keeps the dependency
instead?
^ permalink raw reply
* Re: git-svn bug report: %20 in http:// should translate to a space ' ' automatically
From: Daniel Stenberg @ 2009-08-16 18:13 UTC (permalink / raw)
To: Tony Finch; +Cc: Björn Steinbrink, Mike Smullin, Eric Wong, git
In-Reply-To: <alpine.LSU.2.00.0908152336240.449@hermes-2.csi.cam.ac.uk>
[-- Attachment #1: Type: TEXT/PLAIN, Size: 419 bytes --]
On Sat, 15 Aug 2009, Tony Finch wrote:
> On Sat, 15 Aug 2009, Björn Steinbrink wrote:
>>
>> 3) git svn clone -Tgoo "http://host/repo/path with spaces/foo/bar"
>>
>> Works.
>
> Spaces are not permitted in URLs so this should be treated as a syntax
> error.
libcurl OTOH doesn't verify the passed in data to be strict URLs but will
instead do its best to work with whatever is passed to it...
--
/ daniel.haxx.se
^ permalink raw reply
* GitHub linking, was Re: bbchop & Wikipedia's Bayesian search theory page
From: Johannes Schindelin @ 2009-08-16 17:18 UTC (permalink / raw)
To: git, Scott Chacon, Ealdwulf Wuffinga
In-Reply-To: <alpine.DEB.1.00.0908161907580.8306@pacific.mpi-cbg.de>
Hi,
On Sun, 16 Aug 2009, Johannes Schindelin 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.
Ah, never mind, it seems that they did not delete _this_ page (it would
have been the third I looked for this week which got deleted and made
extra hard to find a copy of).
The problem, really, is that the link on the bbchop GitHub site is wrong:
http://github.com/Ealdwulf/bbchop/tree/master
The issue is that the link incorrectly includes the closing parenthesis.
It should link to
http://en.wikipedia.org/wiki/Bayesian_search_theory
not
http://en.wikipedia.org/wiki/Bayesian_search_theory)
Scott, is it possible to fix that? Or is the README not magically made
from the README in the repository (which does not contain HTML markup)?
Ciao,
Dscho
^ permalink raw reply
* bbchop & Wikipedia's Bayesian search theory page
From: Johannes Schindelin @ 2009-08-16 17:13 UTC (permalink / raw)
To: git, Ealdwulf Wuffinga
Hi,
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.
Anybody know where I can find information about Bayesian search theory
that is not deleted by people envious of other people's brains?
Thanks,
Dscho
P.S.: yes, I am disappointed. "Wisdom of the crowds"? Not with this type
of human beings in control of articles other people wrote.
^ permalink raw reply
* Re: git http-push and MKCOL error (22/409)
From: Thomas Schlichter @ 2009-08-16 14:52 UTC (permalink / raw)
To: Tay Ray Chuan; +Cc: Junio C Hamano, Sean Davis, git
In-Reply-To: <be6fef0d0908160727r7dfa9b46l4d493e3954c21de3@mail.gmail.com>
Hi,
Am Sonntag 16 August 2009 16:27:40 schrieb Tay Ray Chuan:
> Interesting. Please do provide:
>
> -steps to reproduce,
> -your server's access log.
Unfortunately I cannot provide the server's access log. It is a server
provided by the German E-Mail provider web.de. It allows to save files via a
web-interface and via WebDAV.
Steps to reproduce:
1. locally set up a git archive:
mkdir dummy.git
cd dummy.git
git init --bare
2. Upload this directory to the server.
I did do this using KDE's dolphin via WebDAV.
3. Clone this remote repository:
git clone https://webdav.smartdrive.web.de/dummy.git my_dummy
4. Create a local commit:
cd my_dummy
touch dummy.c
git commit -a
5. Push this commit up to the remote repository:
git push origin master
The last step fails es explained. During bisecting git I was able to commit
several changes with versions before commit
5424bc557fc6414660830b470dd45774b8f5f281.
Kind regards,
Thomas Schlichter
P.S.: Maybe it is important that the server uses the secure https protocol,
therefore I set my username and password combination in my local ~/.netrc
file.
^ permalink raw reply
* Re: git http-push and MKCOL error (22/409)
From: Tay Ray Chuan @ 2009-08-16 14:27 UTC (permalink / raw)
To: Thomas Schlichter; +Cc: Junio C Hamano, Sean Davis, git
In-Reply-To: <200908161557.26962.thomas.schlichter@web.de>
Hi,
On Sun, Aug 16, 2009 at 9:57 PM, Thomas
Schlichter<thomas.schlichter@web.de> wrote:
> Current "master" and "next" trees also have this problem. But as git version
> 1.6.4 does not have this problem, I was able to bisect it down to commit:
>
> 5424bc557fc6414660830b470dd45774b8f5f281
> http*: add helper methods for fetching objects (loose)
Interesting. Please do provide:
-steps to reproduce,
-your server's access log.
--
Cheers,
Ray Chuan
^ permalink raw reply
* git http-push and MKCOL error (22/409)
From: Thomas Schlichter @ 2009-08-16 13:57 UTC (permalink / raw)
To: Tay Ray Chuan, Junio C Hamano; +Cc: Sean Davis, git
Hello,
I was using git version 1.6.4 and a remote WebDAV repository. But
unfortunately, git-http-push always returns following error:
schlicht@netbook:~/dummy$ git push
Fetching remote heads...
refs
refs/heads
refs/tags
refs/heads
refs/tags
updating 'refs/heads/master'
from 980385b1032efc0db665dff3ad54068f762af9aa
to 98fd7fb8f32843c1bb40bd195a2f1cd6cab0751d
sending 1 objects
MKCOL 98fd7fb8f32843c1bb40bd195a2f1cd6cab0751d failed, aborting (22/409)
Updating remote server info
error: failed to push some refs to
'https://webdav.smartdrive.web.de/dummy.git'
Current "master" and "next" trees also have this problem. But as git version
1.6.4 does not have this problem, I was able to bisect it down to commit:
5424bc557fc6414660830b470dd45774b8f5f281
http*: add helper methods for fetching objects (loose)
I can always reproduce this problem, so I am willing to test patches to fix
this regression.
Kind regards,
Thomas Schlichter
^ permalink raw reply
* Re: How to stop sharing objects between repositories
From: Jeff King @ 2009-08-16 13:57 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: Junio C Hamano, Jon Jensen, git
In-Reply-To: <alpine.DEB.1.00.0908161429590.8306@pacific.mpi-cbg.de>
On Sun, Aug 16, 2009 at 02:30:15PM +0200, Johannes Schindelin wrote:
> > I think it is the opposite; packing _without_ "-l" will create a pack
> > with objects from the alternate; using "-l" suppresses them. Running
> > "git repack -a" should do the trick, I believe (and you need the "-a" to
> > ensure that objects already packed in the repo are re-packed).
>
> Hmm. I really would like a documentation patch, then.
To what? From git-repack(1):
-l
Pass the --local option to git-pack-objects. See git-pack-objects(1).
>From git-pack-objects(1):
--local
This flag is similar to --incremental; instead of ignoring all
packed objects, it only ignores objects that are packed and/or not
in the local object store (i.e. borrowed from an alternate).
So I think the documentation is correct, but for the original poster, it
suffers from two problems:
1. The impact of "-l" in this case is a bit subtle and confusing.
I.e., it is not an obvious "use this flag to break the dependency
on an alternate", but rather "don't use this flag so that you won't
ignore non-local objects when packing". In fact, you don't need to
know about it at all
2. He has to know that "git repack" is the right place to look in the
first place (_and_ he has to figure out that "-l" is what he cares
about and follow the docs to git-pack-objects to find out what it
does).
So I think the best thing is a "by the way, here is how you break this
dependency" closer to where the concept of alternates is defined. I
guess the best part would be under the "-s" flag of git-clone, since
that is presumably how such a situation was created (unless the user is
savvy enough to edit .git/objects/info/alternates themselves, in which
case I think we have to assume they know what they are doing).
So maybe something like this would be enough:
-- >8 --
Subject: [PATCH] docs: mention how to break alternates dependency
A user who has created a repository dependency by using "git
clone -s" does not necessarily know where to look to find
out how to break that dependency. Let's mention it right
under "-s", where they are most likely to find it.
Signed-off-by: Jeff King <peff@peff.net>
---
Documentation/git-clone.txt | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/Documentation/git-clone.txt b/Documentation/git-clone.txt
index b14de6c..87fa687 100644
--- a/Documentation/git-clone.txt
+++ b/Documentation/git-clone.txt
@@ -72,6 +72,11 @@ These objects may be removed by normal git operations (such as 'git-commit')
which automatically call `git gc --auto`. (See linkgit:git-gc[1].)
If these objects are removed and were referenced by the cloned repository,
then the cloned repository will become corrupt.
++
+To break the dependency of the cloned repository to the source
+repository, run `git repack -a` in the cloned repository, which will
+create a new pack in that repository with all referenced objects,
+including those in the source repository.
--
1.6.4.257.gb8ef
^ permalink raw reply related
* Re: How to stop sharing objects between repositories
From: Johannes Schindelin @ 2009-08-16 13:57 UTC (permalink / raw)
To: Daniel Villeneuve; +Cc: Jeff King, Jon Jensen, git
In-Reply-To: <4A880F89.3060702@videotron.ca>
Hi,
On Sun, 16 Aug 2009, Daniel Villeneuve wrote:
> Johannes Schindelin wrote:
>
> > Hmm. I really would like a documentation patch, then.
>
> As another way to do it, I've used something along the lines from
> http://article.gmane.org/gmane.comp.version-control.git/62062
What does this have to do with my comment?
Besides, you are teaching general Git users how to use plumbing. That is
asking for pain, and the pain will come back to the Git developers, not to
you.
Ciao,
Dscho
^ permalink raw reply
* Re: How to stop sharing objects between repositories
From: Daniel Villeneuve @ 2009-08-16 13:54 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: Jeff King, Jon Jensen, git
In-Reply-To: <alpine.DEB.1.00.0908161429590.8306@pacific.mpi-cbg.de>
Johannes Schindelin wrote:
> Hmm. I really would like a documentation patch, then.
>
>
As another way to do it, I've used something along the lines from
http://article.gmane.org/gmane.comp.version-control.git/62062
namely:
<script>
gitdir=$(git rev-parse --git-dir)
[ -n "$gitdir" ] || die "cannot find Git directory"
cd "$gitdir"
a=objects/info/alternates
if [ -f $a ]; then
git rev-parse --all HEAD | git pack-objects --revs objects/pack/pack
rm $a
fi
</script>
I was not sure HEAD would be included via --all (e.g. HEAD pointing to a
dangling commit), so I added it explicitly.
The reverse operation (enabling sharing for a standalone repository) is
described here
http://git.or.cz/gitwiki/GitFaq#Howtoshareobjectsbetweenexistingrepositories.3F
--
Daniel
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox