DEV Community

Cover image for 3 ways to retain your dev flow between sessions πŸ’ͺ

3 ways to retain your dev flow between sessions πŸ’ͺ

Jerod Santo on January 17, 2019

Context switching. Computers are great at it, humans suck at it. Every time we developers lose the context of our current task we're forced to was...
Collapse
 
exadra37 profile image
Paulo Renato • Edited

Never leave code to be commit-ed in your machine... you may end up to learn it in the hard way, like when your disk breaks apart and you loose all your precious work.

I use ZSH shell that have pretty handy git alias:

╭─exadra37@thinkpap-l460 ~  
β•°β”€βž€  alias | grep gwip -  
gwip='git add -A; git rm $(git ls-files --deleted) 2> /dev/null; git commit --no-verify -m "--wip-- [skip ci]"'
╭─exadra37@thinkpap-l460 ~  
β•°β”€βž€  alias | grep gunwip -
gunwip='git log -n 1 | grep -q -c "\-\-wip\-\-" && git reset HEAD~1'

So my workflow is:

  • gwip to commit all dirty changes, including untracked files, therefore everything.
  • git push origin feature-wip to push my changes to a work in progress branch. This saves me in case my disk goes dead.

When I am back to the project:

  • gunwip to get back git to the same exact dirty stage it was before I applied gwip.

When I am ready to perform a clean commit:

  • git checkout feature to switch back to the branch from where I derivedfeature-wip.
  • git commit -sam 'my message' it may need git add . before if untracked files exist.
  • git push origin feature always play safe and push your most recent commits to upstream.

I hope that it helps someone :)

Collapse
 
sergsoares_15 profile image
Sergio Soares

This can be live change.

Thanks man

Collapse
 
exadra37 profile image
Paulo Renato

It was for me... Cannot live without Oh-My-ZSH ;)

Collapse
 
mertsimsek profile image
Mert Simsek

wow that is wonderful!

Collapse
 
weirdmayo profile image
Daniel Mayovsky

Will this work on a bash shell alias?

Collapse
 
exadra37 profile image
Paulo Renato

yes it will, just add both alias to your ~/.bashrc or try Oh My ZSH and I bet with you that you will not come back to bash :)

I can live without Oh My ZSH, but life wouldn't be the same ;)

Collapse
 
dance2die profile image
Sung M. Kim

When I have multiple tasks/projects going on, I usually build a mind map (after breaking down tasks into even smaller tasks) to track where I was previously.

I add checkboxes for ones I finished thus making it easy to go back and force between tasks/projects.

mindmap
blurred as it's work-related and can't reveal

Collapse
 
yorodm profile image
Yoandy Rodriguez Martinez • Edited

applies some CSI style bullsh*t to the image

So..., now I know your secrets....

Collapse
 
dance2die profile image
Sung M. Kim

Time to mindmap how to cover up my secrets πŸ˜ƒ

Collapse
 
maestromac profile image
Mac Siri

what tool is that 😲

Collapse
 
dance2die profile image
Sung M. Kim

Any MindMapping tool would do but I've been using MindMeister.

Collapse
 
jerodsanto profile image
Jerod Santo

Cool! You are undoubtedly more disciplined in your work than I am... 🀣

Collapse
 
dance2die profile image
Sung M. Kim • Edited

A down side is that a dev told he wouldn't want me as his manager lest I might micro-manage using the mind map πŸ˜› (I am not a manager btw)

Collapse
 
sergsoares_15 profile image
Sergio Soares

Great post, I do a lot #2 (Test Failing) and too failing try #1 (Leave Notes).

But man, My stage area are always dirty. How a programming is working with it clean more than 5 minutes =)

Thanks for sharing.

Collapse
 
m1guelpf profile image
Miguel Piedrafita

Turned your article into audio to listen to it on my way to school. Dropping here a link in case it's useful to anyone else :)

Collapse
 
_bigblind profile image
Frederik πŸ‘¨β€πŸ’»βž‘οΈπŸŒ Creemers

I sometimes do an extended version of the git dirty tip, where I stop in the middle of writing a function. I often find it hardest to get going in the morning, and starting in the middle of a function/class/... in progress gives me a clear first thing to do.

Collapse
 
simoroshka profile image
Anna Simoroshka

It helps me to have a checkbox/todo list of really small parts of the task. The smaller, the better.
For big problems I actually find it beneficial to have a break, especially overnight. The flow can be sometimes dangerous as you don't stop to see the big picture and ask yourself "is this what should I be doing?"

Collapse
 
aghost7 profile image
Jonathan Boudreau • Edited

Context switching. Computers are great at it, humans suck at it.

Actually, context switching is a really expensive CPU operation πŸ€“.

Collapse
 
jerodsanto profile image
Jerod Santo

Heh, fair point. The good news is CPU operations are cheap and plentiful! πŸ˜‰

Collapse
 
codingmindfully profile image
Daragh Byrne

Love it. Here is my take on flow.

Collapse
 
npandey25 profile image
nitish pandey

Use task focused workflow aided by mylyn in Eclipse

Collapse
 
andreasjakof profile image
Andreas Jakof

Call methods, which are not there, yet. Helps you structure your flow, keeps you at the problem at hand and if you leave and come back, it waits there for you to become implemented.