git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] Allow monitor/unintersting objects to be null
@ 2009-05-06 20:37 Alex Blewitt
  2009-05-06 20:37 ` [PATCH 2/2] Use NullProgressMonitor.INSTANCE and indent for loop Alex Blewitt
  2009-05-06 21:10 ` [PATCH 1/2] Allow monitor/unintersting objects to be null Robin Rosenberg
  0 siblings, 2 replies; 8+ messages in thread
From: Alex Blewitt @ 2009-05-06 20:37 UTC (permalink / raw)
  To: spearce, robin.rosenberg; +Cc: git, Alex Blewitt

---
 .../src/org/spearce/jgit/lib/PackWriter.java       |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/PackWriter.java b/org.spearce.jgit/src/org/spearce/jgit/lib/PackWriter.java
index ea63942..3d7004d 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/lib/PackWriter.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/PackWriter.java
@@ -230,8 +230,8 @@ public PackWriter(final Repository repo, final ProgressMonitor monitor) {
 	public PackWriter(final Repository repo, final ProgressMonitor imonitor,
 			final ProgressMonitor wmonitor) {
 		this.db = repo;
-		initMonitor = imonitor;
-		writeMonitor = wmonitor;
+		initMonitor = (imonitor == null ? new NullProgressMonitor() : imonitor);
+		writeMonitor = (wmonitor == null ? new NullProgressMonitor() : wmonitor);
 		this.deflater = new Deflater(db.getConfig().getCore().getCompression());
 		outputVersion = repo.getConfig().getCore().getPackIndexVersion();
 	}
@@ -829,6 +829,7 @@ private ObjectWalk setUpWalker(
 			RevObject o = walker.parseAny(id);
 			walker.markStart(o);
 		}
+		if (uninterestingObjects != null)
 		for (ObjectId id : uninterestingObjects) {
 			final RevObject o;
 			try {
-- 
1.6.2.2

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/2] Use NullProgressMonitor.INSTANCE and indent for loop
  2009-05-06 20:37 [PATCH 1/2] Allow monitor/unintersting objects to be null Alex Blewitt
@ 2009-05-06 20:37 ` Alex Blewitt
  2009-05-06 20:41   ` Shawn O. Pearce
  2009-05-06 20:48   ` Shawn O. Pearce
  2009-05-06 21:10 ` [PATCH 1/2] Allow monitor/unintersting objects to be null Robin Rosenberg
  1 sibling, 2 replies; 8+ messages in thread
From: Alex Blewitt @ 2009-05-06 20:37 UTC (permalink / raw)
  To: spearce, robin.rosenberg; +Cc: git, Alex Blewitt

---
 .../src/org/spearce/jgit/lib/PackWriter.java       |   25 ++++++++++---------
 1 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/PackWriter.java b/org.spearce.jgit/src/org/spearce/jgit/lib/PackWriter.java
index 3d7004d..a35f61d 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/lib/PackWriter.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/PackWriter.java
@@ -230,8 +230,8 @@ public PackWriter(final Repository repo, final ProgressMonitor monitor) {
 	public PackWriter(final Repository repo, final ProgressMonitor imonitor,
 			final ProgressMonitor wmonitor) {
 		this.db = repo;
-		initMonitor = (imonitor == null ? new NullProgressMonitor() : imonitor);
-		writeMonitor = (wmonitor == null ? new NullProgressMonitor() : wmonitor);
+		initMonitor = imonitor == null ? NullProgressMonitor.INSTANCE : imonitor;
+		writeMonitor = wmonitor == null ? NullProgressMonitor.INSTANCE : wmonitor;
 		this.deflater = new Deflater(db.getConfig().getCore().getCompression());
 		outputVersion = repo.getConfig().getCore().getPackIndexVersion();
 	}
@@ -829,17 +829,18 @@ private ObjectWalk setUpWalker(
 			RevObject o = walker.parseAny(id);
 			walker.markStart(o);
 		}
-		if (uninterestingObjects != null)
-		for (ObjectId id : uninterestingObjects) {
-			final RevObject o;
-			try {
-				o = walker.parseAny(id);
-			} catch (MissingObjectException x) {
-				if (ignoreMissingUninteresting)
-					continue;
-				throw x;
+		if (uninterestingObjects != null) {
+			for (ObjectId id : uninterestingObjects) {
+				final RevObject o;
+				try {
+					o = walker.parseAny(id);
+				} catch (MissingObjectException x) {
+					if (ignoreMissingUninteresting)
+						continue;
+					throw x;
+				}
+				walker.markUninteresting(o);
 			}
-			walker.markUninteresting(o);
 		}
 		return walker;
 	}
-- 
1.6.2.2

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/2] Use NullProgressMonitor.INSTANCE and indent for loop
  2009-05-06 20:37 ` [PATCH 2/2] Use NullProgressMonitor.INSTANCE and indent for loop Alex Blewitt
@ 2009-05-06 20:41   ` Shawn O. Pearce
  2009-05-06 20:48   ` Shawn O. Pearce
  1 sibling, 0 replies; 8+ messages in thread
From: Shawn O. Pearce @ 2009-05-06 20:41 UTC (permalink / raw)
  To: Alex Blewitt; +Cc: robin.rosenberg, git

Alex Blewitt <alex.blewitt@gmail.com> wrote:
> ---
>  .../src/org/spearce/jgit/lib/PackWriter.java       |   25 ++++++++++---------
>  1 files changed, 13 insertions(+), 12 deletions(-)

Huh.  These two should have been squashed together; see "git rebase
-i HEAD~2" and its "squash" subcommand.

It looks fine otherwise.  I'll squash here when I apply.  Just keep
it in mind for future reference.

-- 
Shawn.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/2] Use NullProgressMonitor.INSTANCE and indent for loop
  2009-05-06 20:37 ` [PATCH 2/2] Use NullProgressMonitor.INSTANCE and indent for loop Alex Blewitt
  2009-05-06 20:41   ` Shawn O. Pearce
@ 2009-05-06 20:48   ` Shawn O. Pearce
  2009-05-06 20:50     ` Alex Blewitt
  1 sibling, 1 reply; 8+ messages in thread
From: Shawn O. Pearce @ 2009-05-06 20:48 UTC (permalink / raw)
  To: Alex Blewitt; +Cc: robin.rosenberg, git

Alex Blewitt <alex.blewitt@gmail.com> wrote:
> ---
>  .../src/org/spearce/jgit/lib/PackWriter.java       |   25 ++++++++++---------
>  1 files changed, 13 insertions(+), 12 deletions(-)

Also, I'd like a Signed-off-by line for your patches.  We follow
Linux kernel tradition and use a Signed-off-by line to mean
you agree to the "Developer's Certificate of Origin 1.1" (see
SUBMITTING_PATCHES in the top level directory, part 5).

For the 2 that you've submitted thus far (this one, and the make
private constructor) you can just reply to the email and drop the
SOB line into the message body.  In the future make sure you add
it in with git commit -s or git format-patch -s prior to sending.
 
-- 
Shawn.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/2] Use NullProgressMonitor.INSTANCE and indent for loop
  2009-05-06 20:48   ` Shawn O. Pearce
@ 2009-05-06 20:50     ` Alex Blewitt
  2009-05-06 20:54       ` Shawn O. Pearce
  0 siblings, 1 reply; 8+ messages in thread
From: Alex Blewitt @ 2009-05-06 20:50 UTC (permalink / raw)
  To: Shawn O. Pearce; +Cc: Robin Rosenberg, git

I've been using git send-email --format-patch, which doesn't appear to  
add the signed by line. If I do it as the commit, will it add the  
signed-by when it gets committed, and thus I can use send-email? git  
format-patch just seems to dump a load of files into the directory,  
and (as noted elsewhere) the git-rebase doesn't appear to work for me.

Alex

On 6 May 2009, at 21:48, Shawn O. Pearce wrote:

> Alex Blewitt <alex.blewitt@gmail.com> wrote:
>> ---
>> .../src/org/spearce/jgit/lib/PackWriter.java       |   25 +++++++++ 
>> +---------
>> 1 files changed, 13 insertions(+), 12 deletions(-)
>
> Also, I'd like a Signed-off-by line for your patches.  We follow
> Linux kernel tradition and use a Signed-off-by line to mean
> you agree to the "Developer's Certificate of Origin 1.1" (see
> SUBMITTING_PATCHES in the top level directory, part 5).
>
> For the 2 that you've submitted thus far (this one, and the make
> private constructor) you can just reply to the email and drop the
> SOB line into the message body.  In the future make sure you add
> it in with git commit -s or git format-patch -s prior to sending.
>
> -- 
> Shawn.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/2] Use NullProgressMonitor.INSTANCE and indent for loop
  2009-05-06 20:50     ` Alex Blewitt
@ 2009-05-06 20:54       ` Shawn O. Pearce
  0 siblings, 0 replies; 8+ messages in thread
From: Shawn O. Pearce @ 2009-05-06 20:54 UTC (permalink / raw)
  To: Alex Blewitt; +Cc: Robin Rosenberg, git

Alex Blewitt <alex.blewitt@gmail.com> wrote:
> I've been using git send-email --format-patch, which doesn't appear to  
> add the signed by line. If I do it as the commit, will it add the  
> signed-by when it gets committed, and thus I can use send-email? git  
> format-patch just seems to dump a load of files into the directory, and 
> (as noted elsewhere) the git-rebase doesn't appear to work for me.

IIRC, "git send-email --format-patch -- -s" would pass -s to the
format-patch script, adding the line automatically.  But that's
an undocumented feature of send-email.

Personally, I put the SOB line in with "git commit -s" when I write
the change.  Then its there when I dump it out with format-patch.

As for format-patch making a ton of files, yea, that's its job.
I actually use the following pair of scripts to manage sending,
as this lets me edit _sop/OUT/* before firing it off.

--8<--
#!/bin/sh
if [ -n "$(git rev-parse --show-cdup)" ]; then
	cd $(git rev-parse --show-cdup) || exit
fi

mkdir -p _sop/OUT &&
rm -f $(find _sop/OUT -name '*.patch' | grep -v '0000-cover-letter') &&
base="${1:-master}" &&
if [ $(git rev-list ^$base HEAD | wc -l) -gt 1 ]
then
	n="--numbered --cover-letter"
fi &&
git format-patch \
	--output-directory _sop/OUT \
	--subject-prefix='JGIT PATCH' \
	-M \
	$n \
	$base || exit
----

--8<--
#!/bin/sh
if [ -n "$(git rev-parse --show-cdup)" ]; then
	cd $(git rev-parse --show-cdup) || exit
fi

ls -1 _sop/OUT
read

git send-email \
	--to 'Robin Rosenberg <robin.rosenberg@dewire.com>' \
	--cc 'git@vger.kernel.org' \
	--chain-reply-to \
	--suppress-cc self \
	--smtp-server localhost \
	--smtp-server-port 8025 \
	_sop/OUT
----

-- 
Shawn.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] Allow monitor/unintersting objects to be null
  2009-05-06 20:37 [PATCH 1/2] Allow monitor/unintersting objects to be null Alex Blewitt
  2009-05-06 20:37 ` [PATCH 2/2] Use NullProgressMonitor.INSTANCE and indent for loop Alex Blewitt
@ 2009-05-06 21:10 ` Robin Rosenberg
  2009-05-06 21:28   ` Alex Blewitt
  1 sibling, 1 reply; 8+ messages in thread
From: Robin Rosenberg @ 2009-05-06 21:10 UTC (permalink / raw)
  To: Alex Blewitt; +Cc: spearce, git


Besides all comments by Shawn. Please set the prefix to EGIT PATCH or JGIT PATCH
so the C Git people that are not interested in JGit know this isn't for them.

If you add this to your .git/config you will get the prefix automagically when generating
the patches.

[format]
        subjectprefix = EGIT PATCH

-- robin

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] Allow monitor/unintersting objects to be null
  2009-05-06 21:10 ` [PATCH 1/2] Allow monitor/unintersting objects to be null Robin Rosenberg
@ 2009-05-06 21:28   ` Alex Blewitt
  0 siblings, 0 replies; 8+ messages in thread
From: Alex Blewitt @ 2009-05-06 21:28 UTC (permalink / raw)
  To: Robin Rosenberg; +Cc: spearce, git

Thanks Robin, that's great. I did attempt to set the subject on git
send-mail --subject, but unfortunately it had no impact; note the
'Subject' on the line.

It works if I configure the .gitconfig though. I'll do that in the future.

apple:egit alex$ git send-email origin/master --subject "Fooooooooo" --dry-run
(mbox) Adding cc: Alex Blewitt <alex.blewitt@gmail.com> from line
'From: Alex Blewitt <alex.blewitt@gmail.com>'
Dry-OK. Log says:
Sendmail: /usr/sbin/sendmail -i alex.blewitt@gmail.com
From: Alex Blewitt <alex.blewitt@gmail.com>
To:
Cc: Alex Blewitt <alex.blewitt@gmail.com>
Subject: [PATCH 1/3] Allow monitor/unintersting objects to be null
Date: Wed,  6 May 2009 22:26:05 +0100
Message-Id: <1241645167-8427-1-git-send-email-alex.blewitt@gmail.com>
X-Mailer: git-send-email 1.6.2.2

Result: OK
(mbox) Adding cc: Alex Blewitt <alex.blewitt@gmail.com> from line
'From: Alex Blewitt <alex.blewitt@gmail.com>'
Dry-OK. Log says:
Sendmail: /usr/sbin/sendmail -i alex.blewitt@gmail.com
From: Alex Blewitt <alex.blewitt@gmail.com>
To:
Cc: Alex Blewitt <alex.blewitt@gmail.com>
Subject: [PATCH 2/3] Use NullProgressMonitor.INSTANCE and indent for loop
Date: Wed,  6 May 2009 22:26:06 +0100
Message-Id: <1241645167-8427-2-git-send-email-alex.blewitt@gmail.com>
X-Mailer: git-send-email 1.6.2.2
In-Reply-To: <1241645167-8427-1-git-send-email-alex.blewitt@gmail.com>
References: <1241645167-8427-1-git-send-email-alex.blewitt@gmail.com>

Result: OK
(mbox) Adding cc: Alex Blewitt <alex.blewitt@gmail.com> from line
'From: Alex Blewitt <alex.blewitt@gmail.com>'
Dry-OK. Log says:
Sendmail: /usr/sbin/sendmail -i alex.blewitt@gmail.com
From: Alex Blewitt <alex.blewitt@gmail.com>
To:
Cc: Alex Blewitt <alex.blewitt@gmail.com>
Subject: [PATCH 3/3] Don't allow others to instantiate NullProgressMonitor
Date: Wed,  6 May 2009 22:26:07 +0100
Message-Id: <1241645167-8427-3-git-send-email-alex.blewitt@gmail.com>
X-Mailer: git-send-email 1.6.2.2
In-Reply-To: <1241645167-8427-2-git-send-email-alex.blewitt@gmail.com>
References: <1241645167-8427-1-git-send-email-alex.blewitt@gmail.com>
 <1241645167-8427-2-git-send-email-alex.blewitt@gmail.com>

Result: OK

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2009-05-06 21:29 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-06 20:37 [PATCH 1/2] Allow monitor/unintersting objects to be null Alex Blewitt
2009-05-06 20:37 ` [PATCH 2/2] Use NullProgressMonitor.INSTANCE and indent for loop Alex Blewitt
2009-05-06 20:41   ` Shawn O. Pearce
2009-05-06 20:48   ` Shawn O. Pearce
2009-05-06 20:50     ` Alex Blewitt
2009-05-06 20:54       ` Shawn O. Pearce
2009-05-06 21:10 ` [PATCH 1/2] Allow monitor/unintersting objects to be null Robin Rosenberg
2009-05-06 21:28   ` Alex Blewitt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).