* "secret key not available". "unable to sign the tag".
From: Gary Yang @ 2008-11-14 23:28 UTC (permalink / raw)
To: git
Hi,
I got errors and warnings when I used "git tag -s my-tag". It says, "secret key not available". "unable to sign the tag".
gpg: please see http://www.gnupg.org/faq.html for more information
gpg: skipped `Gary Yang <gyang@linux123.(none)>': secret key not available
gpg: signing failed: secret key not available
error: gpg failed to sign the tag
fatal: unable to sign the tag
I ran "gpg --gen-key" and generated keypair. But, still got the same error. Please help.
Thank,
Gary
^ permalink raw reply
* [EGIT PATCH 4/7 v3] Handle peeling of loose refs.
From: Robin Rosenberg @ 2008-11-14 23:24 UTC (permalink / raw)
To: spearce; +Cc: git, Robin Rosenberg
In-Reply-To: <1226705099-18066-3-git-send-email-robin.rosenberg@dewire.com>
For packed refs we got peeling automatically from packed-refs,
but for loose tags we have to follow the tags and get the leaf
object in order to comply with the documentation.
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
---
org.spearce.jgit/src/org/spearce/jgit/lib/Ref.java | 35 ++++++++++++++-----
.../src/org/spearce/jgit/lib/RefDatabase.java | 32 ++++++++++++++++--
.../src/org/spearce/jgit/lib/Repository.java | 13 +++++++
.../spearce/jgit/transport/BasePackConnection.java | 2 +-
.../spearce/jgit/transport/TransportAmazonS3.java | 2 +-
.../org/spearce/jgit/transport/TransportHttp.java | 2 +-
.../org/spearce/jgit/transport/TransportSftp.java | 2 +-
.../jgit/transport/WalkRemoteObjectDatabase.java | 2 +-
8 files changed, 73 insertions(+), 17 deletions(-)
diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/Ref.java b/org.spearce.jgit/src/org/spearce/jgit/lib/Ref.java
index 2f102af..0e98f46 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/lib/Ref.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/Ref.java
@@ -126,6 +126,8 @@ public boolean isPacked() {
private final String origName;
+ private final boolean peeled;
+
/**
* Create a new ref pairing.
*
@@ -140,10 +142,7 @@ public boolean isPacked() {
* does not exist yet.
*/
public Ref(final Storage st, final String origName, final String refName, final ObjectId id) {
- storage = st;
- this.origName = origName;
- name = refName;
- objectId = id;
+ this(st, origName, refName, id, null, false);
}
/**
@@ -158,7 +157,7 @@ public Ref(final Storage st, final String origName, final String refName, final
* does not exist yet.
*/
public Ref(final Storage st, final String refName, final ObjectId id) {
- this(st, refName, refName, id);
+ this(st, refName, refName, id, null, false);
}
/**
@@ -175,15 +174,18 @@ public Ref(final Storage st, final String refName, final ObjectId id) {
* does not exist yet.
* @param peel
* peeled value of the ref's tag. May be null if this is not a
- * tag or the peeled value is not known.
+ * tag or not yet peeled (in which case the next parameter should be null)
+ * @param peeled
+ * true if peel represents a the peeled value of the object
*/
public Ref(final Storage st, final String origName, final String refName, final ObjectId id,
- final ObjectId peel) {
+ final ObjectId peel, final boolean peeled) {
storage = st;
this.origName = origName;
name = refName;
objectId = id;
peeledObjectId = peel;
+ this.peeled = peeled;
}
/**
@@ -199,10 +201,12 @@ public Ref(final Storage st, final String origName, final String refName, final
* @param peel
* peeled value of the ref's tag. May be null if this is not a
* tag or the peeled value is not known.
+ * @param peeled
+ * true if peel represents a the peeled value of the object
*/
public Ref(final Storage st, final String refName, final ObjectId id,
- final ObjectId peel) {
- this(st, refName, refName, id, peel);
+ final ObjectId peel, boolean peeled) {
+ this(st, refName, refName, id, peel, peeled);
}
/**
@@ -238,10 +242,19 @@ public ObjectId getObjectId() {
* refer to an annotated tag.
*/
public ObjectId getPeeledObjectId() {
+ if (!peeled)
+ return null;
return peeledObjectId;
}
/**
+ * @return whether the Ref represents a peeled tag
+ */
+ public boolean isPeeled() {
+ return peeled;
+ }
+
+ /**
* How was this ref obtained?
* <p>
* The current storage model of a Ref may influence how the ref must be
@@ -259,4 +272,8 @@ public String toString() {
o = "(" + origName + ")";
return "Ref[" + o + name + "=" + ObjectId.toString(getObjectId()) + "]";
}
+
+ void setPeeledObjectId(final ObjectId id) {
+ peeledObjectId = id;
+ }
}
diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/RefDatabase.java b/org.spearce.jgit/src/org/spearce/jgit/lib/RefDatabase.java
index 5a1b85f..494aecb 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/lib/RefDatabase.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/RefDatabase.java
@@ -271,7 +271,8 @@ private void readOneLooseRef(final Map<String, Ref> avail,
return;
}
- ref = new Ref(Ref.Storage.LOOSE, origName, refName, id);
+ ref = new Ref(Ref.Storage.LOOSE, origName, refName, id, null, false); // unpeeled
+
looseRefs.put(ref.getName(), ref);
looseRefsMTime.put(ref.getName(), ent.lastModified());
avail.put(ref.getName(), ref);
@@ -288,6 +289,28 @@ private void readOneLooseRef(final Map<String, Ref> avail,
}
}
+ Ref peel(final Ref ref) {
+ if (ref.isPeeled())
+ return ref;
+ ObjectId peeled = null;
+ try {
+ Object target = db.mapObject(ref.getObjectId(), ref.getName());
+ while (target instanceof Tag) {
+ final Tag tag = (Tag)target;
+ peeled = tag.getObjId();
+ if (Constants.TYPE_TAG.equals(tag.getType()))
+ target = db.mapObject(tag.getObjId(), ref.getName());
+ else
+ break;
+ }
+ } catch (IOException e) {
+ // Ignore a read error. Â Callers will also get the same error
+ // if they try to use the result of getPeeledObjectId.
+ }
+ return new Ref(ref.getStorage(), ref.getName(), ref.getObjectId(), peeled, true);
+
+ }
+
private File fileForRef(final String name) {
if (name.startsWith(REFS_SLASH))
return new File(refsDir, name.substring(REFS_SLASH.length()));
@@ -350,7 +373,7 @@ private Ref readRefBasic(final String origName, final String name, final int dep
if (r == null)
return new Ref(Ref.Storage.LOOSE, origName, target, null);
if (!origName.equals(r.getName()))
- r = new Ref(Ref.Storage.LOOSE_PACKED, origName, r.getName(), r.getObjectId(), r.getPeeledObjectId());
+ r = new Ref(Ref.Storage.LOOSE_PACKED, origName, r.getName(), r.getObjectId(), r.getPeeledObjectId(), true);
return r;
}
@@ -364,6 +387,9 @@ private Ref readRefBasic(final String origName, final String name, final int dep
}
ref = new Ref(Ref.Storage.LOOSE, origName, name, id);
+
+ looseRefs.put(origName, ref);
+ ref = new Ref(Ref.Storage.LOOSE, origName, id);
looseRefs.put(name, ref);
looseRefsMTime.put(name, mtime);
return ref;
@@ -397,7 +423,7 @@ private void refreshPackedRefs() {
final ObjectId id = ObjectId.fromString(p.substring(1));
last = new Ref(Ref.Storage.PACKED, last.getName(), last
- .getName(), last.getObjectId(), id);
+ .getName(), last.getObjectId(), id, true);
newPackedRefs.put(last.getName(), last);
continue;
}
diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/Repository.java b/org.spearce.jgit/src/org/spearce/jgit/lib/Repository.java
index 26748e2..4d6e6fd 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/lib/Repository.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/Repository.java
@@ -939,6 +939,19 @@ public String getBranch() throws IOException {
}
/**
+ * Peel a possibly unpeeled ref and updates it. If the ref cannot be peeled
+ * the peeled id is set to {@link ObjectId#zeroId()}
+ *
+ * @param ref
+ * The ref to peel
+ * @return The same, an updated ref with peeled info or a new instance with
+ * more information
+ */
+ public Ref peel(final Ref ref) {
+ return refs.peel(ref);
+ }
+
+ /**
* @return true if HEAD points to a StGit patch.
*/
public boolean isStGitMode() {
diff --git a/org.spearce.jgit/src/org/spearce/jgit/transport/BasePackConnection.java b/org.spearce.jgit/src/org/spearce/jgit/transport/BasePackConnection.java
index e5fc040..e9df30e 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/transport/BasePackConnection.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/transport/BasePackConnection.java
@@ -176,7 +176,7 @@ private void readAdvertisedRefsImpl() throws IOException {
throw duplicateAdvertisement(name + "^{}");
avail.put(name, new Ref(Ref.Storage.NETWORK, name, prior
- .getObjectId(), id));
+ .getObjectId(), id, true));
} else {
final Ref prior;
prior = avail.put(name, new Ref(Ref.Storage.NETWORK, name, id));
diff --git a/org.spearce.jgit/src/org/spearce/jgit/transport/TransportAmazonS3.java b/org.spearce.jgit/src/org/spearce/jgit/transport/TransportAmazonS3.java
index f9df36d..9f1b516 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/transport/TransportAmazonS3.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/transport/TransportAmazonS3.java
@@ -300,7 +300,7 @@ private Ref readRef(final TreeMap<String, Ref> avail, final String rn)
if (r == null)
return null;
r = new Ref(r.getStorage(), rn, r.getObjectId(), r
- .getPeeledObjectId());
+ .getPeeledObjectId(), r.isPeeled());
avail.put(r.getName(), r);
return r;
}
diff --git a/org.spearce.jgit/src/org/spearce/jgit/transport/TransportHttp.java b/org.spearce.jgit/src/org/spearce/jgit/transport/TransportHttp.java
index 1357e58..fe4a437 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/transport/TransportHttp.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/transport/TransportHttp.java
@@ -237,7 +237,7 @@ FileStream open(final String path) throws IOException {
throw duplicateAdvertisement(name + "^{}");
avail.put(name, new Ref(Ref.Storage.NETWORK, name, prior
- .getObjectId(), id));
+ .getObjectId(), id, true));
} else {
final Ref prior = avail.put(name, new Ref(
Ref.Storage.NETWORK, name, id));
diff --git a/org.spearce.jgit/src/org/spearce/jgit/transport/TransportSftp.java b/org.spearce.jgit/src/org/spearce/jgit/transport/TransportSftp.java
index 78f4ad8..544e77c 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/transport/TransportSftp.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/transport/TransportSftp.java
@@ -428,7 +428,7 @@ private Ref readRef(final TreeMap<String, Ref> avail,
r = avail.get(p);
if (r != null) {
r = new Ref(loose(r), name, r.getObjectId(), r
- .getPeeledObjectId());
+ .getPeeledObjectId(), true);
avail.put(name, r);
}
return r;
diff --git a/org.spearce.jgit/src/org/spearce/jgit/transport/WalkRemoteObjectDatabase.java b/org.spearce.jgit/src/org/spearce/jgit/transport/WalkRemoteObjectDatabase.java
index 54dd581..a4f8961 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/transport/WalkRemoteObjectDatabase.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/transport/WalkRemoteObjectDatabase.java
@@ -438,7 +438,7 @@ private void readPackedRefsImpl(final Map<String, Ref> avail,
throw new TransportException("Peeled line before ref.");
final ObjectId id = ObjectId.fromString(line + 1);
last = new Ref(Ref.Storage.PACKED, last.getName(), last
- .getObjectId(), id);
+ .getObjectId(), id, true);
avail.put(last.getName(), last);
continue;
}
--
1.6.0.3.640.g6331a.dirty
^ permalink raw reply related
* [EGIT PATCH 5/7 v3] Add a method to get refs by object Id
From: Robin Rosenberg @ 2008-11-14 23:24 UTC (permalink / raw)
To: spearce; +Cc: git, Robin Rosenberg
In-Reply-To: <1226705099-18066-4-git-send-email-robin.rosenberg@dewire.com>
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
---
.../src/org/spearce/jgit/lib/Repository.java | 30 ++++++++++++++++++++
1 files changed, 30 insertions(+), 0 deletions(-)
diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/Repository.java b/org.spearce.jgit/src/org/spearce/jgit/lib/Repository.java
index 4d6e6fd..5088150 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/lib/Repository.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/Repository.java
@@ -47,10 +47,13 @@
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.Collections;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
+import java.util.Set;
import java.util.Vector;
import org.spearce.jgit.errors.IncorrectObjectTypeException;
@@ -952,6 +955,33 @@ public Ref peel(final Ref ref) {
}
/**
+ * @return a map with all objects referenced by a peeled ref.
+ */
+ public Map<AnyObjectId, Set<Ref>> getAllRefsByPeeledObjectId() {
+ Map<String, Ref> allRefs = getAllRefs();
+ Map<AnyObjectId, Set<Ref>> ret = new HashMap<AnyObjectId, Set<Ref>>(allRefs.size());
+ for (Ref ref : allRefs.values()) {
+ if (!ref.isPeeled())
+ ref = peel(ref);
+ AnyObjectId target = ref.getPeeledObjectId();
+ if (target == null)
+ target = ref.getObjectId();
+ // We assume most Sets here are singletons
+ Set<Ref> oset = ret.put(target, Collections.singleton(ref));
+ if (oset != null) {
+ // that was not the case (rare)
+ if (oset.size() == 1) {
+ // Was a read-only singleton, we must copy to a new Set
+ oset = new HashSet<Ref>(oset);
+ }
+ ret.put(target, oset);
+ oset.add(ref);
+ }
+ }
+ return ret;
+ }
+
+ /**
* @return true if HEAD points to a StGit patch.
*/
public boolean isStGitMode() {
--
1.6.0.3.640.g6331a.dirty
^ permalink raw reply related
* [EGIT PATCH 3/7 v3] Test the origName part of the key vs the ref itself
From: Robin Rosenberg @ 2008-11-14 23:24 UTC (permalink / raw)
To: spearce; +Cc: git, Robin Rosenberg
In-Reply-To: <1226705099-18066-2-git-send-email-robin.rosenberg@dewire.com>
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
---
.../tst/org/spearce/jgit/lib/RefUpdateTest.java | 10 ++++++++++
1 files changed, 10 insertions(+), 0 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 6e2cfa8..12f9ada 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
@@ -39,6 +39,8 @@
import java.io.File;
import java.io.IOException;
+import java.util.Map;
+import java.util.Map.Entry;
import org.spearce.jgit.lib.RefUpdate.Result;
@@ -127,4 +129,12 @@ public void testDeleteEmptyDirs() throws IOException {
private void assertExists(final boolean expected, final String name) {
assertEquals(expected, new File(db.getDirectory(), name).exists());
}
+
+ public void testRefKeySameAsOrigName() {
+ Map<String, Ref> allRefs = db.getAllRefs();
+ for (Entry<String, Ref> e : allRefs.entrySet()) {
+ assertEquals(e.getKey(), e.getValue().getOrigName());
+
+ }
+ }
}
--
1.6.0.3.640.g6331a.dirty
^ permalink raw reply related
* [EGIT PATCH 2/7 v3] Keep original ref name when reading refs
From: Robin Rosenberg @ 2008-11-14 23:24 UTC (permalink / raw)
To: spearce; +Cc: git, Robin Rosenberg
In-Reply-To: <1226705099-18066-1-git-send-email-robin.rosenberg@dewire.com>
We want to know the original name of refs, not just the target name.
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
---
org.spearce.jgit/src/org/spearce/jgit/lib/Ref.java | 63 +++++++++++++++++++-
.../src/org/spearce/jgit/lib/RefDatabase.java | 45 +++++++++-----
.../src/org/spearce/jgit/lib/RefUpdate.java | 14 ++---
3 files changed, 94 insertions(+), 28 deletions(-)
diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/Ref.java b/org.spearce.jgit/src/org/spearce/jgit/lib/Ref.java
index db94875..2f102af 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/lib/Ref.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/Ref.java
@@ -43,6 +43,11 @@
* A ref in Git is (more or less) a variable that holds a single object
* identifier. The object identifier can be any valid Git object (blob, tree,
* commit, annotated tag, ...).
+ * <p>
+ * The ref name has the attributes of the ref that was asked for as well as
+ * the ref it was resolved to for symbolic refs plus the object id it points
+ * to and (for tags) the peeled target object id, i.e. the tag resolved
+ * recursively until a non-tag object is referenced.
*/
public class Ref {
/** Location where a {@link Ref} is stored. */
@@ -119,19 +124,24 @@ public boolean isPacked() {
private ObjectId peeledObjectId;
+ private final String origName;
+
/**
* Create a new ref pairing.
*
* @param st
* method used to store this ref.
+ * @param origName
+ * The name used to resolve this ref
* @param refName
* name of this ref.
* @param id
* current value of the ref. May be null to indicate a ref that
* does not exist yet.
*/
- public Ref(final Storage st, final String refName, final ObjectId id) {
+ public Ref(final Storage st, final String origName, final String refName, final ObjectId id) {
storage = st;
+ this.origName = origName;
name = refName;
objectId = id;
}
@@ -146,19 +156,56 @@ public Ref(final Storage st, final String refName, final ObjectId id) {
* @param id
* current value of the ref. May be null to indicate a ref that
* does not exist yet.
+ */
+ public Ref(final Storage st, final String refName, final ObjectId id) {
+ this(st, refName, refName, id);
+ }
+
+ /**
+ * Create a new ref pairing.
+ *
+ * @param st
+ * method used to store this ref.
+ * @param origName
+ * The name used to resolve this ref
+ * @param refName
+ * name of this ref.
+ * @param id
+ * current value of the ref. May be null to indicate a ref that
+ * does not exist yet.
* @param peel
* peeled value of the ref's tag. May be null if this is not a
* tag or the peeled value is not known.
*/
- public Ref(final Storage st, final String refName, final ObjectId id,
+ public Ref(final Storage st, final String origName, final String refName, final ObjectId id,
final ObjectId peel) {
storage = st;
+ this.origName = origName;
name = refName;
objectId = id;
peeledObjectId = peel;
}
/**
+ * Create a new ref pairing.
+ *
+ * @param st
+ * method used to store this ref.
+ * @param refName
+ * name of this ref.
+ * @param id
+ * current value of the ref. May be null to indicate a ref that
+ * does not exist yet.
+ * @param peel
+ * peeled value of the ref's tag. May be null if this is not a
+ * tag or the peeled value is not known.
+ */
+ public Ref(final Storage st, final String refName, final ObjectId id,
+ final ObjectId peel) {
+ this(st, refName, refName, id, peel);
+ }
+
+ /**
* What this ref is called within the repository.
*
* @return name of this ref.
@@ -168,6 +215,13 @@ public String getName() {
}
/**
+ * @return the originally resolved name
+ */
+ public String getOrigName() {
+ return origName;
+ }
+
+ /**
* Cached value of this ref.
*
* @return the value of this ref at the last time we read it.
@@ -200,6 +254,9 @@ public Storage getStorage() {
}
public String toString() {
- return "Ref[" + name + "=" + ObjectId.toString(getObjectId()) + "]";
+ String o = "";
+ if (!origName.equals(name))
+ o = "(" + origName + ")";
+ return "Ref[" + o + name + "=" + ObjectId.toString(getObjectId()) + "]";
}
}
diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/RefDatabase.java b/org.spearce.jgit/src/org/spearce/jgit/lib/RefDatabase.java
index 5c1f060..5a1b85f 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/lib/RefDatabase.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/RefDatabase.java
@@ -51,6 +51,7 @@
import java.util.Map;
import org.spearce.jgit.errors.ObjectWritingException;
+import org.spearce.jgit.lib.Ref.Storage;
import org.spearce.jgit.util.FS;
import org.spearce.jgit.util.NB;
@@ -135,8 +136,8 @@ RefUpdate newUpdate(final String name) throws IOException {
return new RefUpdate(this, r, fileForRef(r.getName()));
}
- void stored(final String name, final ObjectId id, final long time) {
- looseRefs.put(name, new Ref(Ref.Storage.LOOSE, name, id));
+ void stored(final String origName, final String name, final ObjectId id, final long time) {
+ looseRefs.put(name, new Ref(Ref.Storage.LOOSE, origName, name, id));
looseRefsMTime.put(name, time);
setModified();
db.fireRefsMaybeChanged();
@@ -222,12 +223,12 @@ private void readLooseRefs(final Map<String, Ref> avail,
final String entName = ent.getName();
if (".".equals(entName) || "..".equals(entName))
continue;
- readOneLooseRef(avail, prefix + entName, ent);
+ readOneLooseRef(avail, prefix + entName, prefix + entName, ent);
}
}
private void readOneLooseRef(final Map<String, Ref> avail,
- final String refName, final File ent) {
+ final String origName, final String refName, final File ent) {
// Unchanged and cached? Don't read it again.
//
Ref ref = looseRefs.get(refName);
@@ -270,7 +271,7 @@ private void readOneLooseRef(final Map<String, Ref> avail,
return;
}
- ref = new Ref(Ref.Storage.LOOSE, refName, id);
+ ref = new Ref(Ref.Storage.LOOSE, origName, refName, id);
looseRefs.put(ref.getName(), ref);
looseRefsMTime.put(ref.getName(), ent.lastModified());
avail.put(ref.getName(), ref);
@@ -293,27 +294,35 @@ private File fileForRef(final String name) {
return new File(gitDir, name);
}
- private Ref readRefBasic(final String name, final int depth)
+ private Ref readRefBasic(final String name, final int depth) throws IOException {
+ return readRefBasic(name, name, depth);
+ }
+
+ private Ref readRefBasic(final String origName, final String name, final int depth)
throws IOException {
// Prefer loose ref to packed ref as the loose
// file can be more up-to-date than a packed one.
//
- Ref ref = looseRefs.get(name);
+ Ref ref = looseRefs.get(origName);
final File loose = fileForRef(name);
final long mtime = loose.lastModified();
if (ref != null) {
Long cachedlastModified = looseRefsMTime.get(name);
if (cachedlastModified != null && cachedlastModified == mtime)
return ref;
- looseRefs.remove(name);
- looseRefsMTime.remove(name);
+ looseRefs.remove(origName);
+ looseRefsMTime.remove(origName);
}
if (mtime == 0) {
// If last modified is 0 the file does not exist.
// Try packed cache.
//
- return packedRefs.get(name);
+ ref = packedRefs.get(name);
+ if (ref != null)
+ if (!ref.getOrigName().equals(origName))
+ ref = new Ref(Storage.LOOSE_PACKED, origName, name, ref.getObjectId());
+ return ref;
}
final String line;
@@ -324,7 +333,7 @@ private Ref readRefBasic(final String name, final int depth)
}
if (line == null || line.length() == 0)
- return new Ref(Ref.Storage.LOOSE, name, null);
+ return new Ref(Ref.Storage.LOOSE, origName, name, null);
if (line.startsWith("ref: ")) {
if (depth >= 5) {
@@ -333,12 +342,16 @@ private Ref readRefBasic(final String name, final int depth)
}
final String target = line.substring("ref: ".length());
- final Ref r = readRefBasic(target, depth + 1);
+ Ref r = readRefBasic(target, target, depth + 1);
Long cachedMtime = looseRefsMTime.get(name);
if (cachedMtime != null && cachedMtime != mtime)
setModified();
looseRefsMTime.put(name, mtime);
- return r != null ? r : new Ref(Ref.Storage.LOOSE, target, null);
+ if (r == null)
+ return new Ref(Ref.Storage.LOOSE, origName, target, null);
+ if (!origName.equals(r.getName()))
+ r = new Ref(Ref.Storage.LOOSE_PACKED, origName, r.getName(), r.getObjectId(), r.getPeeledObjectId());
+ return r;
}
setModified();
@@ -350,7 +363,7 @@ private Ref readRefBasic(final String name, final int depth)
throw new IOException("Not a ref: " + name + ": " + line);
}
- ref = new Ref(Ref.Storage.LOOSE, name, id);
+ ref = new Ref(Ref.Storage.LOOSE, origName, name, id);
looseRefs.put(name, ref);
looseRefsMTime.put(name, mtime);
return ref;
@@ -384,7 +397,7 @@ private void refreshPackedRefs() {
final ObjectId id = ObjectId.fromString(p.substring(1));
last = new Ref(Ref.Storage.PACKED, last.getName(), last
- .getObjectId(), id);
+ .getName(), last.getObjectId(), id);
newPackedRefs.put(last.getName(), last);
continue;
}
@@ -392,7 +405,7 @@ private void refreshPackedRefs() {
final int sp = p.indexOf(' ');
final ObjectId id = ObjectId.fromString(p.substring(0, sp));
final String name = new String(p.substring(sp + 1));
- last = new Ref(Ref.Storage.PACKED, name, id);
+ last = new Ref(Ref.Storage.PACKED, name, name, id);
newPackedRefs.put(last.getName(), last);
}
} finally {
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 86b44c5..235c2fd 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/lib/RefUpdate.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/RefUpdate.java
@@ -131,9 +131,6 @@
/** Repository the ref is stored in. */
private final RefDatabase db;
- /** Name of the ref. */
- private final String name;
-
/** Location of the loose file holding the value of this ref. */
private final File looseFile;
@@ -160,7 +157,6 @@
RefUpdate(final RefDatabase r, final Ref ref, final File f) {
db = r;
this.ref = ref;
- name = ref.getName();
oldValue = ref.getObjectId();
looseFile = f;
}
@@ -171,7 +167,7 @@ RefUpdate(final RefDatabase r, final Ref ref, final File f) {
* @return name of this ref.
*/
public String getName() {
- return name;
+ return ref.getName();
}
/**
@@ -349,9 +345,9 @@ public Result delete() throws IOException {
* @throws IOException
*/
public Result delete(final RevWalk walk) throws IOException {
- if (name.startsWith(Constants.R_HEADS)) {
+ if (getName().startsWith(Constants.R_HEADS)) {
final Ref head = db.readRef(Constants.HEAD);
- if (head != null && name.equals(head.getName()))
+ if (head != null && getName().equals(head.getName()))
return Result.REJECTED_CURRENT_BRANCH;
}
@@ -373,7 +369,7 @@ private Result updateImpl(final RevWalk walk, final Store store)
if (!lock.lock())
return Result.LOCK_FAILURE;
try {
- oldValue = db.idOf(name);
+ oldValue = db.idOf(getName());
if (oldValue == null)
return store.store(lock, Result.NEW);
@@ -428,7 +424,7 @@ else if (status == Result.NEW)
getName());
if (!lock.commit())
return Result.LOCK_FAILURE;
- db.stored(name, newValue, lock.getCommitLastModified());
+ db.stored(this.ref.getOrigName(), ref.getName(), newValue, lock.getCommitLastModified());
return status;
}
--
1.6.0.3.640.g6331a.dirty
^ permalink raw reply related
* [EGIT PATCH 1/7 v3] Add constant for "refs/"
From: Robin Rosenberg @ 2008-11-14 23:24 UTC (permalink / raw)
To: spearce; +Cc: git, Robin Rosenberg
In-Reply-To: <20081111183248.GR2932@spearce.org>
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
---
.../src/org/spearce/jgit/lib/Constants.java | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
Here's an update after considering Shawn's comments. 1,2,3 are just reordered.
No 4 and 5 are changed. For patch no 6 and 7 use the ones from the previous
batch.
-- robin
diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/Constants.java b/org.spearce.jgit/src/org/spearce/jgit/lib/Constants.java
index f316881..9613d07 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/lib/Constants.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/Constants.java
@@ -216,6 +216,9 @@
/** Prefix for tag refs */
public static final String R_TAGS = "refs/tags/";
+ /** Prefix for any ref */
+ public static final String R_REFS = "refs/";
+
/** Logs folder name */
public static final String LOGS = "logs";
--
1.6.0.3.640.g6331a.dirty
^ permalink raw reply related
* Re: git to libgit2 code relicensing
From: Linus Torvalds @ 2008-11-14 23:13 UTC (permalink / raw)
To: Andreas Ericsson; +Cc: Git Mailing List
In-Reply-To: <491DE6CC.6060201@op5.se>
On Fri, 14 Nov 2008, Andreas Ericsson wrote:
>
> The license decided for libgit2 is "GPL with gcc exception".
What's the exact language?
I'm likely ok with GPLv2 + libgcc-like exception, but I'd like to see the
exact one. I haven't followed the discussions much..
Linus
^ permalink raw reply
* Re: hosting git on a nfs
From: Linus Torvalds @ 2008-11-14 23:10 UTC (permalink / raw)
To: Junio C Hamano
Cc: Brandon Casey, James Pickens, Bruce Fields, Git Mailing List
In-Reply-To: <7v63mq9iao.fsf@gitster.siamese.dyndns.org>
On Fri, 14 Nov 2008, Junio C Hamano wrote:
>
> If you have 1000 files in a single directory, do you still want 2 threads
> following the "1/500" rule, or they would compete reading the same
> directory and using a single thread is better off?
Well, first off, the "single directory" thing is really a Linux kernel
deficiency, and it's entirely possible that it doesn't even exist on other
systems. Linux has a very special directory cache (dcache) model that is
pretty unique - it's part of why cached 'lstat()' calls are so cheap on
Linux - but it is also part of the reason for why we serialize lookups
when we do miss in the cache (*).
Secondly, anybody who has a thousand tracked files in a single directory
can damn well blame themselves for being stupid. So I don't think it's a
case that is worth worrying too much about. Git will slow down for that
kind of situation for other reasons (ie a lot of the tree pruning
optimization won't work for projects that have large flat directories).
So i wouldn't worry about it. That said, with the second patch, we default
to having people enable this explicitly, so it's something that people can
decide on their own.
Linus
(*) That said - the Linux dcache consistency is just _one_ reason why we
serialize lookups. I would not be in the least surprised if other OS's
have the exact same issue. I'd love to fix it in Linux, but quiet
honestly, it has never actually come up before now, and we've literally
worked on multi-threading the _cached_ case, not the uncached one.
^ permalink raw reply
* Re: git to libgit2 code relicensing
From: Andreas Ericsson @ 2008-11-14 22:57 UTC (permalink / raw)
To: sverre; +Cc: Martin Koegler, Git Mailing List
In-Reply-To: <bd6139dc0811141346w194ae4c5m9f7b0fdb106108fc@mail.gmail.com>
Sverre Rabbelier wrote:
> On Fri, Nov 14, 2008 at 22:33, Martin Koegler
> <mkoegler@auto.tuwien.ac.at> wrote:
>> On Fri, Nov 14, 2008 at 09:59:56PM +0100, Andreas Ericsson wrote:
>>> I've put everyone who "owns" more than 500 lines of code
>>> on the bcc list, figuring your permission is important
>>> but that you don't want the hundreds (well, one can hope)
>>> of emails from people saying "ok". The list of major owners
>>> was generated with "git showners *.c" in a worktree from
>>> the next branch of git.git.
>> I don't think, that your way for relicensing is bullet proof:
>>
>> I consider many of my GIT patches as derived work from other parts of
>> GIT, even if git blame is stating me as author. I can gurantee you,
>> that I comply with the "Developer's Certificate of Origin 1.1" point
>> b, as its based on code out of git.git. But I can't tell you, from
>> which files I reused code anymore.
>>
>> Probably other people did the same.
>>
>> Your method is ignoring such derived code.
>
> Perhaps git stats can be of assistance here, it can summarize how much
> lines a person changed (per file, or in total), that should be a
> better metric (at least for code reused from within git.git, ofcourse
> GPL-ed code taken from somewhere else is not covered).
>
That will almost certainly not be a problem. I'm working on reading stuff
into git-specific structures and then updating those structures. I doubt
any such code exists outside git. If it does, it's more likely derived
from git than the other way around.
It's also worth noting that I'm aiming for the really low-level core
stuff at first. It would be beneficial to get such simple things going
as updating the index (with an entire file) and then creating a commit
from that index. Such a thing would definitely be enough for (very basic)
IDE integration, and then we can build further on that but utilizing
developers from other projects than the git developer community.
--
Andreas Ericsson andreas.ericsson@op5.se
OP5 AB www.op5.se
Tel: +46 8-230225 Fax: +46 8-230231
^ permalink raw reply
* Re: git to libgit2 code relicensing
From: Andreas Ericsson @ 2008-11-14 22:56 UTC (permalink / raw)
To: Martin Koegler; +Cc: Git Mailing List
In-Reply-To: <20081114213352.GA12134@auto.tuwien.ac.at>
Martin Koegler wrote:
> On Fri, Nov 14, 2008 at 09:59:56PM +0100, Andreas Ericsson wrote:
>> I've put everyone who "owns" more than 500 lines of code
>> on the bcc list, figuring your permission is important
>> but that you don't want the hundreds (well, one can hope)
>> of emails from people saying "ok". The list of major owners
>> was generated with "git showners *.c" in a worktree from
>> the next branch of git.git.
>
> I don't think, that your way for relicensing is bullet proof:
>
I know that it's not, which is why I'm doing research to take care
of the pieces interesting for libgit2 that could possibly have
been derived from elsewhere. Reading and filling structures specific
to git is something I'd be surprised if they originated outside of
git though.
> I consider many of my GIT patches as derived work from other parts of
> GIT, even if git blame is stating me as author. I can gurantee you,
> that I comply with the "Developer's Certificate of Origin 1.1" point
> b, as its based on code out of git.git.
Right, but if we can never re-use code from git.git, libgit will never
fly. It's unfortunately as simple as that. So perhaps we're left with
the option of writing a GPL'd library or just go hang.
> But I can't tell you, from which files I reused code anymore.
>
To a certain point, "git blame" can.
> Probably other people did the same.
>
> Your method is ignoring such derived code.
>
Right. If possible, I'd still like an OK from you though. If nothing
else, it'll make it possible to re-use code that originated from
someone else and that you changed, assuming that "someone else" also
agree to relicensing their code. With 100% of the authors agreeing
to that, we could have a libified git flying in a matter of months
instead of never.
It's unfortunate if the letter of the law pertaining to a particular
license should prevent the copyright owners from doing whatever
they want with the code, but perhaps that's the world we live in.
--
Andreas Ericsson andreas.ericsson@op5.se
OP5 AB www.op5.se
Tel: +46 8-230225 Fax: +46 8-230231
^ permalink raw reply
* Re: reflog delete results in reflog show strangeness?
From: Bob Hiestand @ 2008-11-14 22:44 UTC (permalink / raw)
To: git
In-Reply-To: <cc29171c0811141433t43d27c5gb57ca11d2ddb67cb@mail.gmail.com>
On Fri, Nov 14, 2008 at 4:33 PM, Bob Hiestand <bob.hiestand@gmail.com> wrote:
> I see a possible bug in the output of 'git reflog show' after using
> 'git reflog delete'. Simple example:
>
> $ git init
> $ git commit --allow-empty -m 'root'
> $ git commit --allow-empty -m 'good'
> $ git commit --allow-empty -m 'bad'
> $ git reflog
> 996ca67... HEAD@{0}: commit: bad
> e431a20... HEAD@{1}: commit: good
> 992dd88... HEAD@{2}: commit (initial): root
>
> $ git reset HEAD^
> $ git reflog
> e431a20... HEAD@{0}: HEAD^: updating HEAD
> 996ca67... HEAD@{1}: commit: bad
> e431a20... HEAD@{2}: commit: good
> 992dd88... HEAD@{3}: commit (initial): root
>
> $ git reflog delete HEAD@{1}
> $ git reflog
> e431a20... HEAD@{0}: HEAD^: updating HEAD
> 996ca67... HEAD@{1}: commit: good
> 992dd88... HEAD@{2}: commit (initial): root
>
> In this listing, please note that, after the delete, the commit SHA
> shown as HEAD@{1} is that of the deleted reference (the bad commit)
> and does not match the reflog message, which has the expected value.
Sorry, forgot to add this:
$ git describe
v1.6.0.4-969-g58a38d0
^ permalink raw reply
* reflog delete results in reflog show strangeness?
From: Bob Hiestand @ 2008-11-14 22:33 UTC (permalink / raw)
To: git
I see a possible bug in the output of 'git reflog show' after using
'git reflog delete'. Simple example:
$ git init
$ git commit --allow-empty -m 'root'
$ git commit --allow-empty -m 'good'
$ git commit --allow-empty -m 'bad'
$ git reflog
996ca67... HEAD@{0}: commit: bad
e431a20... HEAD@{1}: commit: good
992dd88... HEAD@{2}: commit (initial): root
$ git reset HEAD^
$ git reflog
e431a20... HEAD@{0}: HEAD^: updating HEAD
996ca67... HEAD@{1}: commit: bad
e431a20... HEAD@{2}: commit: good
992dd88... HEAD@{3}: commit (initial): root
$ git reflog delete HEAD@{1}
$ git reflog
e431a20... HEAD@{0}: HEAD^: updating HEAD
996ca67... HEAD@{1}: commit: good
992dd88... HEAD@{2}: commit (initial): root
In this listing, please note that, after the delete, the commit SHA
shown as HEAD@{1} is that of the deleted reference (the bad commit)
and does not match the reflog message, which has the expected value.
Thank you,
bob
^ permalink raw reply
* Re: [PATCH v2 03/11] gitweb: separate heads and remotes list in summary view
From: Giuseppe Bilotta @ 2008-11-14 22:01 UTC (permalink / raw)
To: Jakub Narebski; +Cc: git, Petr Baudis, Junio C Hamano
In-Reply-To: <200811142104.35019.jnareb@gmail.com>
2008/11/14 Jakub Narebski <jnareb@gmail.com>:
> Dnia czwartek 13. listopada 2008 23:49, Giuseppe Bilotta napisał:
>
> Very nice patch. Now that I have read it, I don't think it should be
> squashed with previous patch (well, again that is only a suggestion).
See reply in previous patch. Sometimes it's hard to tell what's the
best patch-splitting strategy ...
> Barring one issue (see below) its conciseness shows that gitweb has
> quite good internal API.
Most definitely. I find that working on gitweb is almost pleasurable ;-)
[I mean, it's still Perl, which is not Tcl but not Ruby either 8-P]
>> my @forklist;
>> my ($check_forks) = gitweb_check_feature('forks');
>>
>> @@ -4535,6 +4537,13 @@ sub git_summary {
>> $cgi->a({-href => href(action=>"heads")}, "..."));
>> }
>>
>> + if (@remotelist) {
>> + git_print_header_div('remotes');
>> + git_heads_body(\@remotelist, $head, 0, 15,
>> + $#remotelist <= 15 ? undef :
>> + $cgi->a({-href => href(action=>"heads")}, "..."));
>> + }
>> +
>
> The only problem is that link leads to list of _all_ heads (best case),
> or list to local branches (worst case, but I don't think gitweb does
> it), instead of only list of remotes refs (remote-tracking branches),
> as one would think. Perhaps we could use 'h' (hash), or 'opt (extra
> options) parameter for this action, or just add 'remotes' action?
Adding a 'remotes' section (and corresponding action, too) is what is
done by subsequent patches. It's quite obvious, I think, that the
patch sequence follows _very_ closely the order in which I
implemented/tested features. It might make more sense to move some of
them earlier, but then such earlier patches would only make sense
because of the ones that follow ... this is why I decided to keep the
sequence as is.
>> 1.5.6.5
>
> P.S. Not uptodate (git version 1.6.0.4)? Just kidding...
Yeah, I know, given that I work with 'next' gitweb, I could as well
just upgrade the system git to the same version 8-P
Instead, I'm just relying on stock Debian stuff, which obviously,
being in freeze now, is not updating unstable either 8-P
--
Giuseppe "Oblomov" Bilotta
^ permalink raw reply
* Re: [PATCH v2 02/11] gitweb: git_get_heads_list accepts an optional list of refs.
From: Giuseppe Bilotta @ 2008-11-14 21:52 UTC (permalink / raw)
To: Jakub Narebski; +Cc: git, Petr Baudis, Junio C Hamano
In-Reply-To: <200811141948.57785.jnareb@gmail.com>
On Fri, Nov 14, 2008 at 7:48 PM, Jakub Narebski <jnareb@gmail.com> wrote:
> Dnia czwartek 13. listopada 2008 23:49, Giuseppe Bilotta napisał:
>
>> git_get_heads_list(limit, dir1, dir2, ...) can now be used to retrieve
>> refs/dir1, refs/dir2 etc. Defaults to ('heads') or ('heads', 'remotes')
>> depending on the remote_heads option.
>
> Minor nit: I think it would be better to use the same terminology in
> commit message as in code, i.e. 'class1' instead of 'dir1', or perhaps
> 'ref_class1' if it would be better.
Uhm, ref/ref_class1 reads horrible, but sticking with a uniform
terminology is a good point. I adjusted the commit message
consequently.
> This is only a suggestion, but perhaps this patch could be squashed
> with a later one?
Or with the previous one, since as you remark it's a generalization of
the previous.
>> my @headslist;
>>
>> - my ($remote_heads) = gitweb_check_feature('remote_heads');
>> -
>> open my $fd, '-|', git_cmd(), 'for-each-ref',
>> ($limit ? '--count='.($limit+1) : ()), '--sort=-committerdate',
>> '--format=%(objectname) %(refname) %(subject)%00%(committer)',
>> - 'refs/heads', ( $remote_heads ? 'refs/remotes' : '')
>> + @refs
>> or return;
>> while (my $line = <$fd>) {
>> my %ref_item;
>
> So this is a bit of generalization of (part of) previous patch,
> isn't it?
Precisely. I must say I had problems finding the proper splitting
point for some of these patches, because they had a very organic
evolution, but at the same time sqashing them together would give too
large changesets at once. You'll find that this is not the only patch
that makes the most sense only after seeing what comes later.
--
Giuseppe "Oblomov" Bilotta
^ permalink raw reply
* Re: git to libgit2 code relicensing
From: Sverre Rabbelier @ 2008-11-14 21:46 UTC (permalink / raw)
To: Martin Koegler; +Cc: Andreas Ericsson, Git Mailing List
In-Reply-To: <20081114213352.GA12134@auto.tuwien.ac.at>
On Fri, Nov 14, 2008 at 22:33, Martin Koegler
<mkoegler@auto.tuwien.ac.at> wrote:
> On Fri, Nov 14, 2008 at 09:59:56PM +0100, Andreas Ericsson wrote:
>> I've put everyone who "owns" more than 500 lines of code
>> on the bcc list, figuring your permission is important
>> but that you don't want the hundreds (well, one can hope)
>> of emails from people saying "ok". The list of major owners
>> was generated with "git showners *.c" in a worktree from
>> the next branch of git.git.
>
> I don't think, that your way for relicensing is bullet proof:
>
> I consider many of my GIT patches as derived work from other parts of
> GIT, even if git blame is stating me as author. I can gurantee you,
> that I comply with the "Developer's Certificate of Origin 1.1" point
> b, as its based on code out of git.git. But I can't tell you, from
> which files I reused code anymore.
>
> Probably other people did the same.
>
> Your method is ignoring such derived code.
Perhaps git stats can be of assistance here, it can summarize how much
lines a person changed (per file, or in total), that should be a
better metric (at least for code reused from within git.git, ofcourse
GPL-ed code taken from somewhere else is not covered).
--
Cheers,
Sverre Rabbelier
^ permalink raw reply
* Re: [PATCH v2 01/11] gitweb: introduce remote_heads feature
From: Giuseppe Bilotta @ 2008-11-14 21:44 UTC (permalink / raw)
To: Jakub Narebski; +Cc: git, Petr Baudis, Junio C Hamano
In-Reply-To: <200811141915.17680.jnareb@gmail.com>
On Fri, Nov 14, 2008 at 7:15 PM, Jakub Narebski <jnareb@gmail.com> wrote:
> On Thu, 13 Nov 2008, Giuseppe Bilotta wrote:
>
>> With this feature enabled, remotes are retrieved (and displayed)
>> when getting (and displaying) the heads list.
>
> I think it would be good idea to add in commit message idea _why_
> such feature would be useful, for example
>
> This is useful if you want to use git-instaweb to examine the state
> of repository, influding remote-tracking branches, or a repository
> is fork of other repository, and remote-tracking branches are used
> to see what commits this fork has in addition to those from forked
> (main) repository.
>
> Or something like that.
Ah yes, many commit messages in this patchset are way too terse. A
side effect of this being something like the first patchset I ever
prepared. I'll rework them to something more sensible.
> It would be also in my opinion a good idea to modify git-instaweb.sh
> (I guess better in separate commit) to make it make use of this new
> feature... unless it does it already, doesn't it?
It doesn't, but it's something I have considered. I'll work on it (on
a separate patch)
>> + # Make gitweb show remotes too in the heads list
>
> I'm not native engish speaker, but shouldn't instead of "remotes too"
> be "also remotes" or "remotes also"?
No idea, I guess we'll wait for a native english speaker opinion 8-D
--
Giuseppe "Oblomov" Bilotta
^ permalink raw reply
* Re: git to libgit2 code relicensing
From: Martin Koegler @ 2008-11-14 21:33 UTC (permalink / raw)
To: Andreas Ericsson; +Cc: Git Mailing List
In-Reply-To: <491DE6CC.6060201@op5.se>
On Fri, Nov 14, 2008 at 09:59:56PM +0100, Andreas Ericsson wrote:
> I've put everyone who "owns" more than 500 lines of code
> on the bcc list, figuring your permission is important
> but that you don't want the hundreds (well, one can hope)
> of emails from people saying "ok". The list of major owners
> was generated with "git showners *.c" in a worktree from
> the next branch of git.git.
I don't think, that your way for relicensing is bullet proof:
I consider many of my GIT patches as derived work from other parts of
GIT, even if git blame is stating me as author. I can gurantee you,
that I comply with the "Developer's Certificate of Origin 1.1" point
b, as its based on code out of git.git. But I can't tell you, from
which files I reused code anymore.
Probably other people did the same.
Your method is ignoring such derived code.
mfg Martin Kögler
^ permalink raw reply
* Re: [PATCH v2 09/11] gitweb: git_is_head_detached() function
From: Nanako Shiraishi @ 2008-11-14 21:17 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Giuseppe Bilotta, git, Jakub Narebski, Petr Baudis
In-Reply-To: <7vk5b69p87.fsf@gitster.siamese.dyndns.org>
Quoting Junio C Hamano <gitster@pobox.com>:
> "Giuseppe Bilotta" <giuseppe.bilotta@gmail.com> writes:
>
>> I have been thinking about making this detached HEAD thing an
>> additional option, but it _really_ seemed like overkill.
>
> I agree that it does not make much sense to make this feature an option.
> Detaching the HEAD in the repository itself is an enough clue from the
> user to the code that the user wants to trigger the feature.
Shouldn't the feature to show remote tracking branches also be unconditionally active, then?
--
Nanako Shiraishi
http://ivory.ap.teacup.com/nanako3/
^ permalink raw reply
* git to libgit2 code relicensing
From: Andreas Ericsson @ 2008-11-14 20:59 UTC (permalink / raw)
To: Git Mailing List
[-- Attachment #1: Type: text/plain, Size: 1180 bytes --]
I've been working quite a lot on git -> libgit2 code moving,
but the licensing stuff is a bit depressing, as I can't know
if the work I'm doing is for nothing or not.
The license decided for libgit2 is "GPL with gcc exception".
Those who are OK with relicensing their contributions under
that license for the purpose of libgit2, can you please say
so?
I'm planning on writing a tool for this that will have "ok",
"not ok" and "ask-each-patch" as options.
The list of people whose position I know is rather short.
Please correct me if you're on it and would like not to be.
Junio C. Hamano ask
Johannes Schindelin ok
Shawn O. Pearce ok
Andreas Ericsson ok
Pierre Habouzit ok
Brian Gernhardt ok
I've put everyone who "owns" more than 500 lines of code
on the bcc list, figuring your permission is important
but that you don't want the hundreds (well, one can hope)
of emails from people saying "ok". The list of major owners
was generated with "git showners *.c" in a worktree from
the next branch of git.git.
--
Andreas Ericsson andreas.ericsson@op5.se
OP5 AB www.op5.se
Tel: +46 8-230225 Fax: +46 8-230231
[-- Attachment #2: git-showners --]
[-- Type: text/plain, Size: 673 bytes --]
#!/bin/sh
test "$#" -gt 0 || { echo "Usage: $0 <file>"; exit 1; }
combined=t
while test "$#" -gt 0
do
case "$1" in
-c|--combined)
combined=t
;;
-i|--individual)
combined=
;;
--)
shift
break
;;
*)
break
;;
esac
shift
done
sort_enumerate ()
{
sed -e 's/[^(]*(\([^0-9]*\).*/\1/' -e 's/[\t ]*$//' \
| sort | uniq -c | sort -nr
}
show_owners ()
{
for f in "$@"; do
test -d "$f" && { show_owners "$f"/*; continue; }
git blame -C -C -M "$f"
done
}
if test "$combined" = t; then
echo "$@"
show_owners "$@" | sort_enumerate
else
echo "Showing one-at-a-time ownership"
for f in "$@"; do
echo "$f"
show_owners "$f" | sort_enumerate
done
fi
^ permalink raw reply
* Re: git compile error on AIX
From: Junio C Hamano @ 2008-11-14 20:21 UTC (permalink / raw)
To: Dinakar; +Cc: git
In-Reply-To: <1226691918584-1499908.post@n2.nabble.com>
Dinakar <desas2@gmail.com> writes:
> /usr/bin/getopt: Not a recognized flag: d
> Usage: install [-c DirectoryA] [-f DirectoryB] [-i] [-m] [-M Mode] [-O
> Owner]
> [-G Group] [-S] [-n DirectoryC] [-o] [-s] File [DirectoryX
> ...]
Your "install" program is telling you that it does not understand 'd'
option ("install -d" to create a directory, I presume).
> gmake[1]: *** [boilerplates.made] Error 2
> gmake: *** [all] Error 2
> I would appreciate, if you could help me to resolve this issue.
An obvious solution would be to get a better install.
You seem to be using gmake, so perhaps you already have ginstall and can
use it like "gmake INSTALL=ginstall"?
^ permalink raw reply
* Re: hosting git on a nfs
From: Junio C Hamano @ 2008-11-14 20:14 UTC (permalink / raw)
To: Linus Torvalds
Cc: Brandon Casey, James Pickens, Bruce Fields, Git Mailing List
In-Reply-To: <alpine.LFD.2.00.0811141109580.3468@nehalem.linux-foundation.org>
Linus Torvalds <torvalds@linux-foundation.org> writes:
> I also think the thread cost was wrong: it did
>
> threads = index->cache_nr / 100;
>
> to give a first-order "how many threads do we want", but the thread
> startup is likely to be higher than 100 lstat calls, so we probably want
> fewer threads than that. It doesn't much matter for something like the
> Linux kernel, where there are so many files that we'll end up maxing out
> the threads anyway, but for smaller projects, I suspect a thread cost of
> "one thread per 500 files" is more reasonable. You almost certainly don't
> want to thread anything at all for fewer than a few hundred files.
If you have 1000 files in a single directory, do you still want 2 threads
following the "1/500" rule, or they would compete reading the same
directory and using a single thread is better off?
^ permalink raw reply
* Re: [PATCH] sha1_file: make sure correct error is propagated
From: Francis Galiegue @ 2008-11-14 20:08 UTC (permalink / raw)
To: Andreas Ericsson; +Cc: Junio C Hamano, Sam Vilain, git
In-Reply-To: <491DD671.8070801@op5.se>
Le Friday 14 November 2008 20:50:09 Andreas Ericsson, vous avez écrit :
> Francis Galiegue wrote:
> > Le Friday 14 November 2008 20:05:19 Junio C Hamano, vous avez écrit :
> > [...]
> >
> >>> fd = mkstemp(buffer);
> >>> - if (fd < 0 && dirlen && (errno != EPERM)) {
> >>> + if (fd < 0 && dirlen && (errno != EACCESS)) {
> >>
> >> Is this accepting the two as equivalents???
> >> --
> >> 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
> >
> > Well, looking at mkdir(2), it says:
> >
> > EPERM The file system containing pathname does not support the
> > creation of directories.
> >
> > Hmm, err... git would fail at an earlier point anyway, wouldn't it? Even
> > git init would fail there.
>
> Not necessarily. .git could be mounted erroneously from via a networked
> filesystem but without write permissions.
In which case EACCESS would be returned anyway. There is quite a difference
between EACCESS (Permission denied) and EPERM (operation not permitted).
Basically, my understanding is that mkdir() will only return EPERM if the
underlying filesystem can not even CREATE directories on the filesystem. So,
unless you are doing very bizarre things with your git repository, I cannot
see how you can even trigger an EPERM unless you asked for it.
> Yes, other things would fail
> then too, but both EPERM and EACCESS are valid and possible return codes.
And so is ENOSPC, and so is EIO, and so is... It's endless. I think focus
should be made on the most common ones, and EACCESS _is_ such one. Others
just aren't.
This is why I suggested replacing EPERM with EACCESS in the first place:
EACCESS is by far the most common error code you will get (even root will get
that on a read-only filesystem, not EPERM).
--
fge
^ permalink raw reply
* Re: Can git ignore parts of files
From: Elijah Newren @ 2008-11-14 20:06 UTC (permalink / raw)
To: Alan; +Cc: git
In-Reply-To: <1226690252.6176.9.camel@rotwang.fnordora.org>
On Fri, Nov 14, 2008 at 12:17 PM, Alan <alan@clueserver.org> wrote:
> I have kind of an odd problem that is causing me grief in git. I figure
> someone has a good solution here. (Or not, they will soon.)
>
> I have a couple of kernel .config files that are checked into git. They
> are used to test kernel configurations for the nightly builds where I
> work.
>
> We have a bunch of kernel developers working on drivers. When they add
> a new driver, they add in the options in the test file to make it
> compile in the test builds.
>
> The problem is that the kernel config file has a timestamp at the top of
> the file that is generated by "make oldconfig" or "make config". Other
> than removing the timestamp each time manually, is there a way to get
> git to ignore the timestamp on a merge?
>
> What happens is that the authors submit the changes on a branch in most
> cases. Sometimes they have a version of that file that is quite out of
> date. When I go to merge, that one file gives me grief 95% of the time.
>
> Is there an easy way around this? Am I approaching the problem wrong?
> Is there a better way to do this?
Someone wrote a special merge algorithm to handle similar conflicts in
tracked ChangeLog files (see
http://www.mail-archive.com/bug-gnulib@gnu.org/msg09183.html).
Perhaps you could write a similar merge algorithm and use it?
Hope that helps,
Elijah
^ permalink raw reply
* Re: [PATCH v2 03/11] gitweb: separate heads and remotes list in summary view
From: Jakub Narebski @ 2008-11-14 20:04 UTC (permalink / raw)
To: Giuseppe Bilotta; +Cc: git, Petr Baudis, Junio C Hamano
In-Reply-To: <1226616555-24503-4-git-send-email-giuseppe.bilotta@gmail.com>
Dnia czwartek 13. listopada 2008 23:49, Giuseppe Bilotta napisał:
Very nice patch. Now that I have read it, I don't think it should be
squashed with previous patch (well, again that is only a suggestion).
Barring one issue (see below) its conciseness shows that gitweb has
quite good internal API.
> Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
> ---
> gitweb/gitweb.perl | 11 ++++++++++-
> 1 files changed, 10 insertions(+), 1 deletions(-)
>
> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
> index d7c97a3..ab29aec 100755
> --- a/gitweb/gitweb.perl
> +++ b/gitweb/gitweb.perl
> @@ -4449,6 +4449,7 @@ sub git_summary {
> my %co = parse_commit("HEAD");
> my %cd = %co ? parse_date($co{'committer_epoch'}, $co{'committer_tz'}) : ();
> my $head = $co{'id'};
> + my ($remote_heads) = gitweb_check_feature('remote_heads');
>
> my $owner = git_get_project_owner($project);
>
> @@ -4456,7 +4457,8 @@ sub git_summary {
> # These get_*_list functions return one more to allow us to see if
> # there are more ...
> my @taglist = git_get_tags_list(16);
> - my @headlist = git_get_heads_list(16);
> + my @headlist = git_get_heads_list(16, 'heads');
> + my @remotelist = $remote_heads ? git_get_heads_list(16, 'remotes') : ();
Nice.
> my @forklist;
> my ($check_forks) = gitweb_check_feature('forks');
>
> @@ -4535,6 +4537,13 @@ sub git_summary {
> $cgi->a({-href => href(action=>"heads")}, "..."));
> }
>
> + if (@remotelist) {
> + git_print_header_div('remotes');
> + git_heads_body(\@remotelist, $head, 0, 15,
> + $#remotelist <= 15 ? undef :
> + $cgi->a({-href => href(action=>"heads")}, "..."));
> + }
> +
The only problem is that link leads to list of _all_ heads (best case),
or list to local branches (worst case, but I don't think gitweb does
it), instead of only list of remotes refs (remote-tracking branches),
as one would think. Perhaps we could use 'h' (hash), or 'opt (extra
options) parameter for this action, or just add 'remotes' action?
> if (@forklist) {
> git_print_header_div('forks');
> git_project_list_body(\@forklist, 'age', 0, 15,
> --
> 1.5.6.5
P.S. Not uptodate (git version 1.6.0.4)? Just kidding...
--
Jakub Narebski
Poland
^ permalink raw reply
* Re: Can git ignore parts of files
From: Alan @ 2008-11-14 19:58 UTC (permalink / raw)
To: Francis Galiegue; +Cc: git
In-Reply-To: <200811142033.51019.fg@one2team.net>
On Fri, 2008-11-14 at 20:33 +0100, Francis Galiegue wrote:
> Le Friday 14 November 2008 20:17:32 Alan, vous avez écrit :
> > I have kind of an odd problem that is causing me grief in git. I figure
> > someone has a good solution here. (Or not, they will soon.)
> >
> > I have a couple of kernel .config files that are checked into git. They
> > are used to test kernel configurations for the nightly builds where I
> > work.
> >
> > We have a bunch of kernel developers working on drivers. When they add
> > a new driver, they add in the options in the test file to make it
> > compile in the test builds.
> >
> > The problem is that the kernel config file has a timestamp at the top of
> > the file that is generated by "make oldconfig" or "make config". Other
> > than removing the timestamp each time manually, is there a way to get
> > git to ignore the timestamp on a merge?
> >
> > What happens is that the authors submit the changes on a branch in most
> > cases. Sometimes they have a version of that file that is quite out of
> > date. When I go to merge, that one file gives me grief 95% of the time.
> >
> > Is there an easy way around this? Am I approaching the problem wrong?
> > Is there a better way to do this?
> >
>
> Do they ever touch to the kernel core? You say that they are developing
> drivers, they basically use core kernel interfaces but not modify them right?
>
> For quite a few years now, the kernel build system has allowed one to build
> drivers out of the kernel tree (but _using_ the kernel tree) fairly easily.
> Why not go this route? You won't have any conflict problems anymore, _and_
> you can maintain (and update) your kernel tree regularly.
Because these will go into core at some later date. (I work for Intel.)
^ 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