You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Convince me @dahlbyk ...
Right now I've got a bunch of verbs with the same "Branch" noun:
New-Branch, Remove-Branch, Get-Branch, Set-Branch, Save-Branch, Merge-Branch, etc.
Maybe I'm too far in the weeds, but to me there is an important distinction between a Commit (content + parent(s) + metadata) and a Branch (a reference that updates when you commit while it's checked out). Would Save-Branch work if I don't actually have a branch checked out? Can I pipe a branch into Save-Branch? The noun just doesn't make sense to me for actions involving creating commits.
The same would go for Merge-Branch - you merge one or more commits that may or may not be identified by a branch reference.
The others align well for manipulating the branch references themselves, a la git branch.
I guess if we make "index" a noun, we could reuse it in a few other places.
And of course, maybe I'm not far enough in the weeds (If so, can you give me a simple script test-case/example?)
Is it possible for a working directory to be in a state where no branch is checked out?
Is it possible to make a commit that isn't against any branch?
I guess the question is how much are we simplifying this command? I mean, I'm taking it for granted that we're not going to expose most of the built-in parameters. After all, I love a good fixup/squash/reuse with rebase interactive, but:
I guess if we make "index" a noun, we could reuse it in a few other places.
Reset-GitIndex for the path version of reset sticks out in my mind. Not sure what else?
For the git commit analog, discoverability might drive toward Save-GitCommit or even New-Commit?
Is it possible for a working directory to be in a state where no branch is checked out?
Yep - it's called a "detached HEAD". You might get there if you checkout a tag, for example. You're also technically in that state in the middle of a rebase, though posh-git will show you the branch you're rebasing if possible.
Is it possible to make a commit that isn't against any branch?
Yep. Not super common since creating branches is so cheap, but nothing prevents it and I do so every once in a while. Simple example:
cat .git/HEAD # likely ref: refs/heads/some-branch
git checkout HEAD~0 # detach at current HEAD
cat .git/HEAD # now a 40-digit SHA
git commit --allow-empty -m 'Headless!'
git log --oneline --decorate # should see previous branch as parent
git checkout -b new-branch # create new-branch at new commit
I guess the question is how much are we simplifying this command? I mean, I'm taking it for granted that we're not going to expose most of the built-in parameters.
Agree 100% that many parameters won't have any use. Like --porcelain or -z for machine-readable output...because PowerShell. 😀 The "ROI" for most parameters just won't be there unless you find a motivated contributor that really cares about GPG signing.
That said, I expect (hope?) you'll find enough more advanced
Activity
dahlbyk commentedon May 16, 2015
Save-GitIndexorSave-GitCommit(since commit is also a noun)?Jaykul commentedon May 17, 2015
Convince me @dahlbyk ...
Right now I've got a bunch of verbs with the same "Branch" noun:
New-Branch, Remove-Branch, Get-Branch, Set-Branch, Save-Branch, Merge-Branch, etc.
dahlbyk commentedon May 17, 2015
Maybe I'm too far in the weeds, but to me there is an important distinction between a Commit (content + parent(s) + metadata) and a Branch (a reference that updates when you commit while it's checked out). Would
Save-Branchwork if I don't actually have a branch checked out? Can I pipe a branch intoSave-Branch? The noun just doesn't make sense to me for actions involving creating commits.The same would go for
Merge-Branch- you merge one or more commits that may or may not be identified by a branch reference.The others align well for manipulating the branch references themselves, a la
git branch.Jaykul commentedon May 18, 2015
I guess if we make "index" a noun, we could reuse it in a few other places.
And of course, maybe I'm not far enough in the weeds (If so, can you give me a simple script test-case/example?)
I guess the question is how much are we simplifying this command? I mean, I'm taking it for granted that we're not going to expose most of the built-in parameters. After all, I love a good fixup/squash/reuse with rebase interactive, but:
GPG-signtheir commits?templatesfor commit messages?dry-run?cleanupon their commit messages?dahlbyk commentedon May 18, 2015
Reset-GitIndexfor the path version ofresetsticks out in my mind. Not sure what else?For the
git commitanalog, discoverability might drive towardSave-GitCommitor evenNew-Commit?Yep - it's called a "detached HEAD". You might get there if you
checkouta tag, for example. You're also technically in that state in the middle of arebase, though posh-git will show you the branch you're rebasing if possible.Yep. Not super common since creating branches is so cheap, but nothing prevents it and I do so every once in a while. Simple example:
Agree 100% that many parameters won't have any use. Like
--porcelainor-zfor machine-readable output...because PowerShell. 😀 The "ROI" for most parameters just won't be there unless you find a motivated contributor that really cares about GPG signing.That said, I expect (hope?) you'll find enough more advanced