{"thread":{"id":"19206","subject":"[PATCH 2/2] Use NullProgressMonitor.INSTANCE and indent for loop","startedAt":"2009-05-06T20:37:03Z","lastAt":"2009-05-06T21:28:56Z","messageCount":8,"participants":["Alex Blewitt","Shawn O. Pearce","Robin Rosenberg"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"113123","messageId":"1241642224-6914-1-git-send-email-alex.blewitt@gmail.com","threadId":"19206","inReplyTo":null,"subject":"[PATCH 1/2] Allow monitor/unintersting objects to be null","fromName":"Alex Blewitt","fromEmail":"alex.blewitt@gmail.com","sentAt":"2009-05-06T20:37:03Z","receivedAt":"2009-05-06T20:37:03Z","isPatch":true,"sender":{"key":"alex.blewitt@gmail.com","avatar":"https://gravatar.com/avatar/fb95a3b593b290f03a8d3b022c20b2825205702c5651f731f65d33512dfe6ab2?d=mp&s=160"},"body":"---\n .../src/org/spearce/jgit/lib/PackWriter.java       |    5 +++--\n 1 files changed, 3 insertions(+), 2 deletions(-)\n\ndiff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/PackWriter.java b/org.spearce.jgit/src/org/spearce/jgit/lib/PackWriter.java\nindex ea63942..3d7004d 100644\n--- a/org.spearce.jgit/src/org/spearce/jgit/lib/PackWriter.java\n+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/PackWriter.java\n@@ -230,8 +230,8 @@ public PackWriter(final Repository repo, final ProgressMonitor monitor) {\n \tpublic PackWriter(final Repository repo, final ProgressMonitor imonitor,\n \t\t\tfinal ProgressMonitor wmonitor) {\n \t\tthis.db = repo;\n-\t\tinitMonitor = imonitor;\n-\t\twriteMonitor = wmonitor;\n+\t\tinitMonitor = (imonitor == null ? new NullProgressMonitor() : imonitor);\n+\t\twriteMonitor = (wmonitor == null ? new NullProgressMonitor() : wmonitor);\n \t\tthis.deflater = new Deflater(db.getConfig().getCore().getCompression());\n \t\toutputVersion = repo.getConfig().getCore().getPackIndexVersion();\n \t}\n@@ -829,6 +829,7 @@ private ObjectWalk setUpWalker(\n \t\t\tRevObject o = walker.parseAny(id);\n \t\t\twalker.markStart(o);\n \t\t}\n+\t\tif (uninterestingObjects != null)\n \t\tfor (ObjectId id : uninterestingObjects) {\n \t\t\tfinal RevObject o;\n \t\t\ttry {\n-- \n1.6.2.2\n"},{"id":"113122","messageId":"1241642224-6914-2-git-send-email-alex.blewitt@gmail.com","threadId":"19206","inReplyTo":"1241642224-6914-1-git-send-email-alex.blewitt@gmail.com","subject":"[PATCH 2/2] Use NullProgressMonitor.INSTANCE and indent for loop","fromName":"Alex Blewitt","fromEmail":"alex.blewitt@gmail.com","sentAt":"2009-05-06T20:37:04Z","receivedAt":"2009-05-06T20:37:04Z","isPatch":true,"sender":{"key":"alex.blewitt@gmail.com","avatar":"https://gravatar.com/avatar/fb95a3b593b290f03a8d3b022c20b2825205702c5651f731f65d33512dfe6ab2?d=mp&s=160"},"body":"---\n .../src/org/spearce/jgit/lib/PackWriter.java       |   25 ++++++++++---------\n 1 files changed, 13 insertions(+), 12 deletions(-)\n\ndiff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/PackWriter.java b/org.spearce.jgit/src/org/spearce/jgit/lib/PackWriter.java\nindex 3d7004d..a35f61d 100644\n--- a/org.spearce.jgit/src/org/spearce/jgit/lib/PackWriter.java\n+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/PackWriter.java\n@@ -230,8 +230,8 @@ public PackWriter(final Repository repo, final ProgressMonitor monitor) {\n \tpublic PackWriter(final Repository repo, final ProgressMonitor imonitor,\n \t\t\tfinal ProgressMonitor wmonitor) {\n \t\tthis.db = repo;\n-\t\tinitMonitor = (imonitor == null ? new NullProgressMonitor() : imonitor);\n-\t\twriteMonitor = (wmonitor == null ? new NullProgressMonitor() : wmonitor);\n+\t\tinitMonitor = imonitor == null ? NullProgressMonitor.INSTANCE : imonitor;\n+\t\twriteMonitor = wmonitor == null ? NullProgressMonitor.INSTANCE : wmonitor;\n \t\tthis.deflater = new Deflater(db.getConfig().getCore().getCompression());\n \t\toutputVersion = repo.getConfig().getCore().getPackIndexVersion();\n \t}\n@@ -829,17 +829,18 @@ private ObjectWalk setUpWalker(\n \t\t\tRevObject o = walker.parseAny(id);\n \t\t\twalker.markStart(o);\n \t\t}\n-\t\tif (uninterestingObjects != null)\n-\t\tfor (ObjectId id : uninterestingObjects) {\n-\t\t\tfinal RevObject o;\n-\t\t\ttry {\n-\t\t\t\to = walker.parseAny(id);\n-\t\t\t} catch (MissingObjectException x) {\n-\t\t\t\tif (ignoreMissingUninteresting)\n-\t\t\t\t\tcontinue;\n-\t\t\t\tthrow x;\n+\t\tif (uninterestingObjects != null) {\n+\t\t\tfor (ObjectId id : uninterestingObjects) {\n+\t\t\t\tfinal RevObject o;\n+\t\t\t\ttry {\n+\t\t\t\t\to = walker.parseAny(id);\n+\t\t\t\t} catch (MissingObjectException x) {\n+\t\t\t\t\tif (ignoreMissingUninteresting)\n+\t\t\t\t\t\tcontinue;\n+\t\t\t\t\tthrow x;\n+\t\t\t\t}\n+\t\t\t\twalker.markUninteresting(o);\n \t\t\t}\n-\t\t\twalker.markUninteresting(o);\n \t\t}\n \t\treturn walker;\n \t}\n-- \n1.6.2.2\n"},{"id":"113124","messageId":"20090506204125.GJ30527@spearce.org","threadId":"19206","inReplyTo":"1241642224-6914-2-git-send-email-alex.blewitt@gmail.com","subject":"Re: [PATCH 2/2] Use NullProgressMonitor.INSTANCE and indent for loop","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2009-05-06T20:41:25Z","receivedAt":"2009-05-06T20:41:25Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Alex Blewitt <alex.blewitt@gmail.com> wrote:\n> ---\n>  .../src/org/spearce/jgit/lib/PackWriter.java       |   25 ++++++++++---------\n>  1 files changed, 13 insertions(+), 12 deletions(-)\n\nHuh.  These two should have been squashed together; see \"git rebase\n-i HEAD~2\" and its \"squash\" subcommand.\n\nIt looks fine otherwise.  I'll squash here when I apply.  Just keep\nit in mind for future reference.\n\n-- \nShawn.\n"},{"id":"113128","messageId":"20090506204849.GM30527@spearce.org","threadId":"19206","inReplyTo":"1241642224-6914-2-git-send-email-alex.blewitt@gmail.com","subject":"Re: [PATCH 2/2] Use NullProgressMonitor.INSTANCE and indent for loop","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2009-05-06T20:48:49Z","receivedAt":"2009-05-06T20:48:49Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Alex Blewitt <alex.blewitt@gmail.com> wrote:\n> ---\n>  .../src/org/spearce/jgit/lib/PackWriter.java       |   25 ++++++++++---------\n>  1 files changed, 13 insertions(+), 12 deletions(-)\n\nAlso, I'd like a Signed-off-by line for your patches.  We follow\nLinux kernel tradition and use a Signed-off-by line to mean\nyou agree to the \"Developer's Certificate of Origin 1.1\" (see\nSUBMITTING_PATCHES in the top level directory, part 5).\n\nFor the 2 that you've submitted thus far (this one, and the make\nprivate constructor) you can just reply to the email and drop the\nSOB line into the message body.  In the future make sure you add\nit in with git commit -s or git format-patch -s prior to sending.\n \n-- \nShawn.\n"},{"id":"113129","messageId":"46FFA889-7EFA-4CF2-9493-81DF5A319B6C@gmail.com","threadId":"19206","inReplyTo":"20090506204849.GM30527@spearce.org","subject":"Re: [PATCH 2/2] Use NullProgressMonitor.INSTANCE and indent for loop","fromName":"Alex Blewitt","fromEmail":"alex.blewitt@gmail.com","sentAt":"2009-05-06T20:50:57Z","receivedAt":"2009-05-06T20:50:57Z","isPatch":true,"sender":{"key":"alex.blewitt@gmail.com","avatar":"https://gravatar.com/avatar/fb95a3b593b290f03a8d3b022c20b2825205702c5651f731f65d33512dfe6ab2?d=mp&s=160"},"body":"I've been using git send-email --format-patch, which doesn't appear to  \nadd the signed by line. If I do it as the commit, will it add the  \nsigned-by when it gets committed, and thus I can use send-email? git  \nformat-patch just seems to dump a load of files into the directory,  \nand (as noted elsewhere) the git-rebase doesn't appear to work for me.\n\nAlex\n\nOn 6 May 2009, at 21:48, Shawn O. Pearce wrote:\n\n> Alex Blewitt <alex.blewitt@gmail.com> wrote:\n>> ---\n>> .../src/org/spearce/jgit/lib/PackWriter.java       |   25 +++++++++ \n>> +---------\n>> 1 files changed, 13 insertions(+), 12 deletions(-)\n>\n> Also, I'd like a Signed-off-by line for your patches.  We follow\n> Linux kernel tradition and use a Signed-off-by line to mean\n> you agree to the \"Developer's Certificate of Origin 1.1\" (see\n> SUBMITTING_PATCHES in the top level directory, part 5).\n>\n> For the 2 that you've submitted thus far (this one, and the make\n> private constructor) you can just reply to the email and drop the\n> SOB line into the message body.  In the future make sure you add\n> it in with git commit -s or git format-patch -s prior to sending.\n>\n> -- \n> Shawn.\n"},{"id":"113130","messageId":"20090506205444.GN30527@spearce.org","threadId":"19206","inReplyTo":"46FFA889-7EFA-4CF2-9493-81DF5A319B6C@gmail.com","subject":"Re: [PATCH 2/2] Use NullProgressMonitor.INSTANCE and indent for loop","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2009-05-06T20:54:44Z","receivedAt":"2009-05-06T20:54:44Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Alex Blewitt <alex.blewitt@gmail.com> wrote:\n> I've been using git send-email --format-patch, which doesn't appear to  \n> add the signed by line. If I do it as the commit, will it add the  \n> signed-by when it gets committed, and thus I can use send-email? git  \n> format-patch just seems to dump a load of files into the directory, and \n> (as noted elsewhere) the git-rebase doesn't appear to work for me.\n\nIIRC, \"git send-email --format-patch -- -s\" would pass -s to the\nformat-patch script, adding the line automatically.  But that's\nan undocumented feature of send-email.\n\nPersonally, I put the SOB line in with \"git commit -s\" when I write\nthe change.  Then its there when I dump it out with format-patch.\n\nAs for format-patch making a ton of files, yea, that's its job.\nI actually use the following pair of scripts to manage sending,\nas this lets me edit _sop/OUT/* before firing it off.\n\n--8<--\n#!/bin/sh\nif [ -n \"$(git rev-parse --show-cdup)\" ]; then\n\tcd $(git rev-parse --show-cdup) || exit\nfi\n\nmkdir -p _sop/OUT &&\nrm -f $(find _sop/OUT -name '*.patch' | grep -v '0000-cover-letter') &&\nbase=\"${1:-master}\" &&\nif [ $(git rev-list ^$base HEAD | wc -l) -gt 1 ]\nthen\n\tn=\"--numbered --cover-letter\"\nfi &&\ngit format-patch \\\n\t--output-directory _sop/OUT \\\n\t--subject-prefix='JGIT PATCH' \\\n\t-M \\\n\t$n \\\n\t$base || exit\n----\n\n--8<--\n#!/bin/sh\nif [ -n \"$(git rev-parse --show-cdup)\" ]; then\n\tcd $(git rev-parse --show-cdup) || exit\nfi\n\nls -1 _sop/OUT\nread\n\ngit send-email \\\n\t--to 'Robin Rosenberg <robin.rosenberg@dewire.com>' \\\n\t--cc 'git@vger.kernel.org' \\\n\t--chain-reply-to \\\n\t--suppress-cc self \\\n\t--smtp-server localhost \\\n\t--smtp-server-port 8025 \\\n\t_sop/OUT\n----\n\n-- \nShawn.\n"},{"id":"113131","messageId":"200905062310.12895.robin.rosenberg.lists@dewire.com","threadId":"19206","inReplyTo":"1241642224-6914-1-git-send-email-alex.blewitt@gmail.com","subject":"Re: [PATCH 1/2] Allow monitor/unintersting objects to be null","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg.lists@dewire.com","sentAt":"2009-05-06T21:10:12Z","receivedAt":"2009-05-06T21:10:12Z","isPatch":true,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"\nBesides all comments by Shawn. Please set the prefix to EGIT PATCH or JGIT PATCH\nso the C Git people that are not interested in JGit know this isn't for them.\n\nIf you add this to your .git/config you will get the prefix automagically when generating\nthe patches.\n\n[format]\n        subjectprefix = EGIT PATCH\n\n-- robin\n"},{"id":"113134","messageId":"636fd28e0905061428t519e1923g3ec94caf34ac3db@mail.gmail.com","threadId":"19206","inReplyTo":"200905062310.12895.robin.rosenberg.lists@dewire.com","subject":"Re: [PATCH 1/2] Allow monitor/unintersting objects to be null","fromName":"Alex Blewitt","fromEmail":"alex.blewitt@gmail.com","sentAt":"2009-05-06T21:28:56Z","receivedAt":"2009-05-06T21:28:56Z","isPatch":true,"sender":{"key":"alex.blewitt@gmail.com","avatar":"https://gravatar.com/avatar/fb95a3b593b290f03a8d3b022c20b2825205702c5651f731f65d33512dfe6ab2?d=mp&s=160"},"body":"Thanks Robin, that's great. I did attempt to set the subject on git\nsend-mail --subject, but unfortunately it had no impact; note the\n'Subject' on the line.\n\nIt works if I configure the .gitconfig though. I'll do that in the future.\n\napple:egit alex$ git send-email origin/master --subject \"Fooooooooo\" --dry-run\n(mbox) Adding cc: Alex Blewitt <alex.blewitt@gmail.com> from line\n'From: Alex Blewitt <alex.blewitt@gmail.com>'\nDry-OK. Log says:\nSendmail: /usr/sbin/sendmail -i alex.blewitt@gmail.com\nFrom: Alex Blewitt <alex.blewitt@gmail.com>\nTo:\nCc: Alex Blewitt <alex.blewitt@gmail.com>\nSubject: [PATCH 1/3] Allow monitor/unintersting objects to be null\nDate: Wed,  6 May 2009 22:26:05 +0100\nMessage-Id: <1241645167-8427-1-git-send-email-alex.blewitt@gmail.com>\nX-Mailer: git-send-email 1.6.2.2\n\nResult: OK\n(mbox) Adding cc: Alex Blewitt <alex.blewitt@gmail.com> from line\n'From: Alex Blewitt <alex.blewitt@gmail.com>'\nDry-OK. Log says:\nSendmail: /usr/sbin/sendmail -i alex.blewitt@gmail.com\nFrom: Alex Blewitt <alex.blewitt@gmail.com>\nTo:\nCc: Alex Blewitt <alex.blewitt@gmail.com>\nSubject: [PATCH 2/3] Use NullProgressMonitor.INSTANCE and indent for loop\nDate: Wed,  6 May 2009 22:26:06 +0100\nMessage-Id: <1241645167-8427-2-git-send-email-alex.blewitt@gmail.com>\nX-Mailer: git-send-email 1.6.2.2\nIn-Reply-To: <1241645167-8427-1-git-send-email-alex.blewitt@gmail.com>\nReferences: <1241645167-8427-1-git-send-email-alex.blewitt@gmail.com>\n\nResult: OK\n(mbox) Adding cc: Alex Blewitt <alex.blewitt@gmail.com> from line\n'From: Alex Blewitt <alex.blewitt@gmail.com>'\nDry-OK. Log says:\nSendmail: /usr/sbin/sendmail -i alex.blewitt@gmail.com\nFrom: Alex Blewitt <alex.blewitt@gmail.com>\nTo:\nCc: Alex Blewitt <alex.blewitt@gmail.com>\nSubject: [PATCH 3/3] Don't allow others to instantiate NullProgressMonitor\nDate: Wed,  6 May 2009 22:26:07 +0100\nMessage-Id: <1241645167-8427-3-git-send-email-alex.blewitt@gmail.com>\nX-Mailer: git-send-email 1.6.2.2\nIn-Reply-To: <1241645167-8427-2-git-send-email-alex.blewitt@gmail.com>\nReferences: <1241645167-8427-1-git-send-email-alex.blewitt@gmail.com>\n <1241645167-8427-2-git-send-email-alex.blewitt@gmail.com>\n\nResult: OK\n"}]}