# EGIT packed delta format reading

4 messages from 2006-08-06 to 2006-08-07. Participants: Robin Rosenberg, Shawn Pearce.
Thread: https://gitlist.dev/t/5159

## Robin Rosenberg, 2006-08-06 18:37

Subject: EGIT packed delta format reading
Message-ID: <20060806183748.7591.61536.stgit@lathund.dewire.com>
URL: https://gitlist.dev/e/20060806183748.7591.61536.stgit%40lathund.dewire.com

```
Hi,

I deciced to take Shawns Eclipse plugin for a run. There was
some problem reading the pack files that seemed to work after
applying the following fixes, i.e. I could connect to the
project and the interal structures looks ok in the debugger
as far as I can tell, but decorations don't work. That's as
far as I've been testing up to now.

BTW. How should EGIT patches be formatted to distingish them
from git patches? I'm sending this using StGit.

-- robin

```

## Robin Rosenberg, 2006-08-06 18:40

Subject: [PATCH] Fixes to packed delta format reading.
Message-ID: <20060806184038.7591.12898.stgit@lathund.dewire.com>
URL: https://gitlist.dev/e/20060806184038.7591.12898.stgit%40lathund.dewire.com
In-Reply-To: <20060806183748.7591.61536.stgit@lathund.dewire.com>

```
From: Robin Rosenberg <robin.rosenberg@dewire.com>


---

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

diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/PatchDeltaStream.java b/org.spearce.jgit/src/org/spearce/jgit/lib/PatchDeltaStream.java
index 808e854..11a7679 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/lib/PatchDeltaStream.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/PatchDeltaStream.java
@@ -105,7 +105,7 @@ public class PatchDeltaStream extends In
                             + " load delta base for patching.");
                     }
                     shift += n;
-                    expBaseLen += n;
+                    expBaseLen -= n;
                 }
             }
             finally
@@ -269,7 +269,7 @@ public class PatchDeltaStream extends In
         throws IOException
     {
         int r;
-        while ((r = read(buf, o, len)) > 0)
+        while ((r = deltaStream.read(buf, o, len)) > 0)
         {
             o += r;
             len -= r;

```

## Shawn Pearce, 2006-08-07 04:03

Subject: Re: [PATCH] Fixes to packed delta format reading.
Message-ID: <20060807040342.GA20514@spearce.org>
URL: https://gitlist.dev/e/20060807040342.GA20514%40spearce.org
In-Reply-To: <20060806184038.7591.12898.stgit@lathund.dewire.com>

```
> ---
> 
>  .../src/org/spearce/jgit/lib/PatchDeltaStream.java |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/PatchDeltaStream.java b/org.spearce.jgit/src/org/spearce/jgit/lib/PatchDeltaStream.java
> index 808e854..11a7679 100644
> --- a/org.spearce.jgit/src/org/spearce/jgit/lib/PatchDeltaStream.java
> +++ b/org.spearce.jgit/src/org/spearce/jgit/lib/PatchDeltaStream.java
> @@ -105,7 +105,7 @@ public class PatchDeltaStream extends In
>                              + " load delta base for patching.");
>                      }
>                      shift += n;
> -                    expBaseLen += n;
> +                    expBaseLen -= n;
>                  }
>              }
>              finally
> @@ -269,7 +269,7 @@ public class PatchDeltaStream extends In
>          throws IOException
>      {
>          int r;
> -        while ((r = read(buf, o, len)) > 0)
> +        while ((r = deltaStream.read(buf, o, len)) > 0)
>          {
>              o += r;
>              len -= r;

Thanks.  I actually found these Friday night when I started reviewing
the code to double check its compliance with A Large Angry SCM's
file format documentation.  These were already made locally but I
didn't push them out to my web repository yet.  I'll do that shortly.

-- 
Shawn.

```

## Shawn Pearce, 2006-08-07 04:07

Subject: Re: EGIT packed delta format reading
Message-ID: <20060807040707.GB20514@spearce.org>
URL: https://gitlist.dev/e/20060807040707.GB20514%40spearce.org
In-Reply-To: <20060806183748.7591.61536.stgit@lathund.dewire.com>

```
Robin Rosenberg <robin.rosenberg@dewire.com> wrote:
> Hi,
> 
> I deciced to take Shawns Eclipse plugin for a run. There was
> some problem reading the pack files that seemed to work after
> applying the following fixes, i.e. I could connect to the
> project and the interal structures looks ok in the debugger
> as far as I can tell, but decorations don't work. That's as
> far as I've been testing up to now.

I'll take a look at it again, as soon as I get the tree entry
sorting fixed.
 
> BTW. How should EGIT patches be formatted to distingish them
> from git patches? I'm sending this using StGit.

You can use StGit to send patches, or any other GIT based tool.
After all, we're using GIT.  :-)

As far as marking patches specifically as an egit/jgit patch you can
send them directly to me and CC: the mailing list.  The egit/jgit
file names are pretty distinctive, just as the core GIT and Cogito
file names are.  I doubt folks will get confused as to which project
a patch belongs to...

-- 
Shawn.

```
