News for hackers. Stuff that matters.
Re:Code in the Browser with GitHub Classroom by darderp on Tuesday May 26, 2020 @11:44PM (#23319161)
How would the auto stashing work if you were to checkout in an irregular pattern? Say I:

- Make changes to branch A

- Checkout B (A changes are auto stashed)

- Make changes to B

- Checkout C (B changes are auto stashed)

- Checkout A again

As far as I know git stashes are FIFO, so it wouldn't be that easy to pop my stash for branch A at this point.

Re:Code in the Browser with GitHub Classroom by nicoburns on Wednesday May 27, 2020 @06:15AM (#23321316)
> As far as I know git stashes are FIFO

This is an aspect of the mechanism that I would like to change. That it isn't easy to pop your stashes once you have more than one going is precisely the problem! It'd probably need to be a separate kind of ref.

Re:Code in the Browser with GitHub Classroom by battery_cowboy on Wednesday May 27, 2020 @12:22AM (#23319365)
I think stashes are tagged with the branch name somehow? When I do a `git stash push && git stash list`, I get something like `stash@{0}: WIP on {branch}: {hash} {commit message...}`.
Re:Code in the Browser with GitHub Classroom by astrobe_ on Wednesday May 27, 2020 @07:38AM (#23321812)
The message you get is an automatic message filled by Git when you don't provide one with the -m option.

Stashes are kind of sort of like branches themselves [1], but they are usually seen as a list, from which you can (cherry-?) pick arbitrary stashes with the apply or pop command, just name it [2]

[1] https://stackoverflow.com/questions/18527171/how-does-stashi...

[2] https://www.git-scm.com/docs/git-stash