Skip to content

Conversation

LMG
Copy link
Collaborator

@LMG LMG commented Oct 12, 2021

No description provided.

@LMG LMG added the WIP label Oct 12, 2021
return warnings;
}

fn make_chain(ops: &[Op]) -> Op {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be less code to use the function in line 686 and split the chaining over multiple lines rather than introducing a new helper.

&transaction,
josh::filter::parse(&i)?,
&[(input_ref.to_string(), "refs/JOSH_TMP".to_string())],
josh::filter::nop(),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The result of the permissions filter will be the paths that have missing permissions. So it should probably be josh::filter::empty() and not josh::filter::nop().

require_literal_leading_dot: true,
let check_permissions = args.is_present("check-permission");
let whitelist = josh::filter::nop();
let blacklist = josh::filter::nop();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

blacklist should be josh::filter::empty() by default or?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

src/lib.rs Outdated
let oid = original_commit.id();

if permissions != filter::nop() {
let perms_commit = if let Some(s) = transaction.get_ref(permissions, oid) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why this is needed 🤔

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My idea was to use the nop() filter as a hint that we are not checking permissions. Thus the nop() above also

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But actually you're right, if I just give empty() then it's easier

@LMG LMG force-pushed the permissions branch 7 times, most recently from 3cf0da0 to 3b7edf6 Compare October 13, 2021 14:08

# default same as this
$ josh-filter -s :/ master --check-permission -b :empty -w :nop --update refs/josh/filtered
Warning: reference refs/josh/filtered wasn't updated
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops...

@LMG LMG force-pushed the permissions branch 2 times, most recently from 3feceac to d262f64 Compare October 19, 2021 12:46
@LMG LMG force-pushed the permissions branch 2 times, most recently from 5fd93fe to 0401ee1 Compare December 10, 2021 14:54
@LMG LMG merged commit bf81d61 into master Dec 11, 2021
@LMG LMG deleted the permissions branch December 11, 2021 11:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants