Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip & offset not applied when an explicit filter like NO_MERGES is set for LogCommand #116

Open
parasharjoshi opened this issue Dec 5, 2024 · 0 comments

Comments

@parasharjoshi
Copy link

parasharjoshi commented Dec 5, 2024

Version

6.7.0

Operating System

Linux/Unix, Windows

Bug description

When a log command is set with an explicit RevFilter like NO_MERGES or ONLY_MERGES, the properties of maxCount & skip set via the setters is ignored/overridden.

Code block which is expected to set the maxCount & skip is

LogCommand logCommand = git.log();
Iterable<RevCommit> logResult = 
    logCommand
        .setSkip(10)
        .setMaxCount(10)
        .setRevFilter(RevFilter.NO_MERGES)
        .call();

This filters out merge commits but does not skip or limit the results as specified in the setters.

The work around is to set the skip and max RevFilters explicitly in the filter order as following

List revFilters = new  ArrayList();
    revFilters.add(RevFilter.NO_MERGES);// Exclude Merge commits
    revFilters.add(SkipRevFilter.create(10)); // skip
    revFilters.add(MaxCountRevFilter.create(10)); // maxCount
    
Iterable<RevCommit> logResult = 
    logCommand
        .setRevFilter(AndRevFilter.create(revFilters))
        .call();

This is not obvious and not a documented behaviour hence logging this bug.

Actual behavior

The set skip & maxCount are not applied to the LogCommand results

Expected behavior

The set skip & maxCount are applied to the LogCommand results.

Relevant log output

No response

Other information

No response

@parasharjoshi parasharjoshi changed the title Skip & offset filters not set when any explicit filter like NO_MERGES Skip & offset not applied when an explicit filter like NO_MERGES is set for LogCommand Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant