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

Handwired Skeeb Keyboard #8161

Merged
merged 4 commits into from
Mar 7, 2020
Merged

Handwired Skeeb Keyboard #8161

merged 4 commits into from
Mar 7, 2020

Conversation

su8044
Copy link
Contributor

@su8044 su8044 commented Feb 13, 2020

Handwired Keyboard based on the Ergodash. with an OLED similar to Kyria

Description

5 Rows, 14 Columns Split Keyboard with thumb clusters. no rgb or led. just an oled screen with keypresses, layer, keylock and modifiers.

Types of Changes

  • [ ] Core
  • [ ] Bugfix
  • [ ] New feature
  • [ ] Enhancement/optimization
  • Keyboard (addition or update)
  • Keymap/layout/userspace (addition or update)
  • [ ] Documentation

Checklist

  • [ ] My code follows the code style of this project.
  • [ ] My change requires a change to the documentation.
  • [ ] I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • [ ] I have added tests to cover my changes.
  • I have tested the changes and verified that they work and don't break anything (as well as I can manage).

@drashna drashna requested a review from a team February 16, 2020 19:45
keyboards/handwired/myskeeb/rules.mk Outdated Show resolved Hide resolved
keyboards/handwired/myskeeb/rules.mk Outdated Show resolved Hide resolved
@noroadsleft
Copy link
Member

For future reference, we recommend against committing to your master branch as you've done here, because pull requests from modified master branches can make it more difficult to keep your QMK fork updated. It is highly recommended for QMK development – regardless of what is being done or where – to keep your master updated, but NEVER commit to it. Instead, do all your changes in a branch (branches are basically free in Git) and issue PRs from your branches when you're developing.

There are instructions on how to keep your fork updated here:

Best Practices: Your Fork's Master: Update Often, Commit Never

If you need any help with this just ask.

You do not need to close this pull request at this time. Until your pull request is merged, please continue to commit relevant changes to your master branch.

@su8044
Copy link
Contributor Author

su8044 commented Feb 19, 2020

I have made the changes, however, at the time of making the pull request, it says there are 515 files that have changed. i read https://docs.qmk.fm/#/newbs_git_using_your_master_branch before but i could not update my fork. i believe now this was the issue after seeing the differences. any extra guidance on what i did wrong will be very appreciated. i will not touch my command line or git buttons until further guidance to avoid messing anything else, thanks

@noroadsleft
Copy link
Member

I have made the changes, however, at the time of making the pull request, it says there are 515 files that have changed. i read https://docs.qmk.fm/#/newbs_git_using_your_master_branch before but i could not update my fork. i believe now this was the issue after seeing the differences. any extra guidance on what i did wrong will be very appreciated. i will not touch my command line or git buttons until further guidance to avoid messing anything else, thanks

Ah, you have a merge commit in your history, which is why there are so many files here. Your PR has 3 commits, which we'll call C1, C2, and C3 for this exercise. We'll call the commits on QMK's master branch by M#.

Your history looks like this:

  M0---C1------C2---C3
   \           /
   M1 ...... M379

C1 is 7d6cd82, and was applied to M0. Meanwhile, QMK's master branch gained a bunch of commits. Then, C2 (978fa5b) was applied, and has two parent commits: C1 and M379. You can see this here, near the top right. What you should also notice is the text "Showing 2,389 changed files with 58,880 additions and 30,488 deletions." When you merge two branches together, the commit hashes change, and so even if the contents of the changes are the same, Git considers the histories to be separate. C3 (253d905) shows 515 modified files because of the diverged histories.

What you want to do is back up the current state of your master branch. We'll do this by creating a new branch. We're only using it for a temporary backup, and we'll delete it later.

git branch master_old

Now you have two relevant branches: master and master_old, which are the same, but your master branch is still the one checked out. Now, we reset the current branch master so it matches QMK's master branch:

git fetch upstream master
git reset --hard FETCH_HEAD

The first command fetches the state of QMK's master branch (as long as upstream refers to QMK's GitHub repository). The second says "Rewrite my local Git repository (on my computer) so it's identical to the commit that was last fetched." When this completes, your local files and QMK's master branch and their histories are 100% identical.

Since you're only dealing with wanting to add the files relevant to one keyboard that exist in one directory, we can thankfully ignore every other directory. To pull the files for your keyboard, run:

git checkout 253d905 -- keyboards/handwired/myskeeb/

This command means "Write (or rewrite) the files in keyboards/handwired/myskeeb/ to match those in the same directory from commit 253d905." Because your repo matches the state of QMK's master branch, none of the files exist, and so you end up with new files that are yet to be committed:

$ git status 
On branch master
Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
        new file:   keyboards/handwired/myskeeb/config.h
        new file:   keyboards/handwired/myskeeb/keymaps/default/keymap.c
        new file:   keyboards/handwired/myskeeb/myskeeb.c
        new file:   keyboards/handwired/myskeeb/myskeeb.h
        new file:   keyboards/handwired/myskeeb/oled.c
        new file:   keyboards/handwired/myskeeb/rules.mk
        new file:   keyboards/handwired/myskeeb/skeeb_font.c

At this point, run git commit. You'll get a new commit that only contains the addition of your new files. Now, run git push --force-with-lease. This tells Git to push the current state of your master branch (with only the one commit) to your GitHub fork, ignoring the fact that your local master branch isn't descended from the master branch on your fork. (Running git push alone would outright fail with an error message.) When this completes, your PR here will update with the new, clean history. At this point, you don't need the master_old branch, and you can delete it by running git branch -D master_old.

@su8044
Copy link
Contributor Author

su8044 commented Feb 19, 2020

At this point, run git commit. You'll get a new commit that only contains the addition of your new files. Now, run ......

Hi noroadsleft, Thanks for the amazing guide. im slowly starting to understand git. ill be playing a bit with https://learngitbranching.js.org/ to avoid these errors in the future.

after git commit, i get a screen saying

"Please enter the commit message for your changes...."  
"your branch and origin master has 130 and 3 different commits each....."  
"use git pull to merge the remote branch into yours."

but in that screen, i don't know what to do next. it doesn't let me write or do anything else. i imagine at this point i should close msys and reopen it to make the last command "git push --force-with-lease"? in any case i left msys open at the screen that says to enter the commit message waiting for your response. and once again thanks for the guidance..

@noroadsleft
Copy link
Member

noroadsleft commented Feb 19, 2020

after git commit, i get a screen saying

"Please enter the commit message for your changes...."  
"your branch and origin master has 130 and 3 different commits each....."  
"use git pull to merge the remote branch into yours."

My fault, I missed a step of sorts. You've ended up in a vim window. I should have had you pass the commit message as an argument.

  1. Make sure caps lock is turned OFF
  2. Hit i
  3. Type adding Handwired Skeeb Keyboard and press Esc
  4. Type :wq and hit Enter

From there, continue with git push --force-with-lease. You should be okay for the rest of the way.

@su8044
Copy link
Contributor Author

su8044 commented Feb 19, 2020

every thing done with success. so now i should have my branch updated in both my hub and my pc?? should i do another step?

keyboards/handwired/myskeeb/skeeb_font.c Outdated Show resolved Hide resolved
keyboards/handwired/myskeeb/rules.mk Outdated Show resolved Hide resolved
keyboards/handwired/myskeeb/rules.mk Outdated Show resolved Hide resolved
@su8044
Copy link
Contributor Author

su8044 commented Feb 22, 2020

I did the changes Fauxpark recommended on my local files, but I haven't had the time to learn a bit more about git.
For now, I would like to know if I should do a simple update of my branch by:
git checkout master
git fetch upstream
git pull upstream master
git push origin master

then push it with "git push"?

edit: i prefer not to touch anything until you tell me to. i don't want to make you guys work extra if i mess it up again. thanks

@noroadsleft
Copy link
Member

Just run git push here. Don't worry about resynchronizing your master branch until we get your pull request merged.

@su8044
Copy link
Contributor Author

su8044 commented Feb 24, 2020

done. thanks.

edit: i got
$ git push Username for 'https://github.com': Password for 'https://[email protected]': Everything up-to-date
but I don't see it reflected in the Github branches. either qmk nor mine. if it is normal just ignore me

@noroadsleft
Copy link
Member

What's the output of git log -5?

@su8044
Copy link
Contributor Author

su8044 commented Feb 25, 2020

@noroadsleft
Copy link
Member

git status -uno ?

@su8044
Copy link
Contributor Author

su8044 commented Feb 27, 2020

$ git status -uno
Refresh index: 100% (14150/14150), done.
On branch master
Your branch is up to date with 'origin/master'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   keyboards/handwired/myskeeb/rules.mk
        modified:   keyboards/handwired/myskeeb/skeeb_font.c

no changes added to commit (use "git add" and/or "git commit -a")

i assume i should now do:

git add keyboards/handwired/myskeeb/rules.mk
git add keyboards/handwired/myskeeb/skeeb_font.c
git push

????

edit: also i know you guys are merging future branch, so i can wait a bit till then

@noroadsleft
Copy link
Member

i assume i should now do:

git add keyboards/handwired/myskeeb/rules.mk
git add keyboards/handwired/myskeeb/skeeb_font.c
git push

????

Correct.

@su8044
Copy link
Contributor Author

su8044 commented Feb 29, 2020

done,

git log -5: https://pastebin.com/eybaYkGU

$ git status -uno
On branch master
Your branch is up to date with 'origin/master'.

Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
        modified:   keyboards/handwired/myskeeb/rules.mk
        modified:   keyboards/handwired/myskeeb/skeeb_font.c

Untracked files not listed (use -u option to show untracked files)

@noroadsleft
Copy link
Member

Oops, just realized I misread your previous comment.

It seems you have the files added already (Changes to be committed:), but there was a step missing.

Run:

git commit -m "Apply suggestions from fauxpark"  # this was the missing step
git push

@su8044
Copy link
Contributor Author

su8044 commented Mar 2, 2020

IT WORKS! looks like the changes are finally reflected on my git.

anything else i should do?

keyboards/handwired/myskeeb/keymaps/default/keymap.c Outdated Show resolved Hide resolved
keyboards/handwired/myskeeb/rules.mk Show resolved Hide resolved
keyboards/handwired/myskeeb/rules.mk Show resolved Hide resolved
@su8044
Copy link
Contributor Author

su8044 commented Mar 2, 2020

done. should i:

git commit -m "Apply more suggestions from fauxpark"
git push

????

@noroadsleft
Copy link
Member

Yes. Any time you make changes, you should cycle git add -> git commit -> git push.

  • git add: You're telling Git "I want to stage these changes." Staging is like telling your music app "Add this song to my current playlist, but don't start playback yet." You can use:
    • git add -- .: "Stage all the changes to files in my current directory."
      • Running this from qmk_firmware/keyboards/handwired/myskeeb/ will stage any changes in that folder, but ignore changes from anything outside of that folder.
    • git add -- file1 file2 file3: "Stage the changes to file1, file2 and file3." Filenames are relative to your current working directory.
  • git commit: "Bookmark the changes that are currently staged."
    • git commit -m "[some text]": -m is the message argument, and what follows is the commit message. The commit message should be a short description of the changes in the commit being made. Then the commit message tells anyone reading git log what happened. I highly recommend using this syntax.
  • git push: "Update a remote repository with the changes that are different between my local repository and the remote." You don't have to push after every commit, but it's a good idea until you begin to understand Git better.

@su8044
Copy link
Contributor Author

su8044 commented Mar 3, 2020

su804@DESKTOP-XXXXXXX MSYS ~/qmk_firmware
$ git status -uno
On branch master
Your branch is up to date with 'origin/master'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   keyboards/handwired/myskeeb/keymaps/default/keymap.c
        modified:   keyboards/handwired/myskeeb/rules.mk

no changes added to commit (use "git add" and/or "git commit -a")

su804@DESKTOP-XXXXXXX MSYS ~/qmk_firmware
$ git add keyboards/handwired/myskeeb/keymaps/default/keymap.c

su804@DESKTOP-XXXXXXX MSYS ~/qmk_firmware
$ git add keyboards/handwired/myskeeb/rules.mk

su804@DESKTOP-XXXXXXX MSYS ~/qmk_firmware
$ git commit -m "Apply more suggestions from fauxpark and small change to layout"
[master d5180ae09] Apply more suggestions from fauxpark and small change to layout
 2 files changed, 7 insertions(+), 13 deletions(-)

su804@DESKTOP-XXXXXXX MSYS ~/qmk_firmware
$ git push
Username for 'https://github.com':
Password for 'https://[email protected]':
Enumerating objects: 17, done.
Counting objects: 100% (17/17), done.
Delta compression using up to 12 threads
Compressing objects: 100% (7/7), done.
Writing objects: 100% (9/9), 747 bytes | 41.00 KiB/s, done.
Total 9 (delta 6), reused 0 (delta 0)
remote: Resolving deltas: 100% (6/6), completed with 6 local objects.
To https://github.com/su8044/qmk_firmware.git
   65eeb4a93..d5180ae09  master -> master

su804@DESKTOP-XXXXXXX MSYS ~/qmk_firmware
$ git status -uno
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit (use -u to show untracked files)

Alright. changes are done and pushed. i made a small change to the 0 layout. should not be any issues i think.

edit: now that i look back at my code, keymap.c, myskeeb.h, and oled.c, dont have the correct indentation. most are spaces instead of tab and some dont even have the correct spacing. should i fix that too?

Copy link
Member

@noroadsleft noroadsleft left a comment

Choose a reason for hiding this comment

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

now that i look back at my code, keymap.c, myskeeb.h, and oled.c, dont have the correct indentation. most are spaces instead of tab and some dont even have the correct spacing. should i fix that too?

I basically voted for "just the keymap," as it's the file you're most likely to be working in moving forward.

keyboards/handwired/myskeeb/keymaps/default/keymap.c Outdated Show resolved Hide resolved
keyboards/handwired/myskeeb/keymaps/default/keymap.c Outdated Show resolved Hide resolved
keyboards/handwired/myskeeb/keymaps/default/keymap.c Outdated Show resolved Hide resolved
keyboards/handwired/myskeeb/keymaps/default/keymap.c Outdated Show resolved Hide resolved
@drashna drashna requested a review from a team March 6, 2020 23:57
Copy link
Member

@noroadsleft noroadsleft left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@noroadsleft noroadsleft requested a review from fauxpark March 7, 2020 02:11
Copy link
Member

@fauxpark fauxpark left a comment

Choose a reason for hiding this comment

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

LGTM

@noroadsleft noroadsleft merged commit d7ba0ad into qmk:master Mar 7, 2020
@noroadsleft
Copy link
Member

Congratulations on your first pull request!

Now that your pull request is merged, you should resynchronize your master branch so it's easier to keep your QMK Firmware updated. The instructions here should get you sorted. If you need any help just ask!

@su8044
Copy link
Contributor Author

su8044 commented Mar 8, 2020

Excellent! I'll be creating my next keyboard in a few months based on the same design. I have learned a lot and found a new hobby. thank you guys and gals for all your effort and your patience, amazing work and effort on your behalf!

c0psrul3 pushed a commit to c0psrul3/qmk_firmware that referenced this pull request Mar 23, 2020
* adding Handwired Skeeb Keyboard

* Apply suggestions from fauxpark

* Apply more suggestions from fauxpark and small change to layout

* Apply more suggestions from noroadsleft and last tap dance
sowbug pushed a commit to sowbug/qmk_firmware that referenced this pull request Apr 2, 2020
* adding Handwired Skeeb Keyboard

* Apply suggestions from fauxpark

* Apply more suggestions from fauxpark and small change to layout

* Apply more suggestions from noroadsleft and last tap dance
HokieGeek pushed a commit to HokieGeek/qmk_firmware that referenced this pull request Apr 10, 2020
* adding Handwired Skeeb Keyboard

* Apply suggestions from fauxpark

* Apply more suggestions from fauxpark and small change to layout

* Apply more suggestions from noroadsleft and last tap dance
kylekuj pushed a commit to kylekuj/qmk_firmware that referenced this pull request Apr 21, 2020
* adding Handwired Skeeb Keyboard

* Apply suggestions from fauxpark

* Apply more suggestions from fauxpark and small change to layout

* Apply more suggestions from noroadsleft and last tap dance
jakobaa pushed a commit to jakobaa/qmk_firmware that referenced this pull request Jul 7, 2020
* adding Handwired Skeeb Keyboard

* Apply suggestions from fauxpark

* Apply more suggestions from fauxpark and small change to layout

* Apply more suggestions from noroadsleft and last tap dance
jakeisnt pushed a commit to jakeisnt/qmk_firmware that referenced this pull request Aug 20, 2020
* adding Handwired Skeeb Keyboard

* Apply suggestions from fauxpark

* Apply more suggestions from fauxpark and small change to layout

* Apply more suggestions from noroadsleft and last tap dance
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants