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

Script for installing packages in linux #72

Merged

Conversation

theathral
Copy link
Contributor

The script downloads the packages that are necessary for the sherlock.py. It is an automated procedure instead of the instructions in the README.md.
It contains some packages that are not in README but I couldn't run "pip3 install -r requirements.txt" without them.
It is for linux, I don't know if it works on something else.

I believe it is useful!

Sorry for the extra files from previous pull request (if they are shown), but I'm new on Github and I' confused with commits and forks.

@TheYahya TheYahya added enhancement New feature or request help wanted Extra attention is needed labels Jan 3, 2019
data.json Outdated Show resolved Hide resolved
@nareddyt
Copy link
Contributor

nareddyt commented Jan 3, 2019

As requested, I'll give a brief overview of what I think the problem is and how you can fix it. Feel free to ask questions, especially if you don't fully understand any of the terminology (branch vs fork, etc.).

Background Info

A fork is essentially a copy of this main repo that you have full control over. When you make changes to the code, you don't actually have permission to push that code to branches on @TheYahya's repo. Instead, you made a copy of the entire repo and push your changes to that copy. When you submit a PR on GitHub, you are essentially "requesting" @TheYahya to "pull" the changes from a specific branch in your repo into master branch on his repo (hence the name "pull request"). You can see this in the PR heading:

image

Notice the blue fields specify <repo-name> : <branch-name>

The Problem

Looking at your fork, the problem is that you worked on PR #64 directly on your fork's master branch. We can see your commit for PR #64 directly on theodosisathanasakis:master. Instead, you should always keep your fork's master branch up to date with the main repo's master branch, and make each PR in a separate branch on your fork.

You did that for this PR (you used branch theodosisathanasakis-script), which is good! However, because your previous PR made changes directly in master, theodosisathanasakis-script also received these changes. We can see the commit (from PR #64) above.

image

Fixing the Issue

Because PR #64 is still open and is based directly of your fork's master branch, we DO NOT want to modify anything on the master branch just yet. If we do, then we would mess up that PR.

So we'll have to workaround this. Essentially what we want to do is "delete" the 2nd to last commit (the "regexCheck" commit) but "keep" the last commit (the "linux script") on this branch. To do so, we will actually "delete" both commits and "re-copy" the last commit manually. More specifically, we will:

  • Copy the commit id of the "linux script" commit, which is f84629cc460f1501f49dceef6fbffbc40106981c. You can find this id by doing git log or by looking at your commits in your "script" branch.
  • Delete the last 2 commits from the branch. Note that this doesn't actually delete your work from git. The commits will still exist in git, just not in the branch.
  • Cherry-pick the "linux script" commit onto the branch (using the commit id above). This will essentially copy that last commit onto your branch without copying the "regexCheck" commit.
  • Double check the work, and then force push to your fork. GitHub will automatically pick up on the changes and modify this PR to match your branch.

Here's the commands to do so. Please make sure you're on the theodosisathanasakis-script branch and you have no changes to commit when you do this!

  1. Delete 2 commits from branch: git reset HEAD~2
  2. Cherry-pick only last commit onto branch: git cherry-pick f84629cc460f1501f49dceef6fbffbc40106981c
  3. Ensure files look correct and your script exists. Do a git log and make sure it has your "script" commit but not the "regexCheck" commit.
  4. Force push to your fork: git push --force

Don't worry if you mess up! I made a copy of your work and can restore it if you accidentally delete it ;)

@theathral
Copy link
Contributor Author

Thank you so much. I will try it later today, but what about my master branch? How can I change it to be up-to-date but this will not affect both PRs?

@nareddyt
Copy link
Contributor

nareddyt commented Jan 3, 2019

Thank you so much. I will try it later today, but what about my master branch? How can I change it to be up-to-date but this will not affect both PRs?

We can't change the master branch until PR #64 is either merged or closed. As soon as that happens, we can change it!

@theathral
Copy link
Contributor Author

Before I do anything, I should say that I didn't use cmd to do both #64 and #72. I did it by changing the files from github website. Is there a problem? I have cloned the project and have made changes at my computer too, but no other interraction between cmd and github.

@nareddyt
Copy link
Contributor

nareddyt commented Jan 3, 2019

You will need to use cmd to run all the above operations (github doesn't support this advanced setup), but your previous changes will be fine. All those changes will show up locally.

Just make sure you cloned your fork, as that has the changes. Do not clone the main repo.

After cloning, checkout the theodosisathanasakis-script branch so you can run the commands in the previous reply. git checkout theodosisathanasakis-script

Then run git status just to make sure you are on the correct branch and NOT on master.

@theathral
Copy link
Contributor Author

Thank you so much again. It would be done as soon as possible! :)

The script downloads the packages that are necessary for the sherlock.py. It is an automated procedure instead of the instructions in the README.md.
It contains some packages that are not in README but I couldn't run "pip3 install -r requirements.txt" without them.
It is for linux, I don't know if it works on something else.

I believe it is useful!
@theathral
Copy link
Contributor Author

I think I did it! Please, tell me if there is a problem again.

Copy link
Contributor

@nareddyt nareddyt left a comment

Choose a reason for hiding this comment

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

Looks great!

@nareddyt nareddyt merged commit d717970 into sherlock-project:master Jan 4, 2019
@nareddyt
Copy link
Contributor

nareddyt commented Jan 4, 2019

Thanks for your contribution, I have merged it. Let me know if anything else about git/github is unclear!

@theathral
Copy link
Contributor Author

Everything is clear now, your explenations were crystal clear! :)

@theathral theathral deleted the theodosisathanasakis-script branch January 4, 2019 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants