Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jgit-dev] bug? jgit repack may not honor keep files properly

I had a question about the expected naming of ‘keep’ pack files and how JGit handles them. Looking at the JGit implementation, in the repack logic to determine if a pack file should be kept by finding a ‘keep’ file, it expects a certain naming convention. That logic appears to expect the following:

<packfile_name>.keep, ie. pack-<sha>.pack.keep, eg. pack-33f63376e517da7e6e23569a90412285e62e1e77.pack.keep

From: org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackFile.java

<code>
	public boolean shouldBeKept() {
		…
		keepFile = new File(packFile.getPath() + ".keep");
</code>

Is this expected behavior? I would have expected the ‘keep’ file to just be another extension (like .pack, .idx, .bitmap). This also appears to be the behavior in git.git as well. For example:

pack-33f63376e517da7e6e23569a90412285e62e1e77.keep

I’ve uploaded a proposed fix for this here: https://git.eclipse.org/r/#/c/87776/

Thanks,
James


Back to the top