* Re: [PATCH 0/4] diff text conversion filter
From: Jeff King @ 2008-10-13 1:29 UTC (permalink / raw)
To: Johannes Sixt; +Cc: Matthieu Moy, git
In-Reply-To: <48EB8B1C.9060201@viscovery.net>
On Tue, Oct 07, 2008 at 06:15:24PM +0200, Johannes Sixt wrote:
> and that should be sufficient. I'm proposing this heuristics:
>
> * If only textconv is given, all porcelains pick it.
> * If only command is given, all porcelains pick it.
> * If both are given, then
> - git log picks textconv.
> - git show and git diff:
> . if exactly one pathspec was given, pick command;
> . otherwise pick textconv
I am not 100% convinced that is sufficient, given Matthieu's other post.
But I will not personally be using external diff at all, so I am hard
pressed to come up with a counter example.
> Plumbing never picks any of them, just like today, nor should git
> format-patch. The are other porcelains that could be sorted into this
> list, like git blame and (the summary line of) git commit.
Actually, I think blaming a text-conv'd version would be useful (at
least for my case). But cleary it should be optional, and probably
defaulting to off.
Once again, I think this is a good reason to move to an explicit diff
option for "respect textconv" rather than relying on maybe or maybe not
loading the config.
> BTW, please don't take git-gui as an example that would lauch MS-Word on
> each diff. (Neither would gitk.) Both rely on plumbing, and that's good.
> gitk has a menu entry "External diff", where the diff.doc.command could be
> hooked into.
But they are both porcelain. So in theory, they could behave differently
depending on what config is available (or if not them, some other
third-party porcelain). But I was just responding to Matthieu's
use-case, so I am not sure what exactly people prefer; I am lucky enough
not to version any MS-Word documents at all. :)
-Peff
^ permalink raw reply
* Re: [PATCH 3/4] diff: introduce diff.<driver>.binary
From: Jeff King @ 2008-10-13 1:23 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Johannes Sixt, Matthieu Moy, git
In-Reply-To: <7vabdaidwj.fsf@gitster.siamese.dyndns.org>
On Sat, Oct 11, 2008 at 10:24:44PM -0700, Junio C Hamano wrote:
> > echo '* diff=foo' >subdir/.gitattributes
> > git config diff.foo.funcname some-regex
> > ...
> > In practice, this doesn't happen much, because funcname tends to follow
> > the file extension, as does binary-ness.
>
> I find this a highly contrived example. Is this ever be useful in
> practice?
Well, I was doing something like it. But after reading JSixt's messages,
I think I agree that I was probably abusing the attributes system.
> The logic behind the original behaviour was that the file ought to be
> "diff-able" if you are setting up funcname pattern because the funcname
> pattern only makes sense if you are doing the textual diff. In other
> words, "should we do textual diff?" and "what funcname pattern should we
> use?" are _not_ orthogonal, as wanting to configure the latter does imply
> that you do want to see the change in the textual diff format.
Yeah, I don't think I can really disagree with that. I had some vague
notion that it opens the path for adding orthogonal options later. But
really, I'm not sure that any exist, since they are, by definition
related to the diff. Unless we want to have diff driver options for how
to do a binary diff.
> For the same rationale, if you have .textconv, I think it is natural for
> us to say that you do want to see the change in the textual diff format.
> So I'd agree that you can get rid of this .binary business by saying that
> having .textconv marks it diffable (IOW, I think your first alternative
> makes more sense).
OK. My re-rolled series will keep the assumption that a diff=* attribute
makes a file non-binary. However, I will still include the 'binary'
struct member in the diff driver, as it greatly simplifies the code. It
is trivial then to support "diff.*.binary" (which would default to
'false') if we feel like it.
-Peff
^ permalink raw reply
* Re: Fwd: git status options feature suggestion
From: Jeff King @ 2008-10-13 1:06 UTC (permalink / raw)
To: Shawn O. Pearce
Cc: Junio C Hamano, Michael J Gruber, Johannes Schindelin,
Caleb Cushing, git
In-Reply-To: <20081012180504.GD4856@spearce.org>
On Sun, Oct 12, 2008 at 11:05:04AM -0700, Shawn O. Pearce wrote:
> I have a tool that I'll be open-sourcing later this year, but it does
> [...]
> Sorry I can't say too much more about it yet. But I'm trying to
> say that both Scott and I like a denser display like this.
I like what I saw, and I think a "denser" format is what I was trying to
suggest in my earlier message (I just didn't think of nearly as clear a
word). So count me in for your list of people who would like to see this
thing (and would even work on doing a pure-C version).
-Peff
^ permalink raw reply
* Re: Fwd: git status options feature suggestion
From: Jeff King @ 2008-10-13 1:04 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Michael J Gruber, Johannes Schindelin, Caleb Cushing, git
In-Reply-To: <7v1vymgrom.fsf@gitster.siamese.dyndns.org>
On Sun, Oct 12, 2008 at 01:10:01AM -0700, Junio C Hamano wrote:
> One thing to keep in mind is what to do when you would want to detect
> renames. The parallel walk would be Ok but between HEAD and index there
> could be renames involved, and at that point it would get quite tricky.
> Once the index is in-core, I think it hurts us much to walk HEAD vs index
> and index vs working tree in separate passes.
Assuming you meant "I _don't_ think it hurts us much" then OK, that
makes sense. I was just thinking it would be more elegant than holding
each list in memory and comparing, but really that is not all that
different than what diffcore does with the output queue.
> I think it is perfectly fine to run the diff-index first, and keep the
> result from it in a string_list, and then run "diff-files" and annotate
> the string_list with the output from it.
Thanks, I think that is a sane direction to go in. And I agree that any
solution should be totally split from the actual output format, so we
can reuse it in "git status" if desired.
However, now that Shawn has revealed the existence of his super-secret
status replacement, I am going to wait to see that before moving any
further. :)
-Peff
^ permalink raw reply
* Re: Fwd: git status options feature suggestion
From: Jeff King @ 2008-10-13 0:59 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Michael J Gruber, Johannes Schindelin, Caleb Cushing, git
In-Reply-To: <7vwsgef83n.fsf@gitster.siamese.dyndns.org>
On Sun, Oct 12, 2008 at 02:58:20AM -0700, Junio C Hamano wrote:
> > + fd = hold_locked_index(&index_lock, 0);
> > + if (fd < 0) {
> > + if (!status_only)
> > + die("unable to lock index: %s",
> > + strerror(errno));
> > + return get_index_file();
> > + }
> > refresh_cache(REFRESH_QUIET);
>
> You would probably want to refresh_cache() here even if you are not going
> to write the resulting index out, so that you won't show the stat-only
> differences to the end user. Other than that, I think this is a good
> change.
That is a good point. However, I think this change is still not a good
one, because it is only halfway there. It makes "git status" work, but
not "git status path", which wants to write out the resulting cache. I
don't know what complications are involved with making that work.
Probably there is a way, but I haven't looked too closely, as I think a
better path forward is a new tool that is not so closely tied to commit.
-Peff
^ permalink raw reply
* Re: [PATCH] compat/cygwin.c - Use cygwin's stat if core.filemode == true
From: Junio C Hamano @ 2008-10-12 23:39 UTC (permalink / raw)
To: Mark Levedahl; +Cc: spearce, dpotapov, git
In-Reply-To: <48F25CB6.10702@gmail.com>
Mark Levedahl <mlevedahl@gmail.com> writes:
> Junio C Hamano wrote:
>
>> Before you do that, can you explain why git_cygwin_config() should
>> duplicate the setting of that variable instead of using the existing
>> parser for that variable by calling git_default_config()?
>
> I don't like traversing the same list of configuration variables /
> files twice, each time looking for a different variable just so that
> one of those traversals can use a standard function, rather than just
> traversing once and getting exactly what this routine needs; this
> seems wasteful to me. However, I am (obviously) not the maintainer of
> this code so I will do this however it is desired.
I am not sure what you meant by "traversing twice"; when the first call to
stat or lstat is made, you call init_stat() and read the config file,
feeding each and every variable definition to the callback functions. And
then whenever the command implementations call git_config() to getting the
configuration necessary for their own use, they read the config, again
feeding each and every variable definition to the callback functions.
This is "traversing twice" which is unfortunate, but that is not something
you can control from this codepath.
But in any case, I was worried about something different.
If you call git_default_config() as a fallback from git_cygwin_config(),
which is what all the other standard configuration callback functions do,
and/or set trust_executable_bit, command implementations that do not call
git_default_config() on their own would see different trust_executable_bit
value when running on non-Cygwin platform and on Cygwin.
I was wondering if git_cygwin_config() was originally written not to call
git_default_config() because some command implementations do not to want
to call git_default_core_config() (and/or read trust_executable_bit
variable from the configuration) for some reason (which would be just
hiding bugs in other parts of the system, I suspect).
If that is the case, we would have to fix such broken parts of the system,
but until that happens your original patch to use a separate variable and
keeping trust_executable_bit untouched would be much safer than this
latest patch. Hence the question.
^ permalink raw reply
* [JGIT PATCH 4/4] Intelligent parsing of ambiguously encoded meta data.
From: Robin Rosenberg @ 2008-10-12 22:51 UTC (permalink / raw)
To: spearce; +Cc: git, Robin Rosenberg
In-Reply-To: <1223851860-13068-4-git-send-email-robin.rosenberg@dewire.com>
We cannot trust meta data to be encoded in any particular way, so we try
different encodings. First we try UTF-8, which is the only sane encoding
for non-local data, even when used in regions where eight bit legacy
encodings are common. The chance of mistakenly parsing non-UTF-8 data
as valid UTF-8 is varies from extremely low (western encodings) to low
for most other encodings. If the data does not look like UTF-8, we try the
suggested encoding. If that fails we try the user locale and finally, if
that fails we try ISO-8859-1, which cannot fail.
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
---
.../spearce/jgit/revwalk/RevCommitParseTest.java | 119 ++++++++++++++++++++
.../src/org/spearce/jgit/util/RawParseUtils.java | 63 ++++++++++-
2 files changed, 179 insertions(+), 3 deletions(-)
diff --git a/org.spearce.jgit.test/tst/org/spearce/jgit/revwalk/RevCommitParseTest.java b/org.spearce.jgit.test/tst/org/spearce/jgit/revwalk/RevCommitParseTest.java
index 3d9d42d..805e29e 100644
--- a/org.spearce.jgit.test/tst/org/spearce/jgit/revwalk/RevCommitParseTest.java
+++ b/org.spearce.jgit.test/tst/org/spearce/jgit/revwalk/RevCommitParseTest.java
@@ -37,6 +37,8 @@
package org.spearce.jgit.revwalk;
+import java.io.ByteArrayOutputStream;
+
import org.spearce.jgit.lib.ObjectId;
import org.spearce.jgit.lib.PersonIdent;
import org.spearce.jgit.lib.RepositoryTestCase;
@@ -130,6 +132,123 @@ public void testParse_WeirdHeaderOnlyCommit() throws Exception {
assertEquals("", c.getShortMessage());
}
+ public void testParse_implicit_UTF8_encoded() throws Exception {
+ final ByteArrayOutputStream b = new ByteArrayOutputStream();
+ b.write("tree 9788669ad918b6fcce64af8882fc9a81cb6aba67\n".getBytes("UTF-8"));
+ b.write("author F\u00f6r fattare <a_u_thor@example.com> 1218123387 +0700\n".getBytes("UTF-8"));
+ b.write("committer C O. Miter <c@example.com> 1218123390 -0500\n".getBytes("UTF-8"));
+ b.write("\n".getBytes("UTF-8"));
+ b.write("Sm\u00f6rg\u00e5sbord\n".getBytes("UTF-8"));
+ b.write("\n".getBytes("UTF-8"));
+ b.write("\u304d\u308c\u3044\n".getBytes("UTF-8"));
+ final RevCommit c;
+ c = new RevCommit(id("9473095c4cb2f12aefe1db8a355fe3fafba42f67")); // bogus id
+ c.parseCanonical(new RevWalk(db), b.toByteArray());
+
+ assertEquals("F\u00f6r fattare", c.getAuthorIdent().getName());
+ assertEquals("Sm\u00f6rg\u00e5sbord", c.getShortMessage());
+ assertEquals("Sm\u00f6rg\u00e5sbord\n\n\u304d\u308c\u3044\n", c.getFullMessage());
+ }
+
+ public void testParse_implicit_mixed_encoded() throws Exception {
+ final ByteArrayOutputStream b = new ByteArrayOutputStream();
+ b.write("tree 9788669ad918b6fcce64af8882fc9a81cb6aba67\n".getBytes("UTF-8"));
+ b.write("author F\u00f6r fattare <a_u_thor@example.com> 1218123387 +0700\n".getBytes("ISO-8859-1"));
+ b.write("committer C O. Miter <c@example.com> 1218123390 -0500\n".getBytes("UTF-8"));
+ b.write("\n".getBytes("UTF-8"));
+ b.write("Sm\u00f6rg\u00e5sbord\n".getBytes("UTF-8"));
+ b.write("\n".getBytes("UTF-8"));
+ b.write("\u304d\u308c\u3044\n".getBytes("UTF-8"));
+ final RevCommit c;
+ c = new RevCommit(id("9473095c4cb2f12aefe1db8a355fe3fafba42f67")); // bogus id
+ c.parseCanonical(new RevWalk(db), b.toByteArray());
+
+ assertEquals("F\u00f6r fattare", c.getAuthorIdent().getName());
+ assertEquals("Sm\u00f6rg\u00e5sbord", c.getShortMessage());
+ assertEquals("Sm\u00f6rg\u00e5sbord\n\n\u304d\u308c\u3044\n", c.getFullMessage());
+ }
+
+ /**
+ * Test parsing of a commit whose encoding is given and works.
+ *
+ * @throws Exception
+ */
+ public void testParse_explicit_encoded() throws Exception {
+ final ByteArrayOutputStream b = new ByteArrayOutputStream();
+ b.write("tree 9788669ad918b6fcce64af8882fc9a81cb6aba67\n".getBytes("EUC-JP"));
+ b.write("author F\u00f6r fattare <a_u_thor@example.com> 1218123387 +0700\n".getBytes("EUC-JP"));
+ b.write("committer C O. Miter <c@example.com> 1218123390 -0500\n".getBytes("EUC-JP"));
+ b.write("encoding euc_JP\n".getBytes("EUC-JP"));
+ b.write("\n".getBytes("EUC-JP"));
+ b.write("\u304d\u308c\u3044\n".getBytes("EUC-JP"));
+ b.write("\n".getBytes("EUC-JP"));
+ b.write("Hi\n".getBytes("EUC-JP"));
+ final RevCommit c;
+ c = new RevCommit(id("9473095c4cb2f12aefe1db8a355fe3fafba42f67")); // bogus id
+ c.parseCanonical(new RevWalk(db), b.toByteArray());
+
+ assertEquals("F\u00f6r fattare", c.getAuthorIdent().getName());
+ assertEquals("\u304d\u308c\u3044", c.getShortMessage());
+ assertEquals("\u304d\u308c\u3044\n\nHi\n", c.getFullMessage());
+ }
+
+ /**
+ * This is a twisted case, but show what we expect here. We can revise the
+ * expectations provided this case is updated.
+ *
+ * What happens here is that an encoding us given, but data is not encoded
+ * that way (and we can detect it), so we try other encodings.
+ *
+ * @throws Exception
+ */
+ public void testParse_explicit_bad_encoded() throws Exception {
+ final ByteArrayOutputStream b = new ByteArrayOutputStream();
+ b.write("tree 9788669ad918b6fcce64af8882fc9a81cb6aba67\n".getBytes("UTF-8"));
+ b.write("author F\u00f6r fattare <a_u_thor@example.com> 1218123387 +0700\n".getBytes("ISO-8859-1"));
+ b.write("committer C O. Miter <c@example.com> 1218123390 -0500\n".getBytes("UTF-8"));
+ b.write("encoding EUC-JP\n".getBytes("UTF-8"));
+ b.write("\n".getBytes("UTF-8"));
+ b.write("\u304d\u308c\u3044\n".getBytes("UTF-8"));
+ b.write("\n".getBytes("UTF-8"));
+ b.write("Hi\n".getBytes("UTF-8"));
+ final RevCommit c;
+ c = new RevCommit(id("9473095c4cb2f12aefe1db8a355fe3fafba42f67")); // bogus id
+ c.parseCanonical(new RevWalk(db), b.toByteArray());
+
+ assertEquals("F\u00f6r fattare", c.getAuthorIdent().getName());
+ assertEquals("\u304d\u308c\u3044", c.getShortMessage());
+ assertEquals("\u304d\u308c\u3044\n\nHi\n", c.getFullMessage());
+ }
+
+ /**
+ * This is a twisted case too, but show what we expect here. We can revise the
+ * expectations provided this case is updated.
+ *
+ * What happens here is that an encoding us given, but data is not encoded
+ * that way (and we can detect it), so we try other encodings. Here data could
+ * actually be decoded in the stated encoding, but we overide using UTF-8.
+ *
+ * @throws Exception
+ */
+ public void testParse_explicit_bad_encoded2() throws Exception {
+ final ByteArrayOutputStream b = new ByteArrayOutputStream();
+ b.write("tree 9788669ad918b6fcce64af8882fc9a81cb6aba67\n".getBytes("UTF-8"));
+ b.write("author F\u00f6r fattare <a_u_thor@example.com> 1218123387 +0700\n".getBytes("UTF-8"));
+ b.write("committer C O. Miter <c@example.com> 1218123390 -0500\n".getBytes("UTF-8"));
+ b.write("encoding ISO-8859-1\n".getBytes("UTF-8"));
+ b.write("\n".getBytes("UTF-8"));
+ b.write("\u304d\u308c\u3044\n".getBytes("UTF-8"));
+ b.write("\n".getBytes("UTF-8"));
+ b.write("Hi\n".getBytes("UTF-8"));
+ final RevCommit c;
+ c = new RevCommit(id("9473095c4cb2f12aefe1db8a355fe3fafba42f67")); // bogus id
+ c.parseCanonical(new RevWalk(db), b.toByteArray());
+
+ assertEquals("F\u00f6r fattare", c.getAuthorIdent().getName());
+ assertEquals("\u304d\u308c\u3044", c.getShortMessage());
+ assertEquals("\u304d\u308c\u3044\n\nHi\n", c.getFullMessage());
+ }
+
public void testParse_NoMessage() throws Exception {
final String msg = "";
final RevCommit c = create(msg);
diff --git a/org.spearce.jgit/src/org/spearce/jgit/util/RawParseUtils.java b/org.spearce.jgit/src/org/spearce/jgit/util/RawParseUtils.java
index a31734b..7c16394 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/util/RawParseUtils.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/util/RawParseUtils.java
@@ -42,7 +42,10 @@
import static org.spearce.jgit.lib.ObjectChecker.encoding;
import java.nio.ByteBuffer;
+import java.nio.charset.CharacterCodingException;
import java.nio.charset.Charset;
+import java.nio.charset.CharsetDecoder;
+import java.nio.charset.CodingErrorAction;
import java.util.Arrays;
import org.spearce.jgit.lib.Constants;
@@ -376,7 +379,10 @@ public static PersonIdent parsePersonIdent(final byte[] raw, final int nameB) {
}
/**
- * Decode a region of the buffer under the specified character set.
+ * Decode a region of the buffer under the specified character set if possible.
+ *
+ * If the byte stream cannot be decoded that way, the platform default is tried
+ * and if that too fails, the fail-safe ISO-8859-1 encoding is tried.
*
* @param cs
* character set to use when decoding the buffer.
@@ -393,12 +399,63 @@ public static PersonIdent parsePersonIdent(final byte[] raw, final int nameB) {
public static String decode(final Charset cs, final byte[] buffer,
final int start, final int end) {
final ByteBuffer b = ByteBuffer.wrap(buffer, start, end - start);
- return cs.decode(b).toString();
+ b.mark();
+ for (int i = 0;; ++i) {
+ try {
+ Charset charset;
+ switch (i) {
+ case 0:
+ /*
+ * Try our built-in favorite. The assumption here is that
+ * decoding will fail if the data is not actually encoded
+ * using that encoder.
+ */
+ charset = Constants.CHARSET;
+ break;
+ case 1:
+ /*
+ * Try the suggested encoding, it might be right since it
+ * was provided
+ */
+ if (cs.equals(Constants.CHARSET))
+ continue;
+ b.reset();
+ charset = cs;
+ break;
+ case 2:
+ /*
+ * Try the default character set. A small group of people
+ * might actually use the same (or very similar) locale.
+ */
+ charset = Charset.defaultCharset();
+ if (charset.equals(Constants.CHARSET))
+ continue;
+ if (charset.equals(cs))
+ continue;
+ b.reset();
+ break;
+ default:
+ /*
+ * This one is to make sure we do no fail. Data may look
+ * funny but there is nothing we can do here withou much
+ * more advanced guessing.
+ */
+ b.reset();
+ charset = Charset.forName("ISO-8859-1");
+ }
+ CharsetDecoder d = charset.newDecoder();
+ d.onMalformedInput(CodingErrorAction.REPORT);
+ d.onUnmappableCharacter(CodingErrorAction.REPORT);
+ return d.decode(b).toString();
+ } catch (CharacterCodingException e1) {
+ continue;
+ }
+ }
}
/**
* Locate the position of the commit message body.
- *
+ *
* @param b
* buffer to scan.
* @param ptr
--
1.6.0.2.308.gef4a
^ permalink raw reply related
* [JGIT PATCH 3/4] The git config file is case insensitive
From: Robin Rosenberg @ 2008-10-12 22:50 UTC (permalink / raw)
To: spearce; +Cc: git, Robin Rosenberg
In-Reply-To: <1223851860-13068-3-git-send-email-robin.rosenberg@dewire.com>
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
---
.../org/spearce/jgit/lib/RepositoryConfigTest.java | 8 ++++++++
.../src/org/spearce/jgit/lib/RepositoryConfig.java | 18 ++++++++++++------
2 files changed, 20 insertions(+), 6 deletions(-)
diff --git a/org.spearce.jgit.test/tst/org/spearce/jgit/lib/RepositoryConfigTest.java b/org.spearce.jgit.test/tst/org/spearce/jgit/lib/RepositoryConfigTest.java
index da7e704..bd5329c 100644
--- a/org.spearce.jgit.test/tst/org/spearce/jgit/lib/RepositoryConfigTest.java
+++ b/org.spearce.jgit.test/tst/org/spearce/jgit/lib/RepositoryConfigTest.java
@@ -109,4 +109,12 @@ assertTrue(Arrays.equals(values.toArray(), repositoryConfig
.getStringList("my", null, "somename")));
checkFile(cfgFile, "[my]\n\tsomename = value1\n\tsomename = value2\n");
}
+
+ public void test006_readCaseInsensitive() throws IOException {
+ final File path = writeTrashFile("config_001", "[Foo]\nBar\n");
+ RepositoryConfig repositoryConfig = new RepositoryConfig(null, path);
+ System.out.println(repositoryConfig.getString("foo", null, "bar"));
+ assertEquals(true, repositoryConfig.getBoolean("foo", null, "bar", false));
+ assertEquals("", repositoryConfig.getString("foo", null, "bar"));
+ }
}
diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/RepositoryConfig.java b/org.spearce.jgit/src/org/spearce/jgit/lib/RepositoryConfig.java
index 45c2f8a..7a34cde 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/lib/RepositoryConfig.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/RepositoryConfig.java
@@ -52,12 +52,13 @@
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Collections;
-import java.util.HashMap;
+import java.util.Comparator;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
+import java.util.TreeMap;
import org.spearce.jgit.util.FS;
@@ -236,9 +237,9 @@ protected boolean getBoolean(final String section, String subsection,
return defaultValue;
n = n.toLowerCase();
- if (MAGIC_EMPTY_VALUE.equals(n) || "yes".equals(n) || "true".equals(n) || "1".equals(n)) {
+ if (MAGIC_EMPTY_VALUE.equals(n) || "yes".equalsIgnoreCase(n) || "true".equalsIgnoreCase(n) || "1".equals(n)) {
return true;
- } else if ("no".equals(n) || "false".equals(n) || "0".equals(n)) {
+ } else if ("no".equalsIgnoreCase(n) || "false".equalsIgnoreCase(n) || "0".equalsIgnoreCase(n)) {
return false;
} else {
throw new IllegalArgumentException("Invalid boolean value: "
@@ -300,7 +301,7 @@ public String getString(final String section, String subsection, final String na
final Set<String> result = new HashSet<String>();
for (final Entry e : entries) {
- if (section.equals(e.base) && e.extendedBase != null)
+ if (section.equalsIgnoreCase(e.base) && e.extendedBase != null)
result.add(e.extendedBase);
}
if (baseConfig != null)
@@ -682,7 +683,12 @@ public void load() throws IOException {
private void clear() {
entries = new ArrayList<Entry>();
- byName = new HashMap<String, Object>();
+ byName = new TreeMap<String, Object>(new Comparator<String>() {
+
+ public int compare(String o1, String o2) {
+ return o1.compareToIgnoreCase(o2);
+ }
+ });
}
@SuppressWarnings("unchecked")
@@ -954,7 +960,7 @@ private static boolean eq(final String a, final String b) {
return true;
if (a == null || b == null)
return false;
- return a.equals(b);
+ return a.equalsIgnoreCase(b);
}
}
}
--
1.6.0.2.308.gef4a
^ permalink raw reply related
* [JGIT PATCH 2/4] jgit programs: Use i18n.logOutputEncoding or user's locale for output
From: Robin Rosenberg @ 2008-10-12 22:50 UTC (permalink / raw)
To: spearce; +Cc: git, Robin Rosenberg
In-Reply-To: <1223851860-13068-2-git-send-email-robin.rosenberg@dewire.com>
We should present the data in the user's locale to make it readable.
This prevents garbage from being displayed for user's whose locale is not
UTF-8, when non-ascii appears in most cases. If the characters cannot be
converted garbage will appear in any case.
When jgit gains the capability to present blob data this code must be
replaced to handle data and metadata differently.
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
---
.../src/org/spearce/jgit/pgm/TextBuiltin.java | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/org.spearce.jgit.pgm/src/org/spearce/jgit/pgm/TextBuiltin.java b/org.spearce.jgit.pgm/src/org/spearce/jgit/pgm/TextBuiltin.java
index a68d87c..d1bf9e0 100644
--- a/org.spearce.jgit.pgm/src/org/spearce/jgit/pgm/TextBuiltin.java
+++ b/org.spearce.jgit.pgm/src/org/spearce/jgit/pgm/TextBuiltin.java
@@ -86,8 +86,15 @@ final void setCommandName(final String name) {
void init(final Repository repo) {
try {
- out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(
- System.out, "UTF-8")));
+ String outputEncoding = repo.getConfig().getString("i18n", null,
+ "logOutputEncoding");
+ System.out.println("Encoding = "+ outputEncoding);
+ if (outputEncoding != null)
+ out = new PrintWriter(new BufferedWriter(
+ new OutputStreamWriter(System.out, outputEncoding)));
+ else
+ out = new PrintWriter(new BufferedWriter(
+ new OutputStreamWriter(System.out)));
} catch (IOException e) {
throw die("cannot create output stream");
}
--
1.6.0.2.308.gef4a
^ permalink raw reply related
* [JGIT PATCH 0/4] Decodings
From: Robin Rosenberg @ 2008-10-12 22:50 UTC (permalink / raw)
To: spearce; +Cc: git
These patches might be slightly controversial. Since there is no perfect
solution, we may want to try something that works to some extent and gives
what a user might expect, i.e. presenting to a viewer the same glyphs
that the user who entered them saw, to the extent it is possible.
We already handle commit messages like this for the old style objects (sort of).
This patch set also affects other data like refs. Currenly no sane solution
exists in git so nothing really works well outside the non-ascii range for
refs anyway so we can discuss what should happen with refs that contain
non-ascii characters. The best thing is to avoid them, but some of us live
in countries with funny dots in what we do and other have even stranger ways
of expressing what they do, and hence things like branch names etc.
Legacy SCM to GIT conversion programs seem to do every variation of transcoding/
not transcoding commit messages and file names to UTF-8 so there is an issue here.
The nice thing about transcoding filenames to UTF-8 is that they work on all
platforms. A non-UTF-8 filename in a UTF-8 environement doesn't. In particular
such filenames are more or less inaccessible to a Java programs. For the reverse
case it looks really bad. C Git currently does not transform file names. Missing from
this patch set is test cases. As it is quite undefined in git what happens that
is sort of ok so far, but I'd like to define it too in the same way.
-- robin
^ permalink raw reply
* [JGIT PATCH 1/4] log command: Use explicit US locale for dates
From: Robin Rosenberg @ 2008-10-12 22:50 UTC (permalink / raw)
To: spearce; +Cc: git, Robin Rosenberg
In-Reply-To: <1223851860-13068-1-git-send-email-robin.rosenberg@dewire.com>
The format used is a variation of the US locale and looks odd when localized
anyway so do not try to localize it.
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
---
.../src/org/spearce/jgit/pgm/Log.java | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/org.spearce.jgit.pgm/src/org/spearce/jgit/pgm/Log.java b/org.spearce.jgit.pgm/src/org/spearce/jgit/pgm/Log.java
index e16387b..e3a32c8 100644
--- a/org.spearce.jgit.pgm/src/org/spearce/jgit/pgm/Log.java
+++ b/org.spearce.jgit.pgm/src/org/spearce/jgit/pgm/Log.java
@@ -40,6 +40,7 @@
import java.text.DateFormat;
import java.text.SimpleDateFormat;
+import java.util.Locale;
import java.util.TimeZone;
import org.spearce.jgit.lib.PersonIdent;
@@ -52,7 +53,7 @@
private final DateFormat fmt;
Log() {
- fmt = new SimpleDateFormat("EEE MMM dd HH:mm:ss yyyy ZZZZZ");
+ fmt = new SimpleDateFormat("EEE MMM dd HH:mm:ss yyyy ZZZZZ", Locale.US);
}
@Override
--
1.6.0.2.308.gef4a
^ permalink raw reply related
* Re: [StGit PATCH 0/4] More tutorial updates
From: Catalin Marinas @ 2008-10-12 22:10 UTC (permalink / raw)
To: Karl Hasselström; +Cc: git
In-Reply-To: <20081012150825.17648.3315.stgit@yoghurt>
2008/10/12 Karl Hasselström <kha@treskal.com>:
> More updates to the tutorial. I'd really appreciate if people would
> sanity check these; a bad tutorial tends to reflect negatively on a
> project.
I merge kha/safe into master and I'll post patches against it. Thanks.
--
Catalin
^ permalink raw reply
* [ANNOUNCE] Magit 0.6 (Emacs interface for Git)
From: Marius Vollmer @ 2008-10-12 21:49 UTC (permalink / raw)
To: git
Hi,
I am happy to announce the second pre-release of Magit. Get it here:
http://zagadka.vm.bytemark.co.uk/magit/
Almost everything has changed. Please read the manual again. Some
highlights:
* Magit now works with Git 1.6.0. (John Wiegley)
* Support for interactive rewriting.
* Sections can be shown and hidden.
* Staging, unstaging, applying, reverting and discarding changes can
now be done line-by-line, not only hunk-by-hunk.
^ permalink raw reply
* Re: [PATCH] Teach/Fix git-pull/git-merge --quiet and --verbose
From: Tuncer Ayaz @ 2008-10-12 21:36 UTC (permalink / raw)
To: Shawn O. Pearce; +Cc: git
In-Reply-To: <4ac8254d0810121431v1a67afc8ua92842b3d8c39328@mail.gmail.com>
On Sun, Oct 12, 2008 at 11:31 PM, Tuncer Ayaz <tuncer.ayaz@gmail.com> wrote:
> On Sun, Oct 12, 2008 at 10:08 PM, Shawn O. Pearce <spearce@spearce.org> wrote:
>> Tuncer Ayaz <tuncer.ayaz@gmail.com> wrote:
>
> <snip>
>
> I've incorporated all defects as noticed by Shawn and
I did of course intend to write
s/incorporated/repaired/ :-)
> thanks to him found out that the changes in
> squash_message() are definitely not needed and are
> more of a left-over of my tryout/devel session.
> Moreover I've avoided further whitespace changes.
<snip>
^ permalink raw reply
* Re: [PATCH] Teach/Fix git-pull/git-merge --quiet and --verbose
From: Tuncer Ayaz @ 2008-10-12 21:31 UTC (permalink / raw)
To: Shawn O. Pearce; +Cc: git
In-Reply-To: <20081012200833.GC5255@spearce.org>
On Sun, Oct 12, 2008 at 10:08 PM, Shawn O. Pearce <spearce@spearce.org> wrote:
> Tuncer Ayaz <tuncer.ayaz@gmail.com> wrote:
<snip>
I've incorporated all defects as noticed by Shawn and
thanks to him found out that the changes in
squash_message() are definitely not needed and are
more of a left-over of my tryout/devel session.
Moreover I've avoided further whitespace changes.
---
>From 31fd16eccf2df334aef8fb59d4e48cf97cca93eb Mon Sep 17 00:00:00 2001
From: Tuncer Ayaz <tuncer.ayaz@gmail.com>
Date: Sun, 12 Oct 2008 23:27:14 +0200
Subject: [PATCH] Teach/Fix git-pull/git-merge --quiet and --verbose
Signed-off-by: Tuncer Ayaz <tuncer.ayaz@gmail.com>
---
Documentation/merge-options.txt | 8 ++++++++
builtin-fetch.c | 5 +++--
builtin-merge.c | 22 +++++++++++++++-------
git-pull.sh | 10 ++++++++--
4 files changed, 34 insertions(+), 11 deletions(-)
diff --git a/Documentation/merge-options.txt b/Documentation/merge-options.txt
index 007909a..427cdef 100644
--- a/Documentation/merge-options.txt
+++ b/Documentation/merge-options.txt
@@ -1,3 +1,11 @@
+-q::
+--quiet::
+ Operate quietly.
+
+-v::
+--verbose::
+ Be verbose.
+
--stat::
Show a diffstat at the end of the merge. The diffstat is also
controlled by the configuration option merge.stat.
diff --git a/builtin-fetch.c b/builtin-fetch.c
index ee93d3a..287ce33 100644
--- a/builtin-fetch.c
+++ b/builtin-fetch.c
@@ -372,12 +372,13 @@ static int store_updated_refs(const char *url,
const char *remote_name,
SUMMARY_WIDTH, *kind ? kind : "branch",
REFCOL_WIDTH, *what ? what : "HEAD");
if (*note) {
- if (!shown_url) {
+ if ((verbose || !quiet) && !shown_url) {
fprintf(stderr, "From %.*s\n",
url_len, url);
shown_url = 1;
}
- fprintf(stderr, " %s\n", note);
+ if (verbose || !quiet)
+ fprintf(stderr, " %s\n", note);
}
}
fclose(fp);
diff --git a/builtin-merge.c b/builtin-merge.c
index 38266ba..dc12a2a 100644
--- a/builtin-merge.c
+++ b/builtin-merge.c
@@ -44,6 +44,7 @@ static const char * const builtin_merge_usage[] = {
static int show_diffstat = 1, option_log, squash;
static int option_commit = 1, allow_fast_forward = 1;
static int allow_trivial = 1, have_message;
+static int quiet, verbose;
static struct strbuf merge_msg;
static struct commit_list *remoteheads;
static unsigned char head[20], stash[20];
@@ -152,6 +153,8 @@ static int option_parse_n(const struct option *opt,
}
static struct option builtin_merge_options[] = {
+ OPT__QUIET(&quiet),
+ OPT__VERBOSE(&verbose),
{ OPTION_CALLBACK, 'n', NULL, NULL, NULL,
"do not show a diffstat at the end of the merge",
PARSE_OPT_NOARG, option_parse_n },
@@ -250,7 +253,8 @@ static void restore_state(void)
/* This is called when no merge was necessary. */
static void finish_up_to_date(const char *msg)
{
- printf("%s%s\n", squash ? " (nothing to squash)" : "", msg);
+ if (verbose || !quiet)
+ printf("%s%s\n", squash ? " (nothing to squash)" : "", msg);
drop_save();
}
@@ -333,14 +337,15 @@ static void finish(const unsigned char
*new_head, const char *msg)
if (!msg)
strbuf_addstr(&reflog_message, getenv("GIT_REFLOG_ACTION"));
else {
- printf("%s\n", msg);
+ if (verbose || !quiet)
+ printf("%s\n", msg);
strbuf_addf(&reflog_message, "%s: %s",
getenv("GIT_REFLOG_ACTION"), msg);
}
if (squash) {
squash_message();
} else {
- if (!merge_msg.len)
+ if ((verbose || !quiet) && !merge_msg.len)
printf("No merge message -- not updating HEAD\n");
else {
const char *argv_gc_auto[] = { "gc", "--auto", NULL };
@@ -877,6 +882,8 @@ int cmd_merge(int argc, const char **argv, const
char *prefix)
argc = parse_options(argc, argv, builtin_merge_options,
builtin_merge_usage, 0);
+ if (!verbose && quiet)
+ show_diffstat = 0;
if (squash) {
if (!allow_fast_forward)
@@ -1020,10 +1027,11 @@ int cmd_merge(int argc, const char **argv,
const char *prefix)
strcpy(hex, find_unique_abbrev(head, DEFAULT_ABBREV));
- printf("Updating %s..%s\n",
- hex,
- find_unique_abbrev(remoteheads->item->object.sha1,
- DEFAULT_ABBREV));
+ if (verbose || !quiet)
+ printf("Updating %s..%s\n",
+ hex,
+ find_unique_abbrev(remoteheads->item->object.sha1,
+ DEFAULT_ABBREV));
strbuf_init(&msg, 0);
strbuf_addstr(&msg, "Fast forward");
if (have_message)
diff --git a/git-pull.sh b/git-pull.sh
index 75c3610..8e25d44 100755
--- a/git-pull.sh
+++ b/git-pull.sh
@@ -16,6 +16,7 @@ cd_to_toplevel
test -z "$(git ls-files -u)" ||
die "You are in the middle of a conflicted merge."
+quiet= verbose=
strategy_args= no_stat= no_commit= squash= no_ff= log_arg=
curr_branch=$(git symbolic-ref -q HEAD)
curr_branch_short=$(echo "$curr_branch" | sed "s|refs/heads/||")
@@ -23,6 +24,10 @@ rebase=$(git config --bool branch.$curr_branch_short.rebase)
while :
do
case "$1" in
+ -q|--quiet)
+ quiet=-q ;;
+ -v|--verbose)
+ verbose=-v ;;
-n|--no-stat|--no-summary)
no_stat=-n ;;
--stat|--summary)
@@ -121,7 +126,7 @@ test true = "$rebase" && {
"refs/remotes/$origin/$reflist" 2>/dev/null)"
}
orig_head=$(git rev-parse --verify HEAD 2>/dev/null)
-git fetch --update-head-ok "$@" || exit 1
+git fetch $verbose $quiet --update-head-ok "$@" || exit 1
curr_head=$(git rev-parse --verify HEAD 2>/dev/null)
if test "$curr_head" != "$orig_head"
@@ -181,5 +186,6 @@ merge_name=$(git fmt-merge-msg $log_arg
<"$GIT_DIR/FETCH_HEAD") || exit
test true = "$rebase" &&
exec git-rebase $strategy_args --onto $merge_head \
${oldremoteref:-$merge_head}
-exec git-merge $no_stat $no_commit $squash $no_ff $log_arg $strategy_args \
+exec git-merge $quiet $verbose $no_stat $no_commit \
+ $squash $no_ff $log_arg $strategy_args \
"$merge_name" HEAD $merge_head
--
1.6.0.2.GIT
^ permalink raw reply related
* What's cooking in git/spearce.git (Oct 2008, #02; Sun, 12)
From: Shawn O. Pearce @ 2008-10-12 21:25 UTC (permalink / raw)
To: git; +Cc: Junio C Hamano
What's cooking in git/spearce.git (Oct 2008, #02; Sun, 12)
--------------------------------------------------
Here are the topics that have been cooking. Commits prefixed
with '-' are only in 'pu' while commits prefixed with '+' are
in 'next'.
The topics list the commits in reverse chronological order. The topics
meant to be merged to the maintenance series have "maint-" in their names.
gitster's back and I'm expecting he will take over from here.
----------------------------------------------------------------
[New Topics]
* dp/checkattr (Tue Oct 7 04:16:52 2008 +0400) 2 commits
+ check-attr: Add --stdin option
+ check-attr: add an internal check_attr() function
Batch attr lookup via --stdin, for gitk and git-gui.
* mv/clonev (Thu Oct 9 01:40:32 2008 +0200) 1 commit
+ Implement git clone -v
Does what it says it does. This may be ready for master soon,
its a pretty trivial change.
* gb/refactor-pathinfo (Fri Oct 10 20:42:26 2008 +0200) 1 commit
+ gitweb: refactor input parameters parse/validation
A major cleanup on the way gitweb parses its input arguments.
Future gitweb patches to add more arguments into the PATH_INFO
depend upon this initial cleanup work.
* ml/cygwin-filemode (Sun Oct 12 14:44:46 2008 -0400) 1 commit
- compat/cygwin.c - Use cygwin's stat if core.filemode == true
I think another version may be coming to reuse the core.filemode
parsing so this patch isn't in next yet.
* sh/rebase-i-p (Wed Oct 8 01:41:57 2008 -0500) 7 commits
- rebase-i-p: if todo was reordered use HEAD as the rewritten parent
- rebase-i-p: do not include non-first-parent commits touching
UPSTREAM
- rebase-i-p: only list commits that require rewriting in todo
- rebase-i-p: fix 'no squashing merges' tripping up non-merges
- rebase-i-p: delay saving current-commit to REWRITTEN if squashing
- rebase-i-p: use HEAD for updating the ref instead of mapping
OLDHEAD
- rebase-i-p: test to exclude commits from todo based on its parents
Changes the `rebase -i -p` behavior to behave like git sequencer's
rewrite of `rebase -i` would behave. Its parked in pu because I
have not had the time to review the series in detail. First glance
looked OK to me.
* js/keephardlinks (Sat Oct 11 13:45:13 2008 +0200) 1 commit
- Introduce core.keepHardLinks
The value of this change is currently in question, and the commit
message doesn't justify it very well.
* jn/gitweb-customlinks (Sun Oct 12 00:02:32 2008 +0200) 1 commit
- gitweb: Better processing format string in custom links in navbar
Waiting for some sort of response from Pasky.
----------------------------------------------------------------
[Graduated to "master"]
* mw/sendemail (Sun Sep 28 07:51:21 2008 +0300) 10 commits
+ bash completion: Add --[no-]validate to "git send-email"
+ send-email: signedoffcc -> signedoffbycc, but handle both
+ Docs: send-email: Create logical groupings for man text
+ Docs: send-email: Create logical groupings for --help text
+ Docs: send-email: Remove unnecessary config variable description
+ Docs: send-email: --chain_reply_to -> --[no-]chain-reply-to
+ send-email: change --no-validate to boolean --[no-]validate
+ Docs: send-email: Man page option ordering
+ Docs: send-email usage text much sexier
+ Docs: send-email's usage text and man page mention same options
* jc/add-ita (Thu Aug 21 01:44:53 2008 -0700) 1 commit
+ git-add --intent-to-add (-N)
* mg/verboseprune (Mon Sep 29 18:49:52 2008 +0200) 1 commit
+ make prune report removed objects on -v
* lt/time-reject-fractional-seconds (Sat Aug 16 21:25:40 2008 -0700) 1 commit
+ date/time: do not get confused by fractional seconds
* dp/cywginstat (Tue Sep 30 17:53:47 2008 +0400) 3 commits
+ cygwin: Use native Win32 API for stat
+ mingw: move common functionality to win32.h
+ add have_git_dir() function
Performance improvement for Cygwin, bypassing the Cygwin stat
function and using one more like MinGW uses. Probably ready for
master on the next round. Several Cygwin users have given praise
to the series.
* js/objc-funchdr (Wed Oct 1 00:46:34 2008 +0100) 1 commit
+ Teach git diff about Objective-C syntax
Adds support for Objective-C function headers.
* dm/svn-branch (Sat Oct 4 19:35:17 2008 -0700) 1 commit
+ Add git-svn branch to allow branch creation in SVN repositories
Adds "git svn branch" to build branches remotely in SVN.
* pb/gitweb (Fri Oct 3 07:41:25 2008 -0700) 7 commits
+ Merge branch 'pb/gitweb-tagcloud' into pb/gitweb
+ gitweb: Support for simple project search form
+ gitweb: Make the by_tag filter delve in forks as well
+ gitweb: Support for tag clouds
+ gitweb: Add support for extending the action bar with custom links
+ gitweb: Sort the list of forks on the summary page by age
+ gitweb: Clean-up sorting of project list
* ph/parseopt (Thu Oct 2 14:59:20 2008 +0200) 3 commits
+ parse-opt: migrate builtin-merge-file.
+ parse-opt: migrate git-merge-base.
+ parse-opt: migrate fmt-merge-msg.
* rz/grepz (Wed Oct 1 18:11:15 2008 +0200) 1 commit
+ git grep: Add "-z/--null" option as in GNU's grep.
* mv/merge-refresh (Fri Oct 3 15:02:31 2008 +0200) 1 commit
+ builtin-merge: refresh the index before calling a strategy
* bc/xdiffnl (Wed Oct 1 14:28:26 2008 -0500) 1 commit
+ xdiff-interface.c: strip newline (and cr) from line before pattern
matching
* jk/maint-soliconv (Fri Oct 3 02:39:36 2008 -0400) 1 commit
+ Makefile: do not set NEEDS_LIBICONV for Solaris 8
* sg/maint-intrebase-msghook (Fri Oct 3 11:33:20 2008 +0200) 2 commits
+ rebase -i: remove leftover debugging
+ rebase -i: proper prepare-commit-msg hook argument when squashing
* bc/maint-stashref (Thu Oct 2 18:52:11 2008 -0500) 1 commit
+ git-stash.sh: fix flawed fix of invalid ref handling (commit
da65e7c1)
The latter three were merged to 'maint' first.
----------------------------------------------------------------
[Old New Topics]
* ns/rebase-noverify (Mon Oct 6 14:14:29 2008 +0900) 1 commit
+ rebase --no-verify
This adds --no-verify to git rebase, to avoid the pre-rebase hook.
Lacks documentation but otherwise looks sound.
* mv/merge-noff (Fri Oct 3 14:04:47 2008 +0200) 1 commit
+ builtin-commit: use reduce_heads() only when appropriate
Fixes "git merge --no-ff --no-commit".
* ae/preservemerge (Mon Sep 29 22:28:57 2008 +0200) 1 commit
+ rebase: Support preserving merges in non-interactive mode
* sh/maint-rebase3 (Sun Oct 5 23:26:52 2008 -0500) 1 commit
- rebase--interactive: fix parent rewriting for dropped commits
A prior version of sh/rebase-i-p. This should be dropped.
* pb/rename-rowin32 (Fri Oct 3 12:20:43 2008 +0200) 1 commit
- Do not rename read-only files during a push
Supposedly fixes pack file renames on Windows, but it makes the
test suite fail on Linux. I haven't debugged why yet. Its very
likely we need a replacement patch before this can move forward.
* sp/describe-lwtag (Tue Sep 30 12:03:41 2008 -0700) 1 commit
- describe: Make --tags and --all match lightweight tags more often
Based on feedback from the list this needs another spin. I will
post a replacement patch soon.
* gb/formatpatch-autonbr (Thu Oct 2 16:55:39 2008 -0400) 1 commit
- format-patch: autonumber by default
Fails the test suite; some of the test vectors need to be updated
to account for the new default. Someone who cares about this
change should follow through on the test suite update, or this may
get dropped.
* jc/merge-whitespace (Sun Feb 24 23:29:36 2008 -0800) 1 commit
. WIP: start teaching the --whitespace=fix to merge machinery
This has a merge conflict with `next` and isn't even in pu right now.
* jk/diff-convfilter (Sun Oct 5 17:43:45 2008 -0400) 4 commits
- diff: add filter for converting binary to text
- diff: introduce diff.<driver>.binary
- diff: unify external diff and funcname parsing code
- t4012: use test_cmp instead of cmp
A general cleanup on how diff drivers are implemented. Its still
missing documentation updates and tests but doesn't break anything
current as far as I can tell. It needs more review before it can
be slated for 'next'.
----------------------------------------------------------------
[Stuck Topics]
* nd/narrow (Wed Oct 1 11:04:09 2008 +0700) 9 commits
- grep: skip files outside sparse checkout area
- checkout_entry(): CE_NO_CHECKOUT on checked out entries.
- Prevent diff machinery from examining worktree outside sparse
checkout
- ls-files: Add tests for --sparse and friends
- update-index: add --checkout/--no-checkout to update
CE_NO_CHECKOUT bit
- update-index: refactor mark_valid() in preparation for new options
- ls-files: add options to support sparse checkout
- Introduce CE_NO_CHECKOUT bit
- Extend index to save more flags
Recently updated with a repost. I've been too swamped at day-job
to actively review the series. There has been some discussion on
list about it so its not stalled, but it needs more eyeballs.
* gb/gitweb-pathinfo (Thu Oct 2 02:10:34 2008 +0200) 6 commits
. gitweb: generate parent..current URLs
. gitweb: parse parent..current syntax from pathinfo
. gitweb: use_pathinfo filenames start with /
. gitweb: generate project/action/hash URLs
. gitweb: refactor input parameters parse/validation
. gitweb: parse project/action/hash_base:filename PATH_INFO
Still going through revisions on the git ML. Its great work and
is heading in the right direction. But the discussion and patch
generation rate is too high to merge the topic into next just yet.
So its waiting for a re-roll of the series once discussion settles
down and there is a final patch series available.
----------------------------------------------------------------
[Stalled -- Needs Action to Proceed (or to be dropped)]
* pb/submodule (Fri Sep 12 23:09:19 2008 +0200) 1 commit
- t7400: Add short "git submodule add" testsuite
Still waiting for a reroll. Should be dropped next week if we
don't get one during this coming week.
* bd/blame (Thu Aug 21 18:22:01 2008 -0500) 5 commits
- Use xdiff caching to improve git blame performance
- Allow xdiff machinery to cache hash results for a file
- Always initialize xpparam_t to 0
- Bypass textual patch generation and parsing in git blame
- Allow alternate "low-level" emit function from xdl_diff
(jc: Réne had good comments on how the callback should be
structured.)
* kb/am-directory (Fri Aug 29 15:27:50 2008 -0700) 1 commit
- git-am: Pass the --directory option through to git-apply
(jc: I think this is still buggy and drops the option when am stops
with conflicts.)
----------------------------------------------------------------
[Will be merged to 'master/maint' soon]
* pb/commit-where (Fri Oct 3 22:13:49 2008 -0400) 4 commits
+ tutorial: update output of git commit
+ reformat informational commit message
+ git commit: Reformat output somewhat
+ builtin-commit.c: show on which branch a commit was added
I think this topic is settled for now.
----------------------------------------------------------------
[Actively Cooking]
* tr/workflow-doc (Sat Sep 13 18:11:01 2008 +0200) 2 commits
+ Documentation: Refer to git-rebase(1) to warn against rewriting
+ Documentation: new upstream rebase recovery section in git-rebase
(jc: My impression from the last round of discusson on the third
patch in this series (not queued here) was that as long as we
do not present it as "One True Workflow", the description was
a good starting point, possibly others to add other recommended
flows later.)
An update came in recently, but I haven't applied it.
----------------------------------------------------------------
[On Hold]
* jc/post-simplify (Fri Aug 15 01:34:51 2008 -0700) 2 commits
- revision --simplify-merges: incremental simplification
- revision --simplify-merges: prepare for incremental simplification
(jc: I started making this incremental but the progress is not
so great.)
* jc/stripspace (Sun Mar 9 00:30:35 2008 -0800) 6 commits
. git-am --forge: add Signed-off-by: line for the author
. git-am: clean-up Signed-off-by: lines
. stripspace: add --log-clean option to clean up signed-off-by:
lines
. stripspace: use parse_options()
. Add "git am -s" test
. git-am: refactor code to add signed-off-by line for the committer
(jc: The one at second from the tip needs reworking.)
* jc/send-pack-tell-me-more (Thu Mar 20 00:44:11 2008 -0700) 1 commit
- "git push": tellme-more protocol extension
This is a great idea, but IIRC its implementation has a deadlock
during communication between the peers. Someone needs to pick up
this topic and resolve the deadlock before it can continue.
* jc/blame (Wed Jun 4 22:58:40 2008 -0700) 2 commits
- blame: show "previous" information in --porcelain/--incremental
format
- git-blame: refactor code to emit "porcelain format" output
* jk/renamelimit (Sat May 3 13:58:42 2008 -0700) 1 commit
- diff: enable "too large a rename" warning when -M/-C is explicitly
asked for
(jc: This would be the right thing to do for command line use,
but gitk will be hit due to tcl/tk's limitation, so I am holding
this back for now.)
--
Shawn.
^ permalink raw reply
* What's in git/spearce.git (Oct 2008, #02; Sun, 12)
From: Shawn O. Pearce @ 2008-10-12 21:25 UTC (permalink / raw)
To: git; +Cc: Junio C Hamano
What's in git/spearce.git (Oct 2008, #02; Sun, 12)
maint 72d404d (test-lib: fix broken printf)
master 5c283eb (Merge branch 'maint')
------------------------------------------------------------------------
* The 'maint' branch has these fixes since the last announcement.
Brandon Casey (2):
builtin-merge.c: allocate correct amount of memory
git-stash.sh: fix flawed fix of invalid ref handling (commit da65e7c1)
Deskin Miller (1):
git init: --bare/--shared overrides system/global config
Imre Deak (1):
builtin-apply: fix typo leading to stack corruption
Jeff King (2):
Makefile: do not set NEEDS_LIBICONV for Solaris 8
git apply --directory broken for new files
Johannes Schindelin (2):
git rm: refresh index before up-to-date check
rebase -i: do not fail when there is no commit to cherry-pick
Johannes Sixt (1):
git-push.txt: Describe --repo option in more detail
Mikael Magnusson (1):
Fix a few typos in relnotes
Miklos Vajna (1):
test-lib: fix color reset in say_color()
Nicolas Pitre (1):
fix pread()'s short read in index-pack
SZEDER Gábor (2):
rebase -i: proper prepare-commit-msg hook argument when squashing
rebase -i: remove leftover debugging
Samuel Tardieu (1):
Do not use errno when pread() returns 0
Shawn O. Pearce (1):
test-lib: fix broken printf
* The 'master' branch has these since the last announcement
in addition to the above.
Brandon Casey (4):
xdiff-interface.c: strip newline (and cr) from line before pattern
matching
Replace xmalloc/memset(0) pairs with xcalloc
t9001: use older Getopt::Long boolean prefix '--no' rather than '--no-'
Replace calls to strbuf_init(&foo, 0) with STRBUF_INIT initializer
Dmitry Potapov (4):
add have_git_dir() function
mingw: move common functionality to win32.h
cygwin: Use native Win32 API for stat
print an error message for invalid path
Florian Ragwitz (1):
Add git-svn branch to allow branch creation in SVN repositories
Jonathan del Strother (1):
Teach git diff about Objective-C syntax
Junio C Hamano (1):
git-add --intent-to-add (-N)
Linus Torvalds (1):
date/time: do not get confused by fractional seconds
Matt McCutchen (1):
"git diff <tree>{3,}": do not reverse order of arguments
Michael J Gruber (1):
make prune report removed objects on -v
Michael Witten (9):
Docs: send-email's usage text and man page mention same options
Docs: send-email usage text much sexier
Docs: send-email: Man page option ordering
send-email: change --no-validate to boolean --[no-]validate
Docs: send-email: --chain_reply_to -> --[no-]chain-reply-to
Docs: send-email: Remove unnecessary config variable description
Docs: send-email: Create logical groupings for --help text
Docs: send-email: Create logical groupings for man text
send-email: signedoffcc -> signedoffbycc, but handle both
Mike Ralphson (1):
gitweb: Sort the list of forks on the summary page by age
Miklos Vajna (2):
builtin-merge: refresh the index before calling a strategy
Cleanup in sha1_file.c::cache_or_unpack_entry()
Petr Baudis (5):
gitweb: Clean-up sorting of project list
gitweb: Add support for extending the action bar with custom links
gitweb: Support for tag clouds
gitweb: Make the by_tag filter delve in forks as well
gitweb: Support for simple project search form
Pierre Habouzit (3):
parse-opt: migrate fmt-merge-msg.
parse-opt: migrate git-merge-base.
parse-opt: migrate builtin-merge-file.
Raphael Zimmerer (1):
git grep: Add "-z/--null" option as in GNU's grep.
Teemu Likonen (1):
bash completion: Add --[no-]validate to "git send-email"
Thomas Rast (1):
Documentation: remove stale howto/rebase-and-edit.txt
--
Shawn.
^ permalink raw reply
* [PATCH/RFC v2] gitweb: Separate %global_features
From: Jakub Narebski @ 2008-10-12 21:00 UTC (permalink / raw)
To: git; +Cc: Jakub Narebski, Petr Baudis
In-Reply-To: <20081012130157.26825.67398.stgit@localhost.localdomain>
Put features for which project specific override is not supported into
separate %global_feature hash, updating gitweb_check_feature()
subroutine to use it. For backward compatibility with existing gitweb
configuration setups $feature{<feature>}{'default'} has preference
over $global_feature{<feature>}.
While at it remove stale comment for 'pathinfo' feature; requiring to
use workaround specified was fixed in b65910f (gitweb: remove
PATH_INFO from $my_url and $my_uri).
FIX IT: some spurious "HASH.." is printed to STDERR.
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
This should be backward compatibile...
gitweb/gitweb.perl | 66 ++++++++++++++++++++++++++--------------------------
1 files changed, 33 insertions(+), 33 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index cc6edbe..88bedec 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -215,13 +215,6 @@ our %feature = (
'override' => 0,
'default' => ['tgz']},
- # Enable text search, which will list the commits which match author,
- # committer or commit text to a given string. Enabled by default.
- # Project specific override is not supported.
- 'search' => {
- 'override' => 0,
- 'default' => [1]},
-
# Enable grep search, which will list the files in currently selected
# tree containing the given string. Enabled by default. This can be
# potentially CPU-intensive, of course.
@@ -248,6 +241,20 @@ our %feature = (
'sub' => \&feature_pickaxe,
'override' => 0,
'default' => [1]},
+);
+
+our %global_feature = (
+ # feature => [ default options...] (array reference)
+ #
+ # For those features project specific override is not supported.
+ # Note that for backwards compatibility of existing gitweb
+ # configurations $feature{<feature>}{'default'} has preference.
+
+ # use gitweb_check_feature(<feature>) to check if <feature> is enabled
+
+ # Enable text search, which will list the commits which match author,
+ # committer or commit text to a given string. Enabled by default.
+ 'search' => [1],
# Make gitweb use an alternative format of the URLs which can be
# more readable and natural-looking: project name is embedded
@@ -257,16 +264,8 @@ our %feature = (
# generates links.
# To enable system wide have in $GITWEB_CONFIG
- # $feature{'pathinfo'}{'default'} = [1];
- # Project specific override is not supported.
-
- # Note that you will need to change the default location of CSS,
- # favicon, logo and possibly other files to an absolute URL. Also,
- # if gitweb.cgi serves as your indexfile, you will need to force
- # $my_uri to contain the script name in your $GITWEB_CONFIG.
- 'pathinfo' => {
- 'override' => 0,
- 'default' => [0]},
+ # $global_feature{'pathinfo'} = [1];
+ 'pathinfo' => [0],
# Make gitweb consider projects in project root subdirectories
# to be forks of existing projects. Given project $projname.git,
@@ -277,11 +276,8 @@ our %feature = (
# to be listed after the main project.
# To enable system wide have in $GITWEB_CONFIG
- # $feature{'forks'}{'default'} = [1];
- # Project specific override is not supported.
- 'forks' => {
- 'override' => 0,
- 'default' => [0]},
+ # $global_feature{'forks'} = [1];
+ 'forks' => [0],
# Insert custom links to the action bar of all project pages.
# This enables you mainly to link to third-party scripts integrating
@@ -296,12 +292,9 @@ our %feature = (
# hash base (hb gitweb parameter); %% expands to %.
# To enable system wide have in $GITWEB_CONFIG e.g.
- # $feature{'actions'}{'default'} = [('graphiclog',
+ # $global_feature{'actions'} = [('graphiclog',
# '/git-browser/by-commit.html?r=%n', 'summary')];
- # Project specific override is not supported.
- 'actions' => {
- 'override' => 0,
- 'default' => []},
+ 'actions' => [],
# Allow gitweb scan project content tags described in ctags/
# of project repository, and display the popular Web 2.0-ish
@@ -315,16 +308,23 @@ our %feature = (
# a pretty tag cloud instead of just a list of tags.
# To enable system wide have in $GITWEB_CONFIG
- # $feature{'ctags'}{'default'} = ['path_to_tag_script'];
+ # $global_feature{'ctags'} = ['path_to_tag_script'];
# Project specific override is not supported.
- 'ctags' => {
- 'override' => 0,
- 'default' => [0]},
+ 'ctags' => [0],
);
sub gitweb_check_feature {
- my ($name) = @_;
- return unless exists $feature{$name};
+ my $name = shift;
+
+ # %feature has precedence over %global_feature for backward
+ # compatibility with pre-existing gitweb configuration setups
+ unless (exists $feature{$name}) {
+ if (exists $global_feature{$name}) {
+ return @{$global_feature{$name}};
+ }
+ return;
+ }
+
my ($sub, $override, @defaults) = (
$feature{$name}{'sub'},
$feature{$name}{'override'},
^ permalink raw reply related
* Re: [PATCH] fetch: refuse to fetch into the current branch in a non-bare repository
From: Daniel Barkalow @ 2008-10-12 20:37 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: git, gitster, spearce
In-Reply-To: <alpine.DEB.1.00.0810111336350.22125@pacific.mpi-cbg.de.mpi-cbg.de>
On Sat, 11 Oct 2008, Johannes Schindelin wrote:
> Some confusing tutorials suggest that it would be a good idea to call
> something like this:
>
> git pull origin master:master
>
> While it might make sense to store what you want to merge, it typically
> is plain wrong. Especially so when the current branch is "master".
>
> Be at least a little bit helpful by refusing to fetch something into
> the current branch.
I think this is the right thing to do.
> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> ---
> builtin-fetch.c | 20 ++++++++++++++++++++
> t/t5505-remote.sh | 2 +-
> t/t5510-fetch.sh | 6 ++++++
> 3 files changed, 28 insertions(+), 2 deletions(-)
>
> diff --git a/builtin-fetch.c b/builtin-fetch.c
> index ee93d3a..d701550 100644
> --- a/builtin-fetch.c
> +++ b/builtin-fetch.c
> @@ -534,6 +534,25 @@ static void find_non_local_tags(struct transport *transport,
> string_list_clear(&new_refs, 0);
> }
>
> +static void check_ref_map(struct ref *ref_map)
> +{
> + int flag;
> + unsigned char sha1[20];
> + const char *HEAD;
> +
> + if (is_bare_repository())
> + return;
> +
> + HEAD = resolve_ref("HEAD", sha1, 1, &flag);
> +
> + if (!HEAD || !(flag & REF_ISSYMREF))
> + return;
remote.h has a function for getting "the current branch", which would save
5 lines here:
struct branch *current_branch = branch_get(NULL);
if (!current_branch || is_bare_repository())
return;
> +
> + for (; ref_map; ref_map = ref_map->next)
> + if (ref_map->peer_ref && !strcmp(HEAD, ref_map->peer_ref->name))
!strcmp(current_branch->ref_name, ref_map->peer_ref->name)
(untested, and might be off by a "refs/" or something)
> + die("Refusing to fetch into current branch");
> +}
> +
> static int do_fetch(struct transport *transport,
> struct refspec *refs, int ref_count)
> {
> @@ -558,6 +577,7 @@ static int do_fetch(struct transport *transport,
> }
>
> ref_map = get_ref_map(transport, refs, ref_count, tags, &autotags);
> + check_ref_map(ref_map);
>
> for (rm = ref_map; rm; rm = rm->next) {
> if (rm->peer_ref)
^ permalink raw reply
* Re: [PATCH] Teach/Fix git-pull/git-merge --quiet and --verbose
From: Tuncer Ayaz @ 2008-10-12 20:29 UTC (permalink / raw)
To: Shawn O. Pearce; +Cc: git
In-Reply-To: <20081012200833.GC5255@spearce.org>
On Sun, Oct 12, 2008 at 10:08 PM, Shawn O. Pearce <spearce@spearce.org> wrote:
> Tuncer Ayaz <tuncer.ayaz@gmail.com> wrote:
>> After fixing clone -q I noticed that pull -q is does not do what
>> it's supposed to do and implemented --quiet/--verbose by
>> adding it to builtin-merge and fixing two places in builtin-fetch.
>
>> diff --git a/builtin-merge.c b/builtin-merge.c
>> index 38266ba..1f601d4 100644
>> --- a/builtin-merge.c
>> +++ b/builtin-merge.c
>> @@ -101,7 +102,7 @@ static struct strategy *get_strategy(const char *name)
>> struct cmdname *ent = main_cmds.names[i];
>> for (j = 0; j < ARRAY_SIZE(all_strategy); j++)
>> if (!strncmp(ent->name, all_strategy[j].name, ent->len)
>> - && !all_strategy[j].name[ent->len])
>> + && !all_strategy[j].name[ent->len])
>
> This hunk seems to just be whitespace formatting. I'd rather not
> see it in a patch that is otherwise about --quiet/--verbose changes.
> One change per patch, please. ;-)
Hi Shawn, thanks for the quick review.
This is a problem caused by my automagic editor
configuration and an oversight. ACK.
>> @@ -282,18 +287,20 @@ static void squash_message(void)
>> if (prepare_revision_walk(&rev))
>> die("revision walk setup failed");
>>
>> - strbuf_init(&out, 0);
>> - strbuf_addstr(&out, "Squashed commit of the following:\n");
>> - while ((commit = get_revision(&rev)) != NULL) {
>> - strbuf_addch(&out, '\n');
>> - strbuf_addf(&out, "commit %s\n",
>> - sha1_to_hex(commit->object.sha1));
>> - pretty_print_commit(rev.commit_format, commit, &out, rev.abbrev,
>> - NULL, NULL, rev.date_mode, 0);
>> + if(verbose || !quiet) {
>> + strbuf_init(&out, 0);
>> + strbuf_addstr(&out, "Squashed commit of the following:\n");
>> + while ((commit = get_revision(&rev)) != NULL) {
>> + strbuf_addch(&out, '\n');
>> + strbuf_addf(&out, "commit %s\n",
>> + sha1_to_hex(commit->object.sha1));
>> + pretty_print_commit(rev.commit_format, commit, &out, rev.abbrev,
>> + NULL, NULL, rev.date_mode, 0);
>> + }
>> + write(fd, out.buf, out.len);
>> + close(fd);
>> + strbuf_release(&out);
>> }
>> - write(fd, out.buf, out.len);
>> - close(fd);
>> - strbuf_release(&out);
>
> This entire hunk strikes me as being completely wrong. The fd
> we are writing to is SQUASH_MSG. It was opened earlier in the
> function and should be closed, even if we put nothing into the
> file. Your change causes --quiet to leak the file descriptor.
>
> But even worse, I think your change causes SQUASH_MSG to lose its
> entire content, which makes "git merge --quiet --squash" behave
> very differently from what it does today, where it at least gives
> you a summary of the commits in the SQUASH_MSG file.
>
> IMHO this hunk shouldn't be here.
You are right, I was not 100% sure whether the assembled
message is only displayed or possibly also stored somewhere.
What would be the right place to quieten this one?
I should have tagged the mail as an RFC :-).
>> @@ -877,6 +885,8 @@ int cmd_merge(int argc, const char **argv, const
>> char *prefix)
>>
>> argc = parse_options(argc, argv, builtin_merge_options,
>> builtin_merge_usage, 0);
>> + if(!verbose && quiet)
>> + show_diffstat = 0;
>
> Formatting nit, use "if (".
ACK.
>> @@ -1019,11 +1029,11 @@ int cmd_merge(int argc, const char **argv,
>> const char *prefix)
>> char hex[41];
>>
>> strcpy(hex, find_unique_abbrev(head, DEFAULT_ABBREV));
>> -
>> - printf("Updating %s..%s\n",
>> - hex,
>> - find_unique_abbrev(remoteheads->item->object.sha1,
>> - DEFAULT_ABBREV));
>> + if(verbose || !quiet)
>
> Formatting nit, use "if (".
ACK.
>> diff --git a/git-pull.sh b/git-pull.sh
>> index 75c3610..d84ceb5 100755
>> --- a/git-pull.sh
>> +++ b/git-pull.sh
>> @@ -16,13 +16,17 @@ cd_to_toplevel
>> test -z "$(git ls-files -u)" ||
>> die "You are in the middle of a conflicted merge."
>>
>> -strategy_args= no_stat= no_commit= squash= no_ff= log_arg=
>> +quiet= verbose= strategy_args= no_stat= no_commit= squash= no_ff= log_arg=
>
> This line got a little long, maybe put the two new ones on a new
> line so we don't overrun the 80 column margin and there's an easier
> to read diff?
ACK.
I will fix the obvious and see what I can come up with for the
pretty_print hunk.
^ permalink raw reply
* Re: [PATCH] compat/cygwin.c - Use cygwin's stat if core.filemode == true
From: Mark Levedahl @ 2008-10-12 20:23 UTC (permalink / raw)
To: Junio C Hamano; +Cc: spearce, dpotapov, git
In-Reply-To: <7vskr1fvys.fsf@gitster.siamese.dyndns.org>
Junio C Hamano wrote:
> Before you do that, can you explain why git_cygwin_config() should
> duplicate the setting of that variable instead of using the existing
> parser for that variable by calling git_default_config()?
>
>
I don't like traversing the same list of configuration variables / files
twice, each time looking for a different variable just so that one of
those traversals can use a standard function, rather than just
traversing once and getting exactly what this routine needs; this seems
wasteful to me. However, I am (obviously) not the maintainer of this
code so I will do this however it is desired.
Mark
^ permalink raw reply
* Re: [PATCH] Teach/Fix git-pull/git-merge --quiet and --verbose
From: Shawn O. Pearce @ 2008-10-12 20:08 UTC (permalink / raw)
To: Tuncer Ayaz; +Cc: git
In-Reply-To: <4ac8254d0810120954x2364054ahf2d49d6fbb7b0bb1@mail.gmail.com>
Tuncer Ayaz <tuncer.ayaz@gmail.com> wrote:
> After fixing clone -q I noticed that pull -q is does not do what
> it's supposed to do and implemented --quiet/--verbose by
> adding it to builtin-merge and fixing two places in builtin-fetch.
> diff --git a/builtin-merge.c b/builtin-merge.c
> index 38266ba..1f601d4 100644
> --- a/builtin-merge.c
> +++ b/builtin-merge.c
> @@ -101,7 +102,7 @@ static struct strategy *get_strategy(const char *name)
> struct cmdname *ent = main_cmds.names[i];
> for (j = 0; j < ARRAY_SIZE(all_strategy); j++)
> if (!strncmp(ent->name, all_strategy[j].name, ent->len)
> - && !all_strategy[j].name[ent->len])
> + && !all_strategy[j].name[ent->len])
This hunk seems to just be whitespace formatting. I'd rather not
see it in a patch that is otherwise about --quiet/--verbose changes.
One change per patch, please. ;-)
> @@ -282,18 +287,20 @@ static void squash_message(void)
> if (prepare_revision_walk(&rev))
> die("revision walk setup failed");
>
> - strbuf_init(&out, 0);
> - strbuf_addstr(&out, "Squashed commit of the following:\n");
> - while ((commit = get_revision(&rev)) != NULL) {
> - strbuf_addch(&out, '\n');
> - strbuf_addf(&out, "commit %s\n",
> - sha1_to_hex(commit->object.sha1));
> - pretty_print_commit(rev.commit_format, commit, &out, rev.abbrev,
> - NULL, NULL, rev.date_mode, 0);
> + if(verbose || !quiet) {
> + strbuf_init(&out, 0);
> + strbuf_addstr(&out, "Squashed commit of the following:\n");
> + while ((commit = get_revision(&rev)) != NULL) {
> + strbuf_addch(&out, '\n');
> + strbuf_addf(&out, "commit %s\n",
> + sha1_to_hex(commit->object.sha1));
> + pretty_print_commit(rev.commit_format, commit, &out, rev.abbrev,
> + NULL, NULL, rev.date_mode, 0);
> + }
> + write(fd, out.buf, out.len);
> + close(fd);
> + strbuf_release(&out);
> }
> - write(fd, out.buf, out.len);
> - close(fd);
> - strbuf_release(&out);
This entire hunk strikes me as being completely wrong. The fd
we are writing to is SQUASH_MSG. It was opened earlier in the
function and should be closed, even if we put nothing into the
file. Your change causes --quiet to leak the file descriptor.
But even worse, I think your change causes SQUASH_MSG to lose its
entire content, which makes "git merge --quiet --squash" behave
very differently from what it does today, where it at least gives
you a summary of the commits in the SQUASH_MSG file.
IMHO this hunk shouldn't be here.
> @@ -877,6 +885,8 @@ int cmd_merge(int argc, const char **argv, const
> char *prefix)
>
> argc = parse_options(argc, argv, builtin_merge_options,
> builtin_merge_usage, 0);
> + if(!verbose && quiet)
> + show_diffstat = 0;
Formatting nit, use "if (".
> @@ -1019,11 +1029,11 @@ int cmd_merge(int argc, const char **argv,
> const char *prefix)
> char hex[41];
>
> strcpy(hex, find_unique_abbrev(head, DEFAULT_ABBREV));
> -
> - printf("Updating %s..%s\n",
> - hex,
> - find_unique_abbrev(remoteheads->item->object.sha1,
> - DEFAULT_ABBREV));
> + if(verbose || !quiet)
Formatting nit, use "if (".
> diff --git a/git-pull.sh b/git-pull.sh
> index 75c3610..d84ceb5 100755
> --- a/git-pull.sh
> +++ b/git-pull.sh
> @@ -16,13 +16,17 @@ cd_to_toplevel
> test -z "$(git ls-files -u)" ||
> die "You are in the middle of a conflicted merge."
>
> -strategy_args= no_stat= no_commit= squash= no_ff= log_arg=
> +quiet= verbose= strategy_args= no_stat= no_commit= squash= no_ff= log_arg=
This line got a little long, maybe put the two new ones on a new
line so we don't overrun the 80 column margin and there's an easier
to read diff?
--
Shawn.
^ permalink raw reply
* Re: [PATCH] compat/cygwin.c - Use cygwin's stat if core.filemode == true
From: Junio C Hamano @ 2008-10-12 19:35 UTC (permalink / raw)
To: Mark Levedahl; +Cc: gitster, spearce, dpotapov, git
In-Reply-To: <1223837086-2864-1-git-send-email-mlevedahl@gmail.com>
Mark Levedahl <mlevedahl@gmail.com> writes:
> Cygwin's POSIX emulation allows use of core.filemode true, unlike native
> Window's implementation of stat / lstat, and Cygwin/git users who have
> configured core.filemode true in various repositories will be very
> unpleasantly surprised to find that git is no longer honoring that option.
> So, this patch forces use of Cygwin's stat functions if core.filemode is
> set true, regardless of any other considerations.
>
> Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
> ---
> Updated to use trust_executable_bit as suggested on the list.
Before you do that, can you explain why git_cygwin_config() should
duplicate the setting of that variable instead of using the existing
parser for that variable by calling git_default_config()?
^ permalink raw reply
* Re: [PATCH] fetch: refuse to fetch into the current branch in a non-bare repository
From: Shawn O. Pearce @ 2008-10-12 18:52 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: git, gitster
In-Reply-To: <alpine.DEB.1.00.0810111336350.22125@pacific.mpi-cbg.de.mpi-cbg.de>
Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> diff --git a/builtin-fetch.c b/builtin-fetch.c
> index ee93d3a..d701550 100644
> --- a/builtin-fetch.c
> +++ b/builtin-fetch.c
> @@ -534,6 +534,25 @@ static void find_non_local_tags(struct transport *transport,
> string_list_clear(&new_refs, 0);
> }
>
> +static void check_ref_map(struct ref *ref_map)
> +{
> + int flag;
> + unsigned char sha1[20];
> + const char *HEAD;
> +
> + if (is_bare_repository())
> + return;
> +
> + HEAD = resolve_ref("HEAD", sha1, 1, &flag);
I'd rather see local variables named lowercase. Constants should
be the only thing that is all uppercase.
> @@ -558,6 +577,7 @@ static int do_fetch(struct transport *transport,
> }
>
> ref_map = get_ref_map(transport, refs, ref_count, tags, &autotags);
> + check_ref_map(ref_map);
This should only be called if update_head_ok is false. So maybe:
if (!update_head_ok)
check_ref_map(ref_map)
> diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh
> index 9aae496..cd8b550 100755
> --- a/t/t5510-fetch.sh
> +++ b/t/t5510-fetch.sh
> @@ -323,4 +323,10 @@ test_expect_success 'auto tag following fetches minimum' '
> )
> '
>
> +test_expect_success 'refuse to fetch into the current branch' '
> +
> + test_must_fail git fetch . side:master
> +
> +'
> +
Repeat this test, but with --update-head-ok and expect success,
since the check_ref_map logic is conditional on that?
--
Shawn.
^ permalink raw reply
* Re: [PATCH] fetch: refuse to fetch into the current branch in a non-bare repository
From: Shawn O. Pearce @ 2008-10-12 18:47 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Johannes Schindelin, git
In-Reply-To: <7vprm6iz6z.fsf@gitster.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> wrote:
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
>
> > Some confusing tutorials suggest that it would be a good idea to call
> > something like this:
> >
> > git pull origin master:master
> >
> > While it might make sense to store what you want to merge, it typically
> > is plain wrong.
>
> I am somewhat confused.
The description is confusing, yes. It should be about git fetch,
not git pull.
> This "confusion" has been there for very long time and (at least the
> scripted version of) git-pull/git-fetch pair has supported a workaround in
> the form of --update-head-ok option.
I think "git fetch url side:master" when master is the current branch
and we have omitted --update-head-ok is broken. Specifically Dscho's
last hunk which adds this test. The test fails on current master.
Looking at the code in builtin-fetch.c, the only usage of
update_head_ok is for output about the current branch. I think
it should have been used in at least one other spot, to decide if
the RHS of a refspec is valid for storage. Dscho's patch tries to
address that.
diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh
index 9aae496..cd8b550 100755
--- a/t/t5510-fetch.sh
+++ b/t/t5510-fetch.sh
@@ -323,4 +323,10 @@ test_expect_success 'auto tag following fetches minimum' '
)
'
+test_expect_success 'refuse to fetch into the current branch' '
+
+ test_must_fail git fetch . side:master
+
+'
+
test_done
--
Shawn.
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox