How to find a change in a commit in git?
Use git log
:
git log -S <String to search for> --author <author to restrict by, usually it's you> --since <how long since you made the change>
Moving some files from one commit to another branch
Say you've added a few files to a commit and you decide later to move it to a different branch. You need a couple of git commands:
First. You need to split the commit into multiple commits which done via an interactive rebase:
-
git rebase -i HEAD~n
(the number of commits you want to go back - https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History (look for splitting a commit)
- adjust branch to look the way you want
- then do a
git rebase --onto
Fixing a git repo
If git complains with this error:
fatal: bad object refs/remotes/origin/HEAD
error: failed to run repack
This may happen if upstream branches have been removed and your origin is pointing to it. You can confirm this by running:
cat .git/refs/remotes/origin/HEAD
If it is pointing to a branch that doesn't exist,
Running git remote set-head origin --auto
followed by git gc
will fix it
team capacity stuff
calculate start date by looking at the start of the sprint
throughput forecaster spreadsheet from troy - focusedobjectives.com
Removing the @ Hack in Rails Controllers
Article on rails about not using @vsrisbles in controllers. Really nice approach
Deliver:2018 notes
- Architect Community of Practice
- Architecture over Architects
- Architecture Community
- Anti-Pattern: Architect as Project Manager
- Anti-Pattern: "Latest Tech" Driven Architect
- Anti-Pattern: Abdicate Architect (Hands-Off Architect)
- Anti-Pattern: Resume Driven Architect
- Anti-Pattern: Architect Overruled by Product
- Pattern: Architect coaching other Architects
Wishing Retrospective
This retrospective was run as part of an employee on boarding experience. It was a small group (3 participants).
Goal: Where are we, what does success look like? (Futurespective)
Time: 1 hr
Structure
- Weather Report (set the stage)
- Genie in a bottle (gather data)
- Wish Granted (generate insights)
- 3x3 (decide what to do)
All activities were from retromat
Notes:
Overall this retrospective was pretty good. The activities meshed pretty well with each other and I was able to spin a nar...
Spot the elephant activity
Great for uncovering psychological safety issues
https://plans-for-retrospectives.com/en/?id=130
Ruby meta programming intro
An article on meta-programming in ruby. Source to use as inspiration for screenplay pattern in ruby
Build your own RSpec - introduction to DSL and metaprogramming
BDD Stuff
Acceptance criteria should give a binary yes/no response. They need to be ambiguous in order to test them. Without the binary response it is unclear whether the system is complete and behaves as intended (Writing Great Specifications p. 86)
Speci-fication - (The made up word from Writing Great Specifications) - a document that attempts to be the single source of truth, but can't be because no one is willing to keep it up to date - Speci-fication is "an illusion of correction" - it misleads the reader in thinking that it describes the system...
What is BDD?
There isn't a single definition for it. Which is good since it allows the practices to evolve. It's also a barrier to people being introduced to it, since there isn't a single definitive example that says: "This is BDD". Different practitioners have their own definitions and rules and practices.
- It's like Jazz - A group of people with different skills, improvising in co-ordination
- There are some rules that are pretty common:
- Representatives from IT and business
- It's not a solo activity
- It's not someone (eg. a project manage...
Improv Card exercises
Links to various exercises to use M3.0 improv cards:
http://noop.nl/2015/05/improv-cards.html
https://www.britta-ollrogge-consulting.de/blog/improv-cards/
Setting up a new environment
Version control (ie. git) your home directory. The post below describes a process (and has further links to examples) of a way that moves the whole version control aspect away:
https://developer.atlassian.com/blog/2016/02/best-way-to-store-dotfiles-git-bare-repo/
How does Cucumber find supporting code?
The directories scanned for steps are determined by the feature file(s)/directories passed to the cucumber command. Cucumber will look in the sub-directories of the feature files
features
billing
credit_card.feature
scoring
multi_player.feature
single_player.feature
step_definitions
billing_steps.rb
scoring_steps.rb
Cucumber will run correctly from the features directory, but if you want to run a single feature you need to pass the -r, --require
command line argument:
$ cucumber billing/credit_c...
Specifying constants in Cucumber Transforms
Usually a cucumber step definition will have some sort of regular expression capture:
Given(/^I have (\d+) dollars in my account$/) do |amount|
#step logic
end
As the Given is specified above the amount argument will still be a string. A Transform method can convert that to a number (instead of doing the conversion directly in the step definition itself:
Transform(/^\d+$/) do |number|
number.to_i
end
Cucumber also supports an even more awesome capability: The ability to name transforms and use them in step ...
Cleaning up feature branches in git
After working on a feature in a separate branch, keeping the branch around is unnecessary. To clean up afterwards, run the following:
git push origin --delete <branch_to_delete>
git branch -D <branch_to_delete>
nutrella - create a Trello board based on a git branch
Rationale: Working in a git feature branch is convenient, the Trello board acts as a simple todo list specific to that work. Useful for sharing thoughts with other people also working on the branch
Working with branches in git
This is a good description of working with merging or rebasing in git. What they do and how to deal with them
using Touch ID for sudo
Pro MacBook Pro Tip: have a Touch Bar with Touch ID? If you edit /etc/pam.d/sudo and add the following line to the top…
auth sufficient pam_tid.so
…you can now use your fingerprint to sudo!