* Re: [PATCH] Add a commit.signoff configuration variable to always use --signoff.
From: Jan Krüger @ 2008-12-27 19:15 UTC (permalink / raw)
To: Adeodato Simó; +Cc: git, gitster
In-Reply-To: <20081227184001.GA31893@chistera.yi.org>
Hi,
On Sat, 27 Dec 2008 19:40:01 +0100
"Adeodato Simó" <dato@net.com.org.es> wrote:
> > I think it might be a good idea to allow overriding the config
> > variable in the other direction, i.e. a --no-signoff option to
> > commit. [...]
>
> Good catch.
>
> --no-signoff exists already, so maybe git-rebase should just use it?
Oh, yeah, I didn't notice the option mechanism worked this way and the
options got parsed after processing the config variables. I guess
rebase and rebase--interactive should use it, then, and perhaps there
are other commands that should that I just don't know about (a grep
across all commands implemented in shell script didn't find anything
else, though).
-Jan
^ permalink raw reply
* Re: [PATCH] Add a commit.signoff configuration variable to always use --signoff.
From: Adeodato Simó @ 2008-12-27 18:40 UTC (permalink / raw)
To: Jan Krüger; +Cc: git, gitster
In-Reply-To: <20081227190819.7257932a@neuron>
* Jan Krüger [Sat, 27 Dec 2008 19:08:19 +0100]:
> I think it might be a good idea to allow overriding the config variable
> in the other direction, i.e. a --no-signoff option to commit. Otherwise,
> for example, rebase would have no way of suppressing the S-o-b lines in
> rebased commits (and you might want to not automatically sign off
> commits you rebase).
Good catch.
--no-signoff exists already, so maybe git-rebase should just use it?
--
Adeodato Simó dato at net.com.org.es
Debian Developer adeodato at debian.org
Man is certainly stark mad; he cannot make a flea, yet he makes gods by the
dozens.
-- Michel de Montaigne
^ permalink raw reply
* [PATCH v2] git-shortlog.txt: improve documentation about .mailmap files
From: Adeodato Simó @ 2008-12-27 18:23 UTC (permalink / raw)
To: git, gitster; +Cc: Adeodato Simó
In-Reply-To: <20081227182140.GA28946@chistera.yi.org>
The previous .mailmap example made it seem like .mailmap files are only
useful for commits with a wrong address for an author, when they are about
fixing the real name. Explained this better in the text, and replaced the
existing example with a new one that hopefully makes things clearer.
Signed-off-by: Adeodato Simó <dato@net.com.org.es>
---
Documentation/git-shortlog.txt | 40 +++++++++++++++++++++++++++++++++-------
1 files changed, 33 insertions(+), 7 deletions(-)
diff --git a/Documentation/git-shortlog.txt b/Documentation/git-shortlog.txt
index 7ccf31c..4a76b7f 100644
--- a/Documentation/git-shortlog.txt
+++ b/Documentation/git-shortlog.txt
@@ -48,15 +48,41 @@ OPTIONS
FILES
-----
-If the file `.mailmap` exists, it will be used for mapping author
-email addresses to a real author name. One mapping per line, first
-the author name followed by the email address enclosed by
-'<' and '>'. Use hash '#' for comments. Example:
+If a file `.mailmap` exists in the toplevel directory of the repository,
+it is used to map author email addresses to a canonical real name. This
+can be used to coalesce together commits by the same person where their
+name was spelled differently (whether with the same email address or
+not).
+
+Each line in the file consists, in this order, of the canonical real name
+of an author, whitespace, and an email address (enclosed by '<' and '>')
+to map to the name. Use hash '#' for comments, either on their own line,
+or after the email address.
+
+A canonical name may appear in more than one line, associated with
+different email addresses, but it doesn't make sense for a given address
+to appear more than once (if that happens, the latest line in which it
+appears will take effect).
+
+So, for example, if your history contains commits by two authors, Jane
+and Joe, whose names appear in the repository under several forms:
+
+------------
+Joe Developer <joe@example.com>
+Joe R. Developer <joe@example.com>
+Jane Doe <jane@example.com>
+Jane Doe <jane@laptop.(none)>
+Jane D. <jane@desktop.(none)>
+------------
+
+Then, supposing Joe wants his middle name initial used, and Jane prefers
+her family name fully spelled out, a proper `.mailmap` file would be:
------------
-# Keep alphabetized
-Adam Morrow <adam@localhost.localdomain>
-Eve Jones <eve@laptop.(none)>
+# Note how we don't need an entry for <jane@laptop.(none)>, because the
+# real name of that author is correct already, and coalesced directly.
+Jane Doe <jane@desktop.(none)>
+Joe R. Developer <joe@random.com>
------------
Author
--
1.6.1.307.g07803
^ permalink raw reply related
* Re: [PATCH] git-shortlog.txt: improve documentation about .mailmap files
From: Adeodato Simó @ 2008-12-27 18:21 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <7viqp5et48.fsf@gitster.siamese.dyndns.org>
* Junio C Hamano [Sat, 27 Dec 2008 03:48:39 -0800]:
> Adeodato Simó <dato@net.com.org.es> writes:
> > The previous .mailmap example made it seem like .mailmap files are only
> > useful for commits with a wrong address for an author, when they are about
> > fixing the real name. Explained this better in the text, and replaced the
> > existing example with a new one that hopefully makes things clearer.
> Thanks.
Thanks for your review!
> > -If the file `.mailmap` exists, it will be used for mapping author
> > -email addresses to a real author name. One mapping per line, first
> > -the author name followed by the email address enclosed by
> > -'<' and '>'. Use hash '#' for comments. Example:
> > +If a file `.mailmap` exists in the toplevel directory of the repository,
> > +it will be used for mapping author email addresses to a canonical real
> > +name. This can be used to coalesce together commits by the same person
> > +where their name was spelled differently (whether with the same email
> > +address or not).
> We didn't stress "the toplevel" earlier, partly because it is obvious that
> the file cannot be anything but project-tree wide (as opposed to being per
> subdirectory, similar to .gitignore and .gitattributes). I guess it would
> not hurt to be explicit, even though it feels slightly silly.
Hm. I'd prefer to keep it in if you don't mind much.
> "..., it is used to map author email addresses to..." would flow easier.
Changed.
> > +The format of the file is one mapping per line, first the desired author
> > +name followed by the email address enclosed by '<' and '>'. Use hash '#'
> > +for comments.
> You already introduced the term "a canonical real name" in the earlier
> description. It would be easier to read if you stick to it and say "Each
> line consists of the canonical real name of an author, whitespaces, and an
> email address, enclosed by '<' and '>', to map to the name".
Changed.
> Can a hash '#' character be anywhere on a line? E.g. how is an entry like
> this processed?
> Jane Doe <jane@desktop.(none)> # early mistake...
It is processed correctly. Good suggestion to have it documented. I did:
Use hash '#' for comments, either on their own line, or after the
email address.
> > +... For example, if your history contains commits by these
> > +committers:
> I think you meant "authors", not "committers".
Ok.
> > +------------
> > +Author: Joe Developer <joe@random.com>
> > +Author: Joe R. Developer <joe@random.com>
> > +Author: Jane Doe <jane@the-does.name>
> > +Author: Jane Doe <jane@laptop.(none)>
> > +Author: Jane D. <jane@desktop.(none)>
> > +------------
> I'd suggest dropping "Author: ". You said you are listing people.
And ok.
> Isn't random.com a real domain (the same goes for the-does.name)? It
> would be preferrable to use addresses from .example (or .xz) top-level
> domain.
I wanted to use a real TLD to clearly convey that these were for real
addresses and not misconfigured ones. How about "example.com"? (This is
used in other Documentation files.)
> Clarify that there are actually two people in the list above, and explain
> that they are one Joe with two spellings who prefers to be referred to
> with his middle initial, and one Jane with three spellings who prefers to
> show the family name fully spelled out. Do not force your readers guess
> which spelling is preferred for each person in the example. It would make
> it easier for them to understand the example you will give them next and
> to agree that the mailmap is "proper".
Good point. As always, what it's obvious to the writer may not be to the
reader. Thanks.
I also added a sentence mentioning that names can appear more than once,
but addresses can't.
Can you take another look? (Amended patch coming.)
--
Adeodato Simó dato at net.com.org.es
Debian Developer adeodato at debian.org
- You look beaten.
- I just caught Tara laughing with another man.
- Are you sure they weren't just... kissing or something?
- No, they were laughing.
-- Denny Crane and Alan Shore
^ permalink raw reply
* Re: [PATCH] Add a commit.signoff configuration variable to always use --signoff.
From: Jan Krüger @ 2008-12-27 18:08 UTC (permalink / raw)
To: Adeodato Simó; +Cc: git, gitster
In-Reply-To: <1230296219-16408-1-git-send-email-dato@net.com.org.es>
Hi,
On Fri, 26 Dec 2008 13:56:59 +0100
"Adeodato Simó" <dato@net.com.org.es> wrote:
> > Has there even been talk of a commit.signoff configuration variable
> > to always add a S-o-b line? This could allow to enable it on a
> > per-project basis, which would be cool.
>
> Well, it seemed easy enough to do, so I went ahead. Comments would be
> welcome.
I think it might be a good idea to allow overriding the config variable
in the other direction, i.e. a --no-signoff option to commit. Otherwise,
for example, rebase would have no way of suppressing the S-o-b lines in
rebased commits (and you might want to not automatically sign off
commits you rebase).
-Jan
^ permalink raw reply
* Re: Questions about repo and git submodule
From: Shawn O. Pearce @ 2008-12-27 17:45 UTC (permalink / raw)
To: Emily Ren; +Cc: Git Mailinglist
In-Reply-To: <856bfe0e0812242228o6a428702i296dc87c76cf9dba@mail.gmail.com>
Emily Ren <lingyan.ren@gmail.com> wrote:
> Thank you for your guide ! I've created git repository with submodules
> with a simple script successfully.
>
> Now I have another question, since my android repo will always sync
> up from android.git.kernel.org, my git repository needs to be updated
> accordingly. Is there a tool I can use to sync up from repo to git
> repositoy ?
I think this discussion has moved to the repo-discuss list:
https://groups.google.com/group/repo-discuss/browse_thread/thread/2fa368ed7cac5d79
--
Shawn.
^ permalink raw reply
* [JGIT PATCH 11/23 v2] Rewrite WindowCache to use a hash table
From: Shawn O. Pearce @ 2008-12-27 17:32 UTC (permalink / raw)
To: Robin Rosenberg; +Cc: git
In-Reply-To: <200812271430.06052.robin.rosenberg.lists@dewire.com>
This shaved 10s off my linux-2.6 "jgit rev-list --objects" test.
We're also getting slightly better cache hit ratios, approaching
95% during commit access and 80% during tree access on the same
repository. Its a significant win.
The cache is also a bit better about memory usage. We now make
sure the byte[] or ByteBuffer handle is cleared out of the soft
reference when we push the reference into the queue manually. A
small change, but it makes a marked difference with the overall
JVM memory usage.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
---
Robin Rosenberg <robin.rosenberg.lists@dewire.com> wrote:
> > -/**
> > - * The WindowCache manages reusable <code>Windows</code> and inflaters used by
> > - * the other windowed file access classes.
> > - */
> > -public class WindowCache {
> > +class WindowCache {
>
> This breaks the Eclipse plugin which want to call WindowCache.reconfigure. Package level
> class can also have javadocs. Even though we do not require it, I still thinks it's a good idea. Not
> sure how useful that one was.
Dammit, good catch. I was working on this in the context of only
having the JGit code in my workspace, so I missed the impact on
the Eclipse plugin, and possibly on the NetBeans one as well.
Corrected patch follows.
.../src/org/spearce/jgit/lib/ByteWindow.java | 10 +-
.../src/org/spearce/jgit/lib/WindowCache.java | 317 ++++++++++++--------
.../src/org/spearce/jgit/lib/WindowedFile.java | 2 +-
3 files changed, 198 insertions(+), 131 deletions(-)
diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/ByteWindow.java b/org.spearce.jgit/src/org/spearce/jgit/lib/ByteWindow.java
index 1f6beb8..8d37de7 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/lib/ByteWindow.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/ByteWindow.java
@@ -56,14 +56,20 @@
* type of object reference used to manage the window data.
*/
abstract class ByteWindow<T> extends SoftReference<T> {
+ boolean sizeActive = true;
+
+ ByteWindow<?> chainNext;
+
+ ByteWindow<?> lruPrev;
+
+ ByteWindow<?> lruNext;
+
final WindowedFile provider;
final int id;
final int size;
- int lastAccessed;
-
final long start;
final long end;
diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/WindowCache.java b/org.spearce.jgit/src/org/spearce/jgit/lib/WindowCache.java
index f617845..e71ca73 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/lib/WindowCache.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/WindowCache.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2007, Robin Rosenberg <robin.rosenberg@dewire.com>
+ * Copyright (C) 2008, Google Inc.
* Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>
*
* All rights reserved.
@@ -68,23 +68,51 @@ private static final int bits(int newSize) {
static final ReferenceQueue<?> clearedWindowQueue;
- private static ByteWindow[] windows;
+ private static ByteWindow[] cache;
- private static int openWindowCount;
+ private static ByteWindow lruHead;
+
+ private static ByteWindow lruTail;
private static int openByteCount;
- private static int accessClock;
+ private static int hits;
+
+ private static int reqs;
+
+ private static int opens;
+
+ private static int closes;
static {
maxByteCount = 10 * MB;
windowSizeShift = bits(8 * KB);
windowSize = 1 << windowSizeShift;
mmap = false;
- windows = new ByteWindow[maxByteCount / windowSize];
+ cache = new ByteWindow[cacheTableSize()];
clearedWindowQueue = new ReferenceQueue<Object>();
}
+ static synchronized String statString() {
+ int maxChain = 0, tot = 0;
+ for (ByteWindow<?> e : cache) {
+ int n = 0;
+ for (; e != null; e = e.chainNext) {
+ n++;
+ tot++;
+ }
+ maxChain = Math.max(maxChain, n);
+ }
+ return "WindowCache[ hits: " + (hits * 100 / reqs) + "%"
+ + "; windows: " + tot + " maxChain: " + maxChain + "; kb:"
+ + (openByteCount / KB) + "; cache: " + cache.length + " fds: "
+ + (opens - closes) + "," + opens + "," + closes + " ]";
+ }
+
+ private static int cacheTableSize() {
+ return 5 * (maxByteCount / windowSize) / 2;
+ }
+
/**
* Modify the configuration of the window cache.
* <p>
@@ -135,27 +163,36 @@ private static synchronized void reconfigureImpl(final int packedGitLimit,
// We have to throw away every window we have. None
// of them are suitable for the new configuration.
//
- for (int i = 0; i < openWindowCount; i++) {
- final ByteWindow win = windows[i];
- if (--win.provider.openCount == 0)
- win.provider.cacheClose();
- windows[i] = null;
+ for (ByteWindow<?> e : cache) {
+ for (; e != null; e = e.chainNext)
+ clear(e);
+ }
+ runClearedWindowQueue();
+ cache = new ByteWindow[cacheTableSize()];
+
+ } else {
+ if (prune) {
+ // We should decrease our memory usage.
+ //
+ releaseMemory();
+ runClearedWindowQueue();
}
- windows = new ByteWindow[maxByteCount / windowSize];
- openWindowCount = 0;
- openByteCount = 0;
- } else if (prune) {
- // Our memory limit was decreased so we should try
- // to drop windows to ensure we meet the new lower
- // limit we were just given.
- //
- final int wincnt = maxByteCount / windowSize;
- releaseMemory(wincnt, null, 0, 0);
- if (wincnt != windows.length) {
- final ByteWindow[] n = new ByteWindow[wincnt];
- System.arraycopy(windows, 0, n, 0, openWindowCount);
- windows = n;
+ if (cache.length != cacheTableSize()) {
+ // The cache table should be resized.
+ // Rehash every entry.
+ //
+ final ByteWindow[] priorTable = cache;
+
+ cache = new ByteWindow[cacheTableSize()];
+ for (ByteWindow<?> e : priorTable) {
+ for (ByteWindow<?> n; e != null; e = n) {
+ n = e.chainNext;
+ final int idx = hash(e.provider, e.id);
+ e.chainNext = cache[idx];
+ cache[idx] = e;
+ }
+ }
}
}
}
@@ -178,19 +215,27 @@ private static synchronized void reconfigureImpl(final int packedGitLimit,
*/
public static synchronized final void get(final WindowCursor curs,
final WindowedFile wp, final long position) throws IOException {
+ reqs++;
final int id = (int) (position >> windowSizeShift);
- int idx = binarySearch(wp, id);
- if (0 <= idx) {
- final ByteWindow<?> w = windows[idx];
- if ((curs.handle = w.get()) != null) {
- w.lastAccessed = ++accessClock;
- curs.window = w;
- return;
+ final int idx = hash(wp, id);
+ for (ByteWindow<?> e = cache[idx]; e != null; e = e.chainNext) {
+ if (e.provider == wp && e.id == id) {
+ if ((curs.handle = e.get()) != null) {
+ curs.window = e;
+ makeMostRecent(e);
+ hits++;
+ return;
+ }
+
+ clear(e);
+ break;
}
}
- if (++wp.openCount == 1) {
+ if (wp.openCount == 0) {
try {
+ opens++;
+ wp.openCount = 1;
wp.cacheOpen();
} catch (IOException ioe) {
wp.openCount = 0;
@@ -201,106 +246,55 @@ public static synchronized final void get(final WindowCursor curs,
} catch (Error ioe) {
wp.openCount = 0;
throw ioe;
+ } finally {
+ wp.openCount--;
}
// The cacheOpen may have mapped the window we are trying to
// map ourselves. Retrying the search ensures that does not
// happen to us.
//
- idx = binarySearch(wp, id);
- if (0 <= idx) {
- final ByteWindow<?> w = windows[idx];
- if ((curs.handle = w.get()) != null) {
- w.lastAccessed = ++accessClock;
- curs.window = w;
- return;
+ for (ByteWindow<?> e = cache[idx]; e != null; e = e.chainNext) {
+ if (e.provider == wp && e.id == id) {
+ if ((curs.handle = e.get()) != null) {
+ curs.window = e;
+ makeMostRecent(e);
+ return;
+ }
+
+ clear(e);
+ break;
}
}
}
- idx = -(idx + 1);
- final int wSz = windowSize(wp, id);
- idx = releaseMemory(windows.length, wp, idx, wSz);
-
- if (idx < 0)
- idx = 0;
- final int toMove = openWindowCount - idx;
- if (toMove > 0)
- System.arraycopy(windows, idx, windows, idx + 1, toMove);
- wp.loadWindow(curs, id, id << windowSizeShift, wSz);
- windows[idx] = curs.window;
- openWindowCount++;
- openByteCount += curs.window.size;
+ final int wsz = windowSize(wp, id);
+ wp.openCount++;
+ openByteCount += wsz;
+ releaseMemory();
+ runClearedWindowQueue();
+
+ wp.loadWindow(curs, id, id << windowSizeShift, wsz);
+ final ByteWindow<?> e = curs.window;
+ e.chainNext = cache[idx];
+ cache[idx] = e;
+ insertLRU(e);
}
- private static int releaseMemory(final int maxWindowCount,
- final WindowedFile willRead, int insertionIndex, final int willAdd) {
- for (;;) {
- final ByteWindow<?> w = (ByteWindow<?>) clearedWindowQueue.poll();
- if (w == null)
- break;
- final int oldest = binarySearch(w.provider, w.id);
- if (oldest < 0 || windows[oldest] != w)
- continue; // Must have been evicted by our other controls.
-
- final WindowedFile p = w.provider;
- if (--p.openCount == 0 && p != willRead)
- p.cacheClose();
-
- openByteCount -= w.size;
- final int toMove = openWindowCount - oldest - 1;
- if (toMove > 0)
- System.arraycopy(windows, oldest + 1, windows, oldest, toMove);
- windows[--openWindowCount] = null;
- if (oldest < insertionIndex)
- insertionIndex--;
- }
-
- while (openWindowCount >= maxWindowCount
- || (openWindowCount > 0 && openByteCount + willAdd > maxByteCount)) {
- int oldest = 0;
- for (int k = openWindowCount - 1; k > 0; k--) {
- if (windows[k].lastAccessed < windows[oldest].lastAccessed)
- oldest = k;
- }
-
- final ByteWindow w = windows[oldest];
- final WindowedFile p = w.provider;
- if (--p.openCount == 0 && p != willRead)
- p.cacheClose();
-
- openByteCount -= w.size;
- final int toMove = openWindowCount - oldest - 1;
- if (toMove > 0)
- System.arraycopy(windows, oldest + 1, windows, oldest, toMove);
- windows[--openWindowCount] = null;
- w.enqueue();
- if (oldest < insertionIndex)
- insertionIndex--;
+ private static void makeMostRecent(ByteWindow<?> e) {
+ if (lruHead != e) {
+ unlinkLRU(e);
+ insertLRU(e);
}
-
- return insertionIndex;
}
- private static final int binarySearch(final WindowedFile sprov,
- final int sid) {
- if (openWindowCount == 0)
- return -1;
- final int shc = sprov.hash;
- int high = openWindowCount;
- int low = 0;
- do {
- final int mid = (low + high) / 2;
- final ByteWindow mw = windows[mid];
- if (mw.provider == sprov && mw.id == sid)
- return mid;
- final int mhc = mw.provider.hash;
- if (mhc < shc || (shc == mhc && mw.id < sid))
- low = mid + 1;
- else
- high = mid;
- } while (low < high);
- return -(low + 1);
+ private static void releaseMemory() {
+ ByteWindow<?> e = lruTail;
+ while (openByteCount > maxByteCount && e != null) {
+ final ByteWindow<?> p = e.lruPrev;
+ clear(e);
+ e = p;
+ }
}
/**
@@ -316,22 +310,89 @@ private static final int binarySearch(final WindowedFile sprov,
* cache.
*/
public static synchronized final void purge(final WindowedFile wp) {
- int d = 0;
- for (int s = 0; s < openWindowCount; s++) {
- final ByteWindow win = windows[s];
- if (win.provider != wp)
- windows[d++] = win;
- else
- openByteCount -= win.size;
+ for (ByteWindow e : cache) {
+ for (; e != null; e = e.chainNext) {
+ if (e.provider == wp)
+ clear(e);
+ }
+ }
+ runClearedWindowQueue();
+ }
+
+ private static void runClearedWindowQueue() {
+ ByteWindow<?> e;
+ while ((e = (ByteWindow) clearedWindowQueue.poll()) != null) {
+ unlinkSize(e);
+ unlinkLRU(e);
+ unlinkCache(e);
+ e.chainNext = null;
+ e.lruNext = null;
+ e.lruPrev = null;
}
- openWindowCount = d;
+ }
+
+ private static void clear(final ByteWindow<?> e) {
+ unlinkSize(e);
+ e.clear();
+ e.enqueue();
+ }
- if (wp.openCount > 0) {
- wp.openCount = 0;
- wp.cacheClose();
+ private static void unlinkSize(final ByteWindow<?> e) {
+ if (e.sizeActive) {
+ if (--e.provider.openCount == 0) {
+ closes++;
+ e.provider.cacheClose();
+ }
+ openByteCount -= e.size;
+ e.sizeActive = false;
}
}
+ private static void unlinkCache(final ByteWindow dead) {
+ final int idx = hash(dead.provider, dead.id);
+ ByteWindow<?> e = cache[idx], p = null, n;
+ for (; e != null; p = e, e = n) {
+ n = e.chainNext;
+ if (e == dead) {
+ if (p == null)
+ cache[idx] = n;
+ else
+ p.chainNext = n;
+ break;
+ }
+ }
+ }
+
+ private static void unlinkLRU(final ByteWindow e) {
+ final ByteWindow<?> prev = e.lruPrev;
+ final ByteWindow<?> next = e.lruNext;
+
+ if (prev != null)
+ prev.lruNext = next;
+ else
+ lruHead = next;
+
+ if (next != null)
+ next.lruPrev = prev;
+ else
+ lruTail = prev;
+ }
+
+ private static void insertLRU(final ByteWindow<?> e) {
+ final ByteWindow h = lruHead;
+ e.lruPrev = null;
+ e.lruNext = h;
+ if (h != null)
+ h.lruPrev = e;
+ else
+ lruTail = e;
+ lruHead = e;
+ }
+
+ private static int hash(final WindowedFile wp, final int id) {
+ return ((wp.hash + id) >>> 1) % cache.length;
+ }
+
private static int windowSize(final WindowedFile file, final int id) {
final long len = file.length();
final long pos = id << windowSizeShift;
diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/WindowedFile.java b/org.spearce.jgit/src/org/spearce/jgit/lib/WindowedFile.java
index dd94f24..9c5cf1e 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/lib/WindowedFile.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/WindowedFile.java
@@ -88,7 +88,7 @@
*/
public WindowedFile(final File file) {
fPath = file;
- hash = System.identityHashCode(this);
+ hash = System.identityHashCode(this) * 31;
length = Long.MAX_VALUE;
}
--
1.6.1.302.gccd4d
^ permalink raw reply related
* Re: [git-new-workdir RFC] Backlinking $workdir/logs/HEAD to $GIT_DIR/logs/workdir?
From: Shawn O. Pearce @ 2008-12-27 17:26 UTC (permalink / raw)
To: Adeodato Simó; +Cc: git
In-Reply-To: <20081227121526.GA12120@chistera.yi.org>
Adeodato Simó <dato@net.com.org.es> wrote:
> I use git new-workdir for some of my projects. Apart from the usual
> caveat "don't checkout the same branch twice", I found another small
> issue, surely known: the reflog for HEAD in the workidirs does not exist
> in the source git repo, hence git-gc will happily prune what it believes
> to be dangling commits.
>
> Would it be, perhaps, be okay to create a logs/workdir/<name>/HEAD
> symlink pointing to $workdir/logs/HEAD, so that this does not happen?
You also need to link the ref. A log is only scanned if the
ref by the same name is scanned.
So you'd need to create a refs/workdir/<name>/HEAD in the parent
repository. Using a symlink to point to the HEAD file from the
workdir might just work.
--
Shawn.
^ permalink raw reply
* [PATCH v2] parse-opt: migrate builtin-apply.
From: Miklos Vajna @ 2008-12-27 14:22 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <20081227140533.GX21154@genesis.frugalware.org>
The only incompatible change is that the user how have to use '--'
before a patch named --build-fake-ancestor=something.
Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
---
Diffstat against v1:
builtin-apply.c | 125 +++++++++++++------------------------------------------
1 files changed, 29 insertions(+), 96 deletions(-)
due to the removal of option_parse_stat, option_parse_numstat,
option_parse_summary, option_parse_check, option_parse_index,
option_parse_cached, option_parse_ancestor and option_parse_reject.
Documentation/git-apply.txt | 4 +-
builtin-apply.c | 293 ++++++++++++++++++++++++-------------------
2 files changed, 167 insertions(+), 130 deletions(-)
diff --git a/Documentation/git-apply.txt b/Documentation/git-apply.txt
index e726510..9400f6a 100644
--- a/Documentation/git-apply.txt
+++ b/Documentation/git-apply.txt
@@ -10,7 +10,7 @@ SYNOPSIS
--------
[verse]
'git apply' [--stat] [--numstat] [--summary] [--check] [--index]
- [--apply] [--no-add] [--build-fake-ancestor <file>] [-R | --reverse]
+ [--apply] [--no-add] [--build-fake-ancestor=<file>] [-R | --reverse]
[--allow-binary-replacement | --binary] [--reject] [-z]
[-pNUM] [-CNUM] [--inaccurate-eof] [--recount] [--cached]
[--whitespace=<nowarn|warn|fix|error|error-all>]
@@ -64,7 +64,7 @@ OPTIONS
cached data, apply the patch, and store the result in the index,
without using the working tree. This implies '--index'.
---build-fake-ancestor <file>::
+--build-fake-ancestor=<file>::
Newer 'git-diff' output has embedded 'index information'
for each blob to help identify the original version that
the patch applies to. When this flag is given, and if
diff --git a/builtin-apply.c b/builtin-apply.c
index 07244b0..98a988c 100644
--- a/builtin-apply.c
+++ b/builtin-apply.c
@@ -14,6 +14,7 @@
#include "builtin.h"
#include "string-list.h"
#include "dir.h"
+#include "parse-options.h"
/*
* --check turns on checking that the working tree matches the
@@ -46,8 +47,10 @@ static int no_add;
static const char *fake_ancestor;
static int line_termination = '\n';
static unsigned long p_context = ULONG_MAX;
-static const char apply_usage[] =
-"git apply [--stat] [--numstat] [--summary] [--check] [--index] [--cached] [--apply] [--no-add] [--index-info] [--allow-binary-replacement] [--reverse] [--reject] [--verbose] [-z] [-pNUM] [-CNUM] [--whitespace=<nowarn|warn|fix|error|error-all>] <patch>...";
+static const char * const apply_usage[] = {
+ "git apply [--stat] [--numstat] [--summary] [--check] [--index] [--cached] [--apply] [--no-add] [--index-info] [--allow-binary-replacement] [--reverse] [--reject] [--verbose] [-z] [-pNUM] [-CNUM] [--whitespace=<nowarn|warn|fix|error|error-all>] <patch>...",
+ NULL
+};
static enum ws_error_action {
nowarn_ws_error,
@@ -61,6 +64,8 @@ static int applied_after_fixing_ws;
static const char *patch_input_file;
static const char *root;
static int root_len;
+static int read_stdin = 1;
+static int options;
static void parse_whitespace_option(const char *option)
{
@@ -3135,150 +3140,182 @@ static int git_apply_config(const char *var, const char *value, void *cb)
return git_default_config(var, value, cb);
}
+static int option_parse_stdin(const struct option *opt,
+ const char *arg, int unset)
+{
+ int *errs = opt->value;
+
+ *errs |= apply_patch(0, "<stdin>", options);
+ read_stdin = 0;
+ return 0;
+}
+
+static int option_parse_exclude(const struct option *opt,
+ const char *arg, int unset)
+{
+ add_name_limit(arg, 1);
+ return 0;
+}
+
+static int option_parse_include(const struct option *opt,
+ const char *arg, int unset)
+{
+ add_name_limit(arg, 0);
+ has_include = 1;
+ return 0;
+}
+
+static int option_parse_p(const struct option *opt,
+ const char *arg, int unset)
+{
+ p_value = atoi(arg);
+ p_value_known = 1;
+ return 0;
+}
+
+static int option_parse_z(const struct option *opt,
+ const char *arg, int unset)
+{
+ if (unset)
+ line_termination = '\n';
+ else
+ line_termination = 0;
+ return 0;
+}
+
+static int option_parse_whitespace(const struct option *opt,
+ const char *arg, int unset)
+{
+ const char **whitespace_option = opt->value;
+
+ *whitespace_option = arg;
+ parse_whitespace_option(arg);
+ return 0;
+}
+
+static int option_parse_inaccurate(const struct option *opt,
+ const char *arg, int unset)
+{
+ options |= INACCURATE_EOF;
+ return 0;
+}
+
+static int option_parse_recount(const struct option *opt,
+ const char *arg, int unset)
+{
+ options |= RECOUNT;
+ return 0;
+}
+
+static int option_parse_directory(const struct option *opt,
+ const char *arg, int unset)
+{
+ root_len = strlen(arg);
+ if (root_len && arg[root_len - 1] != '/') {
+ char *new_root;
+ root = new_root = xmalloc(root_len + 2);
+ strcpy(new_root, arg);
+ strcpy(new_root + root_len++, "/");
+ } else
+ root = arg;
+ return 0;
+}
int cmd_apply(int argc, const char **argv, const char *unused_prefix)
{
int i;
- int read_stdin = 1;
- int options = 0;
int errs = 0;
int is_not_gitdir;
+ int binary;
+ int force_apply = 0;
const char *whitespace_option = NULL;
+ struct option builtin_apply_options[] = {
+ { OPTION_CALLBACK, '-', NULL, &errs, NULL,
+ "read the patch from the standard input",
+ PARSE_OPT_NOARG, option_parse_stdin },
+ { OPTION_CALLBACK, 0, "exclude", NULL, "path",
+ "don´t apply changes matching the given path",
+ 0, option_parse_exclude },
+ { OPTION_CALLBACK, 0, "include", NULL, "path",
+ "apply changes matching the given path",
+ 0, option_parse_include },
+ { OPTION_CALLBACK, 'p', NULL, NULL, "num",
+ "remove <num> leading slashes from traditional diff paths",
+ 0, option_parse_p },
+ OPT_BOOLEAN(0, "no-add", &no_add,
+ "ignore additions made by the patch"),
+ OPT_BOOLEAN(0, "stat", &diffstat,
+ "instead of applying the patch, output diffstat for the input"),
+ OPT_BOOLEAN(0, "allow-binary-replacement", &binary,
+ "now no-op"),
+ OPT_BOOLEAN(0, "binary", &binary,
+ "now no-op"),
+ OPT_BOOLEAN(0, "numstat", &numstat,
+ "shows number of added and deleted lines in decimal notation"),
+ OPT_BOOLEAN(0, "summary", &summary,
+ "instead of applying the patch, output a summary for the input"),
+ OPT_BOOLEAN(0, "check", &check,
+ "instead of applying the patch, see if the patch is applicable"),
+ OPT_BOOLEAN(0, "index", &check_index,
+ "make sure the patch is applicable to the current index"),
+ OPT_BOOLEAN(0, "cached", &cached,
+ "apply a patch without touching the working tree"),
+ OPT_BOOLEAN(0, "apply", &force_apply,
+ "also apply the patch (use with --stat/--summary/--check)"),
+ OPT_STRING(0, "build-fake-ancestor", &fake_ancestor, "file",
+ "build a temporary index based on embedded index information"),
+ { OPTION_CALLBACK, 'z', NULL, NULL, NULL,
+ "paths are separated with NUL character",
+ PARSE_OPT_NOARG, option_parse_z },
+ OPT_INTEGER('C', NULL, &p_context,
+ "ensure at least <n> lines of context match"),
+ { OPTION_CALLBACK, 0, "whitespace", &whitespace_option, "action",
+ "detect new or modified lines that have whitespace errors",
+ 0, option_parse_whitespace },
+ OPT_BOOLEAN('R', "reverse", &apply_in_reverse,
+ "apply the patch in reverse"),
+ OPT_BOOLEAN(0, "unidiff-zero", &unidiff_zero,
+ "don't expect at least one line of context"),
+ OPT_BOOLEAN(0, "reject", &apply_with_reject,
+ "leave the rejected hunks in corresponding *.rej files"),
+ OPT__VERBOSE(&apply_verbosely),
+ { OPTION_CALLBACK, 0, "inaccurate-eof", NULL, NULL,
+ "tolerate incorrectly detected missing new-line at the end of file",
+ PARSE_OPT_NOARG, option_parse_inaccurate },
+ { OPTION_CALLBACK, 0, "recount", NULL, NULL,
+ "do not trust the line counts in the hunk headers",
+ PARSE_OPT_NOARG, option_parse_recount },
+ { OPTION_CALLBACK, 0, "directory", NULL, "root",
+ "prepend <root> to all filenames",
+ 0, option_parse_directory },
+ OPT_END()
+ };
+
prefix = setup_git_directory_gently(&is_not_gitdir);
prefix_length = prefix ? strlen(prefix) : 0;
git_config(git_apply_config, NULL);
if (apply_default_whitespace)
parse_whitespace_option(apply_default_whitespace);
- for (i = 1; i < argc; i++) {
+ argc = parse_options(argc, argv, builtin_apply_options,
+ apply_usage, 0);
+ if (apply_with_reject)
+ apply = apply_verbosely = 1;
+ if (!force_apply && (diffstat || numstat || summary || check || fake_ancestor))
+ apply = 0;
+ if (check_index && is_not_gitdir)
+ die("--index outside a repository");
+ if (cached) {
+ if (is_not_gitdir)
+ die("--cached outside a repository");
+ check_index = 1;
+ }
+ for (i = 0; i < argc; i++) {
const char *arg = argv[i];
- char *end;
int fd;
- if (!strcmp(arg, "-")) {
- errs |= apply_patch(0, "<stdin>", options);
- read_stdin = 0;
- continue;
- }
- if (!prefixcmp(arg, "--exclude=")) {
- add_name_limit(arg + 10, 1);
- continue;
- }
- if (!prefixcmp(arg, "--include=")) {
- add_name_limit(arg + 10, 0);
- has_include = 1;
- continue;
- }
- if (!prefixcmp(arg, "-p")) {
- p_value = atoi(arg + 2);
- p_value_known = 1;
- continue;
- }
- if (!strcmp(arg, "--no-add")) {
- no_add = 1;
- continue;
- }
- if (!strcmp(arg, "--stat")) {
- apply = 0;
- diffstat = 1;
- continue;
- }
- if (!strcmp(arg, "--allow-binary-replacement") ||
- !strcmp(arg, "--binary")) {
- continue; /* now no-op */
- }
- if (!strcmp(arg, "--numstat")) {
- apply = 0;
- numstat = 1;
- continue;
- }
- if (!strcmp(arg, "--summary")) {
- apply = 0;
- summary = 1;
- continue;
- }
- if (!strcmp(arg, "--check")) {
- apply = 0;
- check = 1;
- continue;
- }
- if (!strcmp(arg, "--index")) {
- if (is_not_gitdir)
- die("--index outside a repository");
- check_index = 1;
- continue;
- }
- if (!strcmp(arg, "--cached")) {
- if (is_not_gitdir)
- die("--cached outside a repository");
- check_index = 1;
- cached = 1;
- continue;
- }
- if (!strcmp(arg, "--apply")) {
- apply = 1;
- continue;
- }
- if (!strcmp(arg, "--build-fake-ancestor")) {
- apply = 0;
- if (++i >= argc)
- die ("need a filename");
- fake_ancestor = argv[i];
- continue;
- }
- if (!strcmp(arg, "-z")) {
- line_termination = 0;
- continue;
- }
- if (!prefixcmp(arg, "-C")) {
- p_context = strtoul(arg + 2, &end, 0);
- if (*end != '\0')
- die("unrecognized context count '%s'", arg + 2);
- continue;
- }
- if (!prefixcmp(arg, "--whitespace=")) {
- whitespace_option = arg + 13;
- parse_whitespace_option(arg + 13);
- continue;
- }
- if (!strcmp(arg, "-R") || !strcmp(arg, "--reverse")) {
- apply_in_reverse = 1;
- continue;
- }
- if (!strcmp(arg, "--unidiff-zero")) {
- unidiff_zero = 1;
- continue;
- }
- if (!strcmp(arg, "--reject")) {
- apply = apply_with_reject = apply_verbosely = 1;
- continue;
- }
- if (!strcmp(arg, "-v") || !strcmp(arg, "--verbose")) {
- apply_verbosely = 1;
- continue;
- }
- if (!strcmp(arg, "--inaccurate-eof")) {
- options |= INACCURATE_EOF;
- continue;
- }
- if (!strcmp(arg, "--recount")) {
- options |= RECOUNT;
- continue;
- }
- if (!prefixcmp(arg, "--directory=")) {
- arg += strlen("--directory=");
- root_len = strlen(arg);
- if (root_len && arg[root_len - 1] != '/') {
- char *new_root;
- root = new_root = xmalloc(root_len + 2);
- strcpy(new_root, arg);
- strcpy(new_root + root_len++, "/");
- } else
- root = arg;
- continue;
- }
if (0 < prefix_length)
arg = prefix_filename(prefix, prefix_length, arg);
--
1.6.1.rc1.35.gae26e.dirty
^ permalink raw reply related
* Re: [PATCH] parse-opt: migrate builtin-apply.
From: Miklos Vajna @ 2008-12-27 14:05 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <7vtz8qgjo9.fsf@gitster.siamese.dyndns.org>
[-- Attachment #1: Type: text/plain, Size: 4579 bytes --]
On Fri, Dec 26, 2008 at 11:29:42PM -0800, Junio C Hamano <gitster@pobox.com> wrote:
> Miklos Vajna <vmiklos@frugalware.org> writes:
>
> > The only notable user-visible/incompatible change is that the
> > --build-fake-ancestor option now conforms to gitcli(7).
> >
> > Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
> > ---
> >
> > I know that we do care about incompatible changes a lot, though I think
> > this is the right direction and probably --build-fake-ancestor is not a
> > heavily used switch, so I hope that part is OK.
>
> An acceptable justification for such a plumbing change is if (1) the old
> syntax is still supported the same way as the original implementation,
> *and* if (2) the new syntax is something that could not possibly have been
> a valid input to the original implementation with a different meaning.
>
> I think the condition (1) holds but (2) does not hold for your patch; even
> though I think the latter breakage is excusable in this particular case,
> it is not for the reason you cited.
>
> That is,
>
> (1) The parseopt parser allows both of these forms:
>
> $ git apply --build-fake-ancestor file <input
> $ git apply --build-fake-ancestor=file <input
>
> The former has been how existing scripts that use the plumbing have
> been feeding the file, and it is still supported.
>
> (2) A script that used "git apply" and relied on the behaviour of
> the original implementation could have fed a patch from a file
> whose name is "--build-fake-ancestor=some-string", with this command
> line:
>
> $ git apply --build-fake-ancestor=file
>
> Now such a script would break with the new parser.
>
> The reason you are excused to break such an insane script is definitely
> not because --build-fake-ancestor is a rarely used option. The whole
> defence depends on the fact that --build-fake-ancestor=something is a very
> unlikely name for any sane script to be using for its temporary file. It
> could still be an end user input, but at that point you could simply doubt
> the sanity of the end user and dismiss the issue away.
>
> I am not fundamentally opposed to using parseopt in git-apply, and I think
> the change to add a new and saner meaning to "--build-fake-ancestor=file"
> on the command line is a good thing in the longer term. But your
> justification for such a change should be given in such a way to show
> clearly that you have thought things through. It has to be much better
> than "it is not a heavily used switch anyway".
I was not aware about parsepont allows both options, I just -
incorrectly - thought git-log uses paseopt and there I remember
--since=foo works, but not --since foo. So actually the commit message
is incorrect, the backwards-incompatible change is not to accept a patch
file named --build-fake-ancestor=something without passing '--' first.
> The saddest part of the story that pisses me off about this patch is that
> you did not seem to have even run the test suite before sending it. t4105
> and t4252 fail for me, at least.
Hm, I did:
$ ./t4105-apply-fuzz.sh
* ok 1: setup
* ok 2: unmodified patch
* ok 3: minus offset
* ok 4: plus offset
* ok 5: big offset
* ok 6: fuzz with no offset
* ok 7: fuzz with minus offset
* ok 8: fuzz with plus offset
* ok 9: fuzz with big offset
* passed all 9 test(s)
$ ./t4252-am-options.sh
* ok 1: setup
* ok 2: interrupted am --whitespace=fix
* ok 3: interrupted am -C1
* ok 4: interrupted am -p2
* ok 5: interrupted am -C1 -p2
* passed all 5 test(s)
$ git show -s --pretty=oneline
05d26caf212b58998b7e559991f3a25fd8cbf3f0 parse-opt: migrate builtin-apply.
What testcases did fail for you?
> I did not look at the patch very closely, but do you really need that many
> option callbacks? My gut feeling is that many of them should be just
> setting a boolean flag, and you can postprocess to get the correct "apply"
> behaviour.
>
> For example, you start with "apply" set to true, and let parseopt set
> "diffstat" upon seeing "--stat", and set "cmdline_apply" upon seeing
> "--apply". After parseopt returns, you determine the final value of
> "apply" by using "diffstat" (and friends that would normally drop "apply")
> and "cmdline_apply" (which would override such droppages). That way I
> think you can lose many callback functions whose sole purpose is to drop
> "apply" option, no?
Yes, you are right. I'll send an updated patch in a bit.
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply
* Re: [JGIT PATCH 11/23] Rewrite WindowCache to use a hash table
From: Robin Rosenberg @ 2008-12-27 13:30 UTC (permalink / raw)
To: Shawn O. Pearce; +Cc: git
In-Reply-To: <1230171079-17156-12-git-send-email-spearce@spearce.org>
torsdag 25 december 2008 03:11:07 skrev Shawn O. Pearce:
> diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/WindowCache.java b/org.spearce.jgit/src/org/spearce/jgit/lib/WindowCache.java
> index f617845..f478f04 100644
> --- a/org.spearce.jgit/src/org/spearce/jgit/lib/WindowCache.java
> +++ b/org.spearce.jgit/src/org/spearce/jgit/lib/WindowCache.java
> @@ -41,11 +41,7 @@
> import java.io.IOException;
> import java.lang.ref.ReferenceQueue;
>
> -/**
> - * The WindowCache manages reusable <code>Windows</code> and inflaters used by
> - * the other windowed file access classes.
> - */
> -public class WindowCache {
> +class WindowCache {
This breaks the Eclipse plugin which want to call WindowCache.reconfigure. Package level
class can also have javadocs. Even though we do not require it, I still thinks it's a good idea. Not
sure how useful that one was.
-- robin
^ permalink raw reply
* Git (svn) merge - but ignore certain commits?
From: "Peter Valdemar Mørch (Lists)" @ 2008-12-27 13:02 UTC (permalink / raw)
To: git
Hi,
I'm wondering how to merge a branch back to a master/svn trunk, getting
"almost" all the commits on the branch. I've experimented with "git
merge -s ours" unsuccessfully and don't know how else to proceed.
Background: Our svn trunk has had many solid commits, and a few that
aren't ready yet. We need to make a new release without these unready
commits but with some new functionality.
Externally to git, a branch was made off of trunk's HEAD. Call it
"newbranch".
The idea is to:
* Create a git branch off of svn "newbranch", call it "gitnewbranch".
* "git revert" the "few unready" commits on "gitnewbranch" so we have a
solid foundation
* add the new functionality to "gitnewbranch"
* "git svn dcommit" to get the new functionality on svn's "newbranch"
* And now the trick: "git merge" "gitnewbranch" back to master. But I
want to avoid the "git revert" of the few commits that weren't ready yet.
* "git svn dcommit" master to get the new functionality into svn trunk.
How do I "git merge" all of "gitnewbranch" except the reverts?
I tried doing just the revert step, and then
"git merge -s ours gitnewbranch"
on master, and that seemed to work. Annoyingly (to me :-D) "git log
master" does show the reverts that happened on gitnewbranch, but the
files in master were not changed. However, when I "git svn rebase", it
fails with a
"CONFLICT (content): Merge conflict in <file>".
And hence, "git svn dcommit" fails too.
Is there a way to "git merge gitnewbranch" excluding the reverts, just
the "new functionality", so the log of master doesn't even mention the
reverts and so "git svn rebase" and "git svn dcommit" work properly?
I guess I could git cherry-pick all the "new functionality" commits from
gitnewbranch to master, but it sort of defeats the coolness of gits
branch handling if I have to keep track of the cherry-picked commits
manually.
How do I do this "properly"?
Peter
--
Peter Valdemar Mørch
http://www.morch.com
^ permalink raw reply
* [STGIT][PATCH] new: translate non word characters in patch name to '-'
From: Hannes Eder @ 2008-12-27 12:37 UTC (permalink / raw)
To: git
This allows following usage:
$ stg new full/path/file-fix-foobar
Now at patch "full-path-file-fix-foobar"
Signed-off-by: Hannes Eder <hannes@hanneseder.net>
---
I ran into as a '/' in a patch messed up stgit.
I find this useful as 'stg uncommit' does the same translation.
stgit/commands/new.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/stgit/commands/new.py b/stgit/commands/new.py
index 151cfe9..ab09476 100644
--- a/stgit/commands/new.py
+++ b/stgit/commands/new.py
@@ -58,7 +58,7 @@ def func(parser, options, args):
if len(args) == 0:
name = None
elif len(args) == 1:
- name = args[0]
+ name = utils.patch_name_from_msg(args[0])
if stack.patches.exists(name):
raise common.CmdException('%s: patch already exists' % name)
else:
^ permalink raw reply related
* [git-new-workdir RFC] Backlinking $workdir/logs/HEAD to $GIT_DIR/logs/workdir?
From: Adeodato Simó @ 2008-12-27 12:15 UTC (permalink / raw)
To: git
Hello,
I use git new-workdir for some of my projects. Apart from the usual
caveat "don't checkout the same branch twice", I found another small
issue, surely known: the reflog for HEAD in the workidirs does not exist
in the source git repo, hence git-gc will happily prune what it believes
to be dangling commits.
Would it be, perhaps, be okay to create a logs/workdir/<name>/HEAD
symlink pointing to $workdir/logs/HEAD, so that this does not happen?
Comments welcome.
--
Adeodato Simó dato at net.com.org.es
Debian Developer adeodato at debian.org
Listening to: Niza - Parasol
^ permalink raw reply
* Re: [PATCH] Add a commit.signoff configuration variable to always use --signoff
From: Adeodato Simó @ 2008-12-27 12:01 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <7v8wq1esvo.fsf@gitster.siamese.dyndns.org>
* Junio C Hamano [Sat, 27 Dec 2008 03:53:47 -0800]:
> Adeodato Simó <dato@net.com.org.es> writes:
> > +commit.signoff::
> > + If set, 'git commit' will behave as if '-s' option was given.
> > + Please use this option with care: by enabling it, you're stating
> > + that all your commits will invariably meet the S-o-b
> > + requirements for any project you send patches to. It's probably
> This is true only if you set it in your global configuration. A more sane
> usage would be to have it per repository as you recommend in a later
> sentence, and "for any project" part is untrue when the reader does so.
How about:
Please use this option with care: by enabling it globally, you'd be
stating...
--
Adeodato Simó dato at net.com.org.es
Debian Developer adeodato at debian.org
Listening to: Niza - Solsticio de invierno
^ permalink raw reply
* Re: RFE: git-import-dsc should support http-links
From: Guido Günther @ 2008-12-27 11:49 UTC (permalink / raw)
To: Rolf Leggewie; +Cc: git, Junio C Hamano
In-Reply-To: <7vk59n93x7.fsf@gitster.siamese.dyndns.org>
Hi Rolf, Hi Junio,
On Thu, Dec 25, 2008 at 04:27:16PM -0800, Junio C Hamano wrote:
> Rolf Leggewie <no2spam@nospam.arcornews.de> writes:
>
> > merry Christmas everyone. I hope this is the right place for this, I
> > looked around and it seemed to me it was, so here it goes.
>
> Sorry, I have never heard of git-import-dsc and had to google for it, only
> to find that it is one [*1*] of a set [*2*] of debian local tools somebody
> I've never heard of (Cc'ed) on this list has written.
>
> > It would be nice if the following just worked:
> >
> > "git-import-dsc
> > http://ftp.de.debian.org/debian/pool/main/g/gnucash/gnucash_2.2.6-2.dsc"
> > Regards
dget http://ftp.de.debian.org/debian/pool/main/g/gnucash/gnucash_2.2.6-2.dsc
git-import-dsc gnucash_2.2.6-2.dsc
is what I'm using but having this in git-import-dsc itself is fine by me
if someone sends a patch.
> > PS: How about some kind of official bug tracker for git?
The Debian BTS (bugs.debian.org) is the official bugtracker for
git-buildpackage.
Cheers,
-- Guido
^ permalink raw reply
* Re: [PATCH] Add a commit.signoff configuration variable to always use --signoff
From: Junio C Hamano @ 2008-12-27 11:53 UTC (permalink / raw)
To: Adeodato Simó; +Cc: git
In-Reply-To: <1230368596-6865-1-git-send-email-dato@net.com.org.es>
Adeodato Simó <dato@net.com.org.es> writes:
> +commit.signoff::
> + If set, 'git commit' will behave as if '-s' option was given.
> + Please use this option with care: by enabling it, you're stating
> + that all your commits will invariably meet the S-o-b
> + requirements for any project you send patches to. It's probably
This is true only if you set it in your global configuration. A more sane
usage would be to have it per repository as you recommend in a later
sentence, and "for any project" part is untrue when the reader does so.
> diff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt
> index b5d81be..abab839 100644
> --- a/Documentation/git-commit.txt
> +++ b/Documentation/git-commit.txt
> @@ -96,7 +96,8 @@ OPTIONS
> -s::
> --signoff::
> Add Signed-off-by line by the committer at the end of the commit
> - log message.
> + log message. This overrides the `commit.signoff` configuration
> + variable.
Good and careful thinking. I like it.
^ permalink raw reply
* Re: [PATCH] git-shortlog.txt: improve documentation about .mailmap files
From: Junio C Hamano @ 2008-12-27 11:48 UTC (permalink / raw)
To: Adeodato Simó; +Cc: git
In-Reply-To: <1230292553-7613-1-git-send-email-dato@net.com.org.es>
Adeodato Simó <dato@net.com.org.es> writes:
> The previous .mailmap example made it seem like .mailmap files are only
> useful for commits with a wrong address for an author, when they are about
> fixing the real name. Explained this better in the text, and replaced the
> existing example with a new one that hopefully makes things clearer.
Thanks.
> -If the file `.mailmap` exists, it will be used for mapping author
> -email addresses to a real author name. One mapping per line, first
> -the author name followed by the email address enclosed by
> -'<' and '>'. Use hash '#' for comments. Example:
> +If a file `.mailmap` exists in the toplevel directory of the repository,
> +it will be used for mapping author email addresses to a canonical real
> +name. This can be used to coalesce together commits by the same person
> +where their name was spelled differently (whether with the same email
> +address or not).
We didn't stress "the toplevel" earlier, partly because it is obvious that
the file cannot be anything but project-tree wide (as opposed to being per
subdirectory, similar to .gitignore and .gitattributes). I guess it would
not hurt to be explicit, even though it feels slightly silly.
"..., it is used to map author email addresses to..." would flow easier.
> +The format of the file is one mapping per line, first the desired author
> +name followed by the email address enclosed by '<' and '>'. Use hash '#'
> +for comments.
You already introduced the term "a canonical real name" in the earlier
description. It would be easier to read if you stick to it and say "Each
line consists of the canonical real name of an author, whitespaces, and an
email address, enclosed by '<' and '>', to map to the name".
Can a hash '#' character be anywhere on a line? E.g. how is an entry like
this processed?
Jane Doe <jane@desktop.(none)> # early mistake...
> +... For example, if your history contains commits by these
> +committers:
I think you meant "authors", not "committers".
> +------------
> +Author: Joe Developer <joe@random.com>
> +Author: Joe R. Developer <joe@random.com>
> +Author: Jane Doe <jane@the-does.name>
> +Author: Jane Doe <jane@laptop.(none)>
> +Author: Jane D. <jane@desktop.(none)>
> +------------
I'd suggest dropping "Author: ". You said you are listing people.
Isn't random.com a real domain (the same goes for the-does.name)? It
would be preferrable to use addresses from .example (or .xz) top-level
domain.
Clarify that there are actually two people in the list above, and explain
that they are one Joe with two spellings who prefers to be referred to
with his middle initial, and one Jane with three spellings who prefers to
show the family name fully spelled out. Do not force your readers guess
which spelling is preferred for each person in the example. It would make
it easier for them to understand the example you will give them next and
to agree that the mailmap is "proper".
> +Then a proper `.mailmap` file would be:
>
> ------------
> -# Keep alphabetized
> -Adam Morrow <adam@localhost.localdomain>
> -Eve Jones <eve@laptop.(none)>
> +# Note how we don't need an entry for <jane@laptop.(none)>, because the
> +# real name of that author is correct already, and coalesced directly.
> +Jane Doe <jane@desktop.(none)>
> +Joe R. Developer <joe@random.com>
> ------------
^ permalink raw reply
* [ANNOUNCE] MSYSGIT 1.6.1
From: Steffen Prohaska @ 2008-12-27 10:31 UTC (permalink / raw)
To: Git Mailing List, msysGit; +Cc: Junio C Hamano
In-Reply-To: <7v7i5odams.fsf@gitster.siamese.dyndns.org>
On Dec 25, 2008, at 7:36 AM, Junio C Hamano wrote:
> The latest feature release GIT 1.6.1 is available at the usual
> places:
The msysgit installer is available at
http://code.google.com/p/msysgit/downloads
Steffen
^ permalink raw reply
* Re: [PATCH] Add a commit.signoff configuration variable to always use --signoff
From: Adeodato Simó @ 2008-12-27 11:05 UTC (permalink / raw)
To: Thomas Rast; +Cc: git, gitster
In-Reply-To: <200812271204.15268.trast@student.ethz.ch>
* Thomas Rast [Sat, 27 Dec 2008 12:04:11 +0100]:
> Adeodato Simó wrote:
> > +commit.signoff::
> > + If set, 'git commit' will behave as if '-s' option was given.
> > + Please use this option with care: by enabling it, you're stating
> > + that all your commits will invariably meet the S-o-b
> > + requirements for any project you send patches to. It's probably
> > + best to only use it from your private repositories' .git/config
> > + file, and only for projects who require a S-o-b as proof of
> ^^^^^^^^^^^^
> "projects which ..." or "projects that ...". "Who" can only stand for
> people, not objects.
Good catch, thank you. Hopefully Junio can amend.
--
Adeodato Simó dato at net.com.org.es
Debian Developer adeodato at debian.org
Listening to: Miguel Bosé - Puede que
^ permalink raw reply
* Re: [PATCH] Add a commit.signoff configuration variable to always use --signoff
From: Thomas Rast @ 2008-12-27 11:04 UTC (permalink / raw)
To: Adeodato Simó; +Cc: git, gitster
In-Reply-To: <1230368596-6865-1-git-send-email-dato@net.com.org.es>
[-- Attachment #1: Type: text/plain, Size: 709 bytes --]
Adeodato Simó wrote:
> +commit.signoff::
> + If set, 'git commit' will behave as if '-s' option was given.
> + Please use this option with care: by enabling it, you're stating
> + that all your commits will invariably meet the S-o-b
> + requirements for any project you send patches to. It's probably
> + best to only use it from your private repositories' .git/config
> + file, and only for projects who require a S-o-b as proof of
^^^^^^^^^^^^
"projects which ..." or "projects that ...". "Who" can only stand for
people, not objects.
> + provenance of the patch, and not of its correctness or quality.
--
Thomas Rast
trast@{inf,student}.ethz.ch
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply
* [PATCH] gitweb: Fix export check in git_get_projects_list
From: Devin Doucette @ 2008-12-27 9:39 UTC (permalink / raw)
To: git; +Cc: Petr Baudis, Jakub Narebski
When $filter was empty, the path passed to check_export_ok would
contain an extra '/', which some implementations of export_auth_hook
are sensitive to.
It makes more sense to fix this here than to handle the special case
in each implementation of export_auth_hook.
Signed-off-by: Devin Doucette <devin@doucette.cc>
---
gitweb/gitweb.perl | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 8f574c7..99f71b4 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -2147,8 +2147,9 @@ sub git_get_projects_list {
my $subdir = substr($File::Find::name, $pfxlen + 1);
# we check related file in $projectroot
- if (check_export_ok("$projectroot/$filter/$subdir")) {
- push @list, { path => ($filter ? "$filter/" : '') . $subdir };
+ my $path = ($filter ? "$filter/" : '') . $subdir;
+ if (check_export_ok("$projectroot/$path")) {
+ push @list, { path => $path };
$File::Find::prune = 1;
}
},
--
1.6.1.rc4
^ permalink raw reply related
* [PATCH] Add a commit.signoff configuration variable to always use --signoff
From: Adeodato Simó @ 2008-12-27 9:03 UTC (permalink / raw)
To: git, gitster; +Cc: Adeodato Simó
In-Reply-To: <7v63l6f1mc.fsf@gitster.siamese.dyndns.org>
Signed-off-by: Adeodato Simó <dato@net.com.org.es>
---
* Junio C Hamano [Sat, 27 Dec 2008 00:44:59 -0800]:
> > +commit.signoff::
> > + If set, 'git-commit' will always add a Signed-off-by line.
> It is not a big deal, but my first reaction to the above was "S-o-b by
> whom? It misses details and does not say where to find them".
> How about "if set, 'git commit' will behave as if '-s' option was given",
> so that we can leave the details of whose S-o-b line to generate and such
> to the description of "git commit -s" manual page?
Changed.
> > I'll send an amended patch (or should I send an incremental/extra
> > one instead?)
I didn't get an answer to this, so I'm sending an amended one, hoping
that's the correct thing to do in this land.
> Another problem that you seem to have missed about M-F-T is that while you
> solicited responses from general public by CC'ing the list (which allowed
> me to respond to you), by forcing the response go only to the list, you
> excluded people on the To: and Cc: list of your original message from my
> response. You required them to be subscribed to the list, if they want to
> be kept in the loop.
No, not really, because Mutt will add to the M-F-T header all addresses
that appear on the To or Cc headers.
Documentation/config.txt | 9 +++++++++
Documentation/git-commit.txt | 3 ++-
builtin-commit.c | 5 +++++
3 files changed, 16 insertions(+), 1 deletions(-)
diff --git a/Documentation/config.txt b/Documentation/config.txt
index 52786c7..4d0a79b 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -591,6 +591,15 @@ color.ui::
commit.template::
Specify a file to use as the template for new commit messages.
+commit.signoff::
+ If set, 'git commit' will behave as if '-s' option was given.
+ Please use this option with care: by enabling it, you're stating
+ that all your commits will invariably meet the S-o-b
+ requirements for any project you send patches to. It's probably
+ best to only use it from your private repositories' .git/config
+ file, and only for projects who require a S-o-b as proof of
+ provenance of the patch, and not of its correctness or quality.
+
diff.autorefreshindex::
When using 'git-diff' to compare with work tree
files, do not consider stat-only change as changed.
diff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt
index b5d81be..abab839 100644
--- a/Documentation/git-commit.txt
+++ b/Documentation/git-commit.txt
@@ -96,7 +96,8 @@ OPTIONS
-s::
--signoff::
Add Signed-off-by line by the committer at the end of the commit
- log message.
+ log message. This overrides the `commit.signoff` configuration
+ variable.
-n::
--no-verify::
diff --git a/builtin-commit.c b/builtin-commit.c
index e88b78f..fc09539 100644
--- a/builtin-commit.c
+++ b/builtin-commit.c
@@ -929,6 +929,11 @@ static int git_commit_config(const char *k, const char *v, void *cb)
if (!strcmp(k, "commit.template"))
return git_config_string(&template_file, k, v);
+ if (!strcmp(k, "commit.signoff")) {
+ signoff = git_config_bool(k, v);
+ return 0;
+ }
+
return git_status_config(k, v, cb);
}
--
1.6.1.307.g07803
^ permalink raw reply related
* [PATCH] git-send-email.txt: move --format-patch paragraph to a proper location
From: Adeodato Simó @ 2008-12-27 8:50 UTC (permalink / raw)
To: git, gitster; +Cc: Adeodato Simó
When introducing --format-patch, its documentation was accidentally inserted
in the middle of documentation for --validate.
Signed-off-by: Adeodato Simó <dato@net.com.org.es>
---
Documentation/git-send-email.txt | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt
index 1278866..b69846e 100644
--- a/Documentation/git-send-email.txt
+++ b/Documentation/git-send-email.txt
@@ -197,12 +197,6 @@ Administering
--[no-]validate::
Perform sanity checks on patches.
Currently, validation means the following:
-
---[no-]format-patch::
- When an argument may be understood either as a reference or as a file name,
- choose to understand it as a format-patch argument ('--format-patch')
- or as a file name ('--no-format-patch'). By default, when such a conflict
- occurs, git send-email will fail.
+
--
* Warn of patches that contain lines longer than 998 characters; this
@@ -212,6 +206,12 @@ Administering
Default is the value of 'sendemail.validate'; if this is not set,
default to '--validate'.
+--[no-]format-patch::
+ When an argument may be understood either as a reference or as a file name,
+ choose to understand it as a format-patch argument ('--format-patch')
+ or as a file name ('--no-format-patch'). By default, when such a conflict
+ occurs, git send-email will fail.
+
CONFIGURATION
-------------
--
1.6.1.307.g07803
^ permalink raw reply related
* Re: [PATCH] Add a commit.signoff configuration variable to always use --signoff.
From: Junio C Hamano @ 2008-12-27 8:44 UTC (permalink / raw)
To: Adeodato Simó; +Cc: git, Johannes Schindelin
In-Reply-To: <20081227082620.GA5230@chistera.yi.org>
Adeodato Simó <dato@net.com.org.es> writes:
> Does this sound good? If so, I'll send an amended patch (or should I send an
> incremental/extra one instead?):
>
> +commit.signoff::
> + If set, 'git-commit' will always add a Signed-off-by line.
It is not a big deal, but my first reaction to the above was "S-o-b by
whom? It misses details and does not say where to find them".
How about "if set, 'git commit' will behave as if '-s' option was given",
so that we can leave the details of whose S-o-b line to generate and such
to the description of "git commit -s" manual page?
> + Please use this option with care: by enabling it, you're stating
> + that all your commits will invariably meet the S-o-b
> + requirements for any project you send patches to. It's probably
> + best to only use it from your private repositories' .git/config
> + file, and only for projects who require a S-o-b as proof of
> + provenance of the patch, and not of its correctness or quality.
Yeah, many projects do not even have S-o-b convention.
>> By the way, please do not deflect away responses meant to you by using a
>> Mail-Followup-To header that points at the git mailing list. It is rude.
>
> I set a M-F-T header because I prefer not to be CC'ed. I have other
> mechanisms in place that prevent me from missing replies to my messages
> (based on In-Reply-To/References headers).
>
> Nevertheless, if the list normally operates CC-based, I can see how pressing
> Reply-to-all and not seing the original autor in the recipient list can be
> offputting, so I'll stop setting M-F-T in my messages to git@. (Hopefully
> starting with this message already.)
Thanks.
Another problem that you seem to have missed about M-F-T is that while you
solicited responses from general public by CC'ing the list (which allowed
me to respond to you), by forcing the response go only to the list, you
excluded people on the To: and Cc: list of your original message from my
response. You required them to be subscribed to the list, if they want to
be kept in the loop.
^ 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