Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
0a50386
Using Constants class differently
adamhathcock Jan 27, 2026
d52facd
Remove change
adamhathcock Jan 27, 2026
014bbc3
Initial plan
Copilot Jan 27, 2026
a114155
Initial plan
Copilot Jan 27, 2026
6c86632
Fix grammatical errors in ArcFactory comments
Copilot Jan 27, 2026
53f12d7
Add [Obsolete] attribute to ReaderOptions.DefaultBufferSize
Copilot Jan 27, 2026
010a38b
Add clarifying comment about buffer size value difference
Copilot Jan 27, 2026
d11f6ae
Merge pull request #1166 from adamhathcock/copilot/sub-pr-1165
adamhathcock Jan 27, 2026
3c88c7f
Merge pull request #1167 from adamhathcock/copilot/sub-pr-1165-again
adamhathcock Jan 27, 2026
d6156f0
release branch builds increment patch versions and master builds incr…
adamhathcock Jan 27, 2026
f0eaddc
Merge remote-tracking branch 'origin/adam/buffer-size-consolidation' …
adamhathcock Jan 27, 2026
c82744c
fmt
adamhathcock Jan 27, 2026
4d31436
constant should be a static property
adamhathcock Jan 27, 2026
a9c28a7
Merge pull request #1165 from adamhathcock/adam/buffer-size-consolida…
adamhathcock Jan 27, 2026
970934a
Initial plan
Copilot Jan 27, 2026
a706a9d
Fix ZIP parsing regression with short reads on non-seekable streams
Copilot Jan 27, 2026
71655e0
Apply code formatting with CSharpier
Copilot Jan 27, 2026
d59e4c2
Refactor FillBuffer to use ReadFully pattern
Copilot Jan 27, 2026
8a3be35
Update tests/SharpCompress.Test/Zip/ZipShortReadTests.cs
adamhathcock Jan 27, 2026
72eaf66
Initial plan
Copilot Jan 27, 2026
af08a7c
Merge pull request #1169 from adamhathcock/copilot/fix-zip-parsing-re…
adamhathcock Jan 27, 2026
db2f5c9
Fix SevenZipReader to iterate entries as contiguous streams
Copilot Jan 27, 2026
999124e
Remove unused _currentFolderIndex field
Copilot Jan 27, 2026
3c87242
Add test to verify folder stream reuse in solid archives
Copilot Jan 27, 2026
8a67d50
Don't use reflection in tests
adamhathcock Jan 28, 2026
484bc74
Update src/SharpCompress/Archives/SevenZip/SevenZipArchive.cs
adamhathcock Jan 28, 2026
9a7bdd3
Merge pull request #1172 from adamhathcock/copilot/fix-sevenzip-conti…
adamhathcock Jan 28, 2026
c219eb4
Merge branch 'release'
adamhathcock Jan 28, 2026
f4369e5
fmt
adamhathcock Jan 28, 2026
8d5d686
more fixes
adamhathcock Jan 28, 2026
6ddcbf2
fix some tests
adamhathcock Jan 28, 2026
24b4ef8
fix test
adamhathcock Jan 28, 2026
c770bc4
reintroduce RewindableStream stream. SharpCompressStream does too much
adamhathcock Jan 28, 2026
8dfd534
making RewindableStream more proper
adamhathcock Jan 28, 2026
58459bd
using a byte array instead of memory streams
adamhathcock Jan 28, 2026
e2cb9f3
fix up rewindable stream and use it more, add NonDisposingStream
adamhathcock Jan 29, 2026
b994f0a
more 7z async
adamhathcock Jan 29, 2026
d60abc3
fmt
adamhathcock Jan 29, 2026
a94e319
clean up rewindable stream
adamhathcock Jan 29, 2026
be88410
fixes
adamhathcock Jan 29, 2026
1ca9148
more rework
adamhathcock Jan 29, 2026
bcaec86
save this
adamhathcock Jan 29, 2026
42f6c77
rewindable with memory stream
adamhathcock Jan 29, 2026
659f5d7
fix some more tests
adamhathcock Jan 29, 2026
c9db033
Fixed AsyncMarkingBinaryReader
adamhathcock Jan 29, 2026
595a97b
more explode async
adamhathcock Jan 30, 2026
6c3f7c8
lzma works with zip
adamhathcock Jan 30, 2026
525bcea
ppmd create
adamhathcock Jan 30, 2026
4ed1f89
more ppmd async
adamhathcock Jan 30, 2026
b48e938
finish PPMD?
adamhathcock Jan 30, 2026
d92def9
Opus 4.5 did this fix, need to understand it
adamhathcock Jan 31, 2026
c096164
add shrink stream async
adamhathcock Jan 31, 2026
b40e1a0
Merge remote-tracking branch 'origin/adam/data-descriptor-fix' into a…
adamhathcock Jan 31, 2026
0767292
ReduceStream is async
adamhathcock Jan 31, 2026
7112dba
some shrink fixes
adamhathcock Jan 31, 2026
895dd02
another fix
adamhathcock Jan 31, 2026
037b684
remove SharpCompressStream
adamhathcock Jan 31, 2026
86e412c
more fixes?
adamhathcock Jan 31, 2026
227e709
fmt
adamhathcock Jan 31, 2026
0e2f806
async crypto
adamhathcock Jan 31, 2026
6112b2d
recording isn't great here but it works better
adamhathcock Jan 31, 2026
cb27b11
remove IStreamStack from non specialized streams
adamhathcock Jan 31, 2026
62b8fc9
not sure I like this fix
adamhathcock Feb 1, 2026
46e2ea8
more async fixes
adamhathcock Feb 1, 2026
0b15b60
remove some extra markdown
adamhathcock Feb 1, 2026
9b8e3d8
remove some tests
adamhathcock Feb 2, 2026
e6ad44d
more async streams
adamhathcock Feb 2, 2026
ddc0152
async filtering for lzma and others
adamhathcock Feb 2, 2026
8a8784a
async xz and tar completed
adamhathcock Feb 2, 2026
361e695
non-async ace works
adamhathcock Feb 2, 2026
6af612f
fix ace async
adamhathcock Feb 2, 2026
236ee21
fix async parts of arc
adamhathcock Feb 3, 2026
dff17a9
new fix for RewindableStream with tests
adamhathcock Feb 3, 2026
3198b32
Arc is now async
adamhathcock Feb 3, 2026
eedc7c7
Arj async passes with header fix
adamhathcock Feb 3, 2026
08d64ee
format
adamhathcock Feb 3, 2026
1b0ec24
fix deflate rewinding?
adamhathcock Feb 3, 2026
8cff7cb
rewinding works more?
adamhathcock Feb 3, 2026
8759cf0
tests all pass
adamhathcock Feb 4, 2026
3ab4478
use ringbuffer
adamhathcock Feb 4, 2026
7e54f91
fmt
adamhathcock Feb 4, 2026
f67168f
try to fix test
adamhathcock Feb 4, 2026
94716a5
add sync over async dispose
adamhathcock Feb 4, 2026
b93ed79
another sync over async
adamhathcock Feb 4, 2026
7e8005a
fmt
adamhathcock Feb 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions .copilot-agent.yml

This file was deleted.

17 changes: 0 additions & 17 deletions .github/agents/copilot-agent.yml

This file was deleted.

25 changes: 0 additions & 25 deletions .github/prompts/plan-async.prompt.md

This file was deleted.

123 changes: 0 additions & 123 deletions .github/prompts/plan-for-next.prompt.md

This file was deleted.

42 changes: 39 additions & 3 deletions build/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ IEnumerable<string> GetFiles(string d)
}
else
{
// Not tagged - create prerelease version based on next minor version
// Not tagged - create prerelease version
var allTags = (await GetGitOutput("tag", "--list"))
.Split('\n', StringSplitOptions.RemoveEmptyEntries)
.Where(tag => Regex.IsMatch(tag.Trim(), @"^\d+\.\d+\.\d+$"))
Expand All @@ -240,8 +240,22 @@ IEnumerable<string> GetFiles(string d)
var lastTag = allTags.OrderBy(tag => Version.Parse(tag)).LastOrDefault() ?? "0.0.0";
var lastVersion = Version.Parse(lastTag);

// Increment minor version for next release
var nextVersion = new Version(lastVersion.Major, lastVersion.Minor + 1, 0);
// Determine version increment based on branch
var currentBranch = await GetCurrentBranch();
Version nextVersion;

if (currentBranch == "release")
{
// Release branch: increment patch version
nextVersion = new Version(lastVersion.Major, lastVersion.Minor, lastVersion.Build + 1);
Console.WriteLine($"Building prerelease for release branch (patch increment)");
}
else
{
// Master or other branches: increment minor version
nextVersion = new Version(lastVersion.Major, lastVersion.Minor + 1, 0);
Console.WriteLine($"Building prerelease for {currentBranch} branch (minor increment)");
}

// Use commit count since the last version tag if available; otherwise, fall back to total count
var revListArgs = allTags.Any() ? $"--count {lastTag}..HEAD" : "--count HEAD";
Expand All @@ -253,6 +267,28 @@ IEnumerable<string> GetFiles(string d)
}
}

static async Task<string> GetCurrentBranch()
{
// In GitHub Actions, GITHUB_REF_NAME contains the branch name
var githubRefName = Environment.GetEnvironmentVariable("GITHUB_REF_NAME");
if (!string.IsNullOrEmpty(githubRefName))
{
return githubRefName;
}

// Fallback to git command for local builds
try
{
var (output, _) = await ReadAsync("git", "branch --show-current");
return output.Trim();
}
catch (Exception ex)
{
Console.WriteLine($"Warning: Could not determine current branch: {ex.Message}");
return "unknown";
}
}

static async Task<string> GetGitOutput(string command, string args)
{
try
Expand Down
1 change: 0 additions & 1 deletion src/SharpCompress/Archives/ArchiveFactory.Async.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ public static async ValueTask<IAsyncArchive> OpenAsyncArchive(
)
{
readerOptions ??= new ReaderOptions();
stream = SharpCompressStream.Create(stream, bufferSize: readerOptions.BufferSize);
var factory = await FindFactoryAsync<IArchiveFactory>(stream, cancellationToken);
return factory.OpenAsyncArchive(stream, readerOptions);
}
Expand Down
17 changes: 3 additions & 14 deletions src/SharpCompress/Archives/ArchiveFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ public static partial class ArchiveFactory
public static IArchive OpenArchive(Stream stream, ReaderOptions? readerOptions = null)
{
readerOptions ??= new ReaderOptions();
stream = SharpCompressStream.Create(stream, bufferSize: readerOptions.BufferSize);
return FindFactory<IArchiveFactory>(stream).OpenArchive(stream, readerOptions);
}

Expand Down Expand Up @@ -150,24 +149,14 @@ public static T FindFactory<T>(Stream stream)
);
}

// Async methods moved to ArchiveFactory.Async.cs

public static bool IsArchive(
string filePath,
out ArchiveType? type,
int bufferSize = ReaderOptions.DefaultBufferSize
)
public static bool IsArchive(string filePath, out ArchiveType? type)
{
filePath.NotNullOrEmpty(nameof(filePath));
using Stream s = File.OpenRead(filePath);
return IsArchive(s, out type, bufferSize);
return IsArchive(s, out type);
}

public static bool IsArchive(
Stream stream,
out ArchiveType? type,
int bufferSize = ReaderOptions.DefaultBufferSize
)
public static bool IsArchive(Stream stream, out ArchiveType? type)
{
type = null;
stream.NotNull(nameof(stream));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public override Stream OpenEntryStream()
{
//ensure new stream is at the start, this could be reset
stream.Seek(0, SeekOrigin.Begin);
return SharpCompressStream.Create(stream, leaveOpen: true);
return new NonDisposingStream(stream);
}

internal override void Close()
Expand Down
6 changes: 2 additions & 4 deletions src/SharpCompress/Archives/IArchiveEntryExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ namespace SharpCompress.Archives;

public static class IArchiveEntryExtensions
{
private const int BufferSize = 81920;

/// <param name="archiveEntry">The archive entry to extract.</param>
extension(IArchiveEntry archiveEntry)
Comment thread
adamhathcock marked this conversation as resolved.
{
Expand All @@ -28,7 +26,7 @@ public void WriteTo(Stream streamToWriteTo, IProgress<ProgressReport>? progress

using var entryStream = archiveEntry.OpenEntryStream();
var sourceStream = WrapWithProgress(entryStream, archiveEntry, progress);
sourceStream.CopyTo(streamToWriteTo, BufferSize);
sourceStream.CopyTo(streamToWriteTo, Constants.BufferSize);
}

/// <summary>
Expand All @@ -51,7 +49,7 @@ public async ValueTask WriteToAsync(
using var entryStream = await archiveEntry.OpenEntryStreamAsync(cancellationToken);
var sourceStream = WrapWithProgress(entryStream, archiveEntry, progress);
await sourceStream
.CopyToAsync(streamToWriteTo, BufferSize, cancellationToken)
.CopyToAsync(streamToWriteTo, Constants.BufferSize, cancellationToken)
.ConfigureAwait(false);
}
}
Expand Down
Loading
Loading