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

Add excluded ips #339

Closed
wants to merge 7 commits into from
Closed

Add excluded ips #339

wants to merge 7 commits into from

Conversation

ilyes-ced
Copy link
Contributor

solves issue #283
adds possibility to exclude an ip address x.x.x.x or an ip address with a port x.x.x.x:xxxx
can also exclude multiple ips at the same time with bandwitch -e x.x.x.x -e y.y.y.y --excluded-ipv4-port z.z.z.z:zzzz

@cyqsimon
Copy link
Collaborator

cyqsimon commented Dec 3, 2023

Thanks for contributing. I see that this PR contains commits from #338, so I'll mark it as draft for now so that we don't accidentally merge this before the other one.

It's pretty late where I live, so I'll take a look at the code tomorrow.

@cyqsimon cyqsimon marked this pull request as draft December 3, 2023 17:30
@ilyes-ced
Copy link
Contributor Author

ilyes-ced commented Dec 3, 2023

this PR contains commits from 338 because i cant figure how to remove those commits (still new to github contibuting). but i removed all of those lines from this issue in the last commit
i'll see if i can fix it tomorrow too

@cyqsimon
Copy link
Collaborator

cyqsimon commented Dec 4, 2023

this PR contains commits from 338 because i cant figure how to remove those commits (still new to github contributing).

It's okay, we are happy to help.

When working on distinct features, you always want to create a branch from the base commit before you start working on anything. This is what I would have done to do this cleanly (and what I recommend you do next time):

  1. Run git switch main to get onto the base commit
  2. Run git switch --create feature-1 to start working on feature-1
  3. Run git switch main to get back onto the base commit
  4. Run git switch --create feature-2 to start working on feature-2

But since we are trying to fix this unclean commit log (and I see that in #338 you have committed onto your main branch), this makes things a bit more complicated. No worries though, just follow these steps:

  1. Run git remote add upstream https://github.com/imsnif/bandwhich.git to add this repo as the upstream repo
  2. Run git fetch upstream to sync all references to your local repo
  3. Run git switch --detach upstream/main to go to the commit that upstream/main points to; this gives you a clean starting point
  4. Run git branch -D add-excluded-ips to delete this local branch (don't worry, your commits are still there)
  5. Run git switch --create add-excluded-ips to recreate this local branch, this time from the correct base commit
  6. Run git cherry-pick c23640a to apply your desired commit onto this branch (you can cherry-pick a range of commits too but that's not necessary here)
  7. If any conflicts exist, resolve them then run git cherry-pick --continue
  8. Run git push --force --set-upstream origin add-excluded-ips to force update ilyes-ced:add-excluded-ips

This should give this PR a clean commit log.


but i removed all of those lines from this issue in the last commit

No, never do that. All that does is clobber the commit history more. In fact it may overwrite and erase your changes in #338 once both are merged. The aforementioned steps should cause this commit to be dropped.

@ilyes-ced ilyes-ced closed this by deleting the head repository Dec 4, 2023
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

Successfully merging this pull request may close these issues.

None yet

2 participants