keith / git-pile Goto Github PK
View Code? Open in Web Editor NEWStacked diff support for GitHub workflows
License: MIT License
Stacked diff support for GitHub workflows
License: MIT License
Right now you always have to specify a sha, this is a bit annoying if you have to git log --oneline
or something first. I use a fuzzy finder to jumping between recent commits and insert the sha but we could probably make that standard
If you have a stack of PRs right now, you have to manually run rebasepr on each one as the bottom of the stack merges. Ideally you could do git rebasepr -n 3
or git rebasepr sha1...sha2
or something similar to virtually just do a for each commit, rebase it
Right now you can run git submitpr --onto foo
to submit a single PR against an specific sha, theoretically we could support something like git submitpr sha1...sha2
that submitted multiple stacked PRs. I could potentially see this specific UX to be used for submitting multiple non-stacked PRs, so I'm not sure what the best path is, but this could be nice a improvement
currently if a commit message contains a leading .
the commit will fail to be submitted since branches with leading periods aren't valid
Thanks for the awesome set of scripts! I'm loving this workflow
One thing I've found myself needing to do sometimes is take a PR, and "convert" it to a commit on my pile. I think I could create a git pullpr
command for this that merged the PR locally, and squashed all the commits. Ideally it gets it into a state where you could then update the PR if you needed. I started working on this here keith/dotfiles#13
While chained PRs isn't really the goal of git-pile, and it doesn't really help you with merging things, or anything on the GitHub side of things. It mostly just works if you create the PRs with the right bases, and squash and merge. I have a prototype of this here keith/dotfiles#14 that I should finish up
If you submit a PR for a repo, then remove the main clone of that repo, reclone it, and submit another PR from it, the original worktree setup in the git-pile cache is no longer attached to the main clone. Submitting a PR fails and you have to remove the pile cache repo to unblock
Has anyone seen this when trying to install via homebrew on an M1 Mac?
==> Fetching keith/formulae/git-pile
==> Downloading https://github.com/keith/git-pile/archive/refs/tags/0.4.0.tar.gz
Already downloaded: /Users/keny/Library/Caches/Homebrew/downloads/a620102ff8aa0a9771a1baa34f68fee0c17baef0beedd3e64001b3dde152533f--git-pile-0.4.0.tar.gz
Error: git-pile: SHA256 mismatch
Expected: 417fbb477904f4ac476c0c369008a42e6e17e5365c1ef1d527c001bad2656481
Actual: 9921c816b1594cbcede13ec5fb58339a07d372998fcc557eea203a1542ef4844
File: /Users/keny/Library/Caches/Homebrew/downloads/a620102ff8aa0a9771a1baa34f68fee0c17baef0beedd3e64001b3dde152533f--git-pile-0.4.0.tar.gz
To retry an incomplete download, remove the file above.
Deleting the file and retrying
brew install keith/formulae/git-pile
doesn't work.
And any relation to this project? https://github.com/git-pile/git-pile
I deleted a repo and re-cloned it. None of the git-pile commands were working with the error
fatal: '/Users/ian/.cache/git-pile/883576d7f2ec3e1a7017ea994aaec631' is not a working tree
I had to remove the working tree using rm $(git pileworktreepath)
Could this be done in the git-pilereset
command?
% g submitpr --draft
+ command -v gh
+ commit_arg=HEAD
+ [[ 1 -gt 0 ]]
+ [[ --draft != --* ]]
+ [[ --draft == \-\-\o\n\t\o ]]
++ git rev-parse HEAD
+ commit=db060d8f3c6b9977ee056bfc710a664ec7effd5f
+ upstream_ref='@{upstream}'
++ git pilebranchname db060d8f3c6b9977ee056bfc710a664ec7effd5f
+ branch_name=ks/lint-add-rule-for-using-testkit
+ [[ -n '' ]]
+ git show-ref --verify --quiet refs/heads/ks/lint-add-rule-for-using-testkit
++ git rev-parse --abbrev-ref --symbolic-full-name '@{upstream}'
+ branch_with_remote=origin/master
+ remote_branch_name=master
+ git branch --no-track ks/lint-add-rule-for-using-testkit '@{upstream}'
++ git pileworktreepath
+ worktree_dir=/Users/ksmiley/.cache/git-pile/97f8f5ae0db37e213f59795d2a8f7d30
+ [[ ! -d /Users/ksmiley/.cache/git-pile/97f8f5ae0db37e213f59795d2a8f7d30 ]]
+ git -C /Users/ksmiley/.cache/git-pile/97f8f5ae0db37e213f59795d2a8f7d30 switch --quiet ks/lint-add-rule-for-using-testkit
+ trap _detach_branch EXIT
+ git -C /Users/ksmiley/.cache/git-pile/97f8f5ae0db37e213f59795d2a8f7d30 cherry-pick db060d8f3c6b9977ee056bfc710a664ec7effd5f
error: could not apply db060d8f3c6... [lint] Add rule for using TestKit
hint: After resolving the conflicts, mark them with
hint: "git add/rm <pathspec>", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".
+ git -C /Users/ksmiley/.cache/git-pile/97f8f5ae0db37e213f59795d2a8f7d30 mergetool
Merging:
Modules/TestKit/Sources/Assertions.swift
Modules/TestKit/Sources/Exports.swift
Deleted merge conflict for 'Modules/TestKit/Sources/Assertions.swift':
{local}: deleted
{remote}: modified file
Use (m)odified or (d)eleted file, or (a)bort? ^C++ _detach_branch
++ git -C /Users/ksmiley/.cache/git-pile/97f8f5ae0db37e213f59795d2a8f7d30 switch --detach --quiet
fatal: cannot switch branch while cherry-picking
Consider "git cherry-pick --quit" or "git worktree add".
Steps to reproduce:
$ touch file1
$ git add -A
$ git commit -m "file1"
$ git submitpr
$ touch file2
$ git commit -m "file2"
$ git submitpr --onto head~1
unknown flag: --onto
Usage: gh pr create [flags]
Flags:
-a, --assignee login Assign people by their login. Use "@me" to self-assign.
-B, --base branch The branch into which you want your code merged
-b, --body string Body for the pull request
-F, --body-file file Read body text from file (use "-" to read from standard input)
-d, --draft Mark pull request as a draft
-f, --fill Do not prompt for title/body and just use commit info
-H, --head branch The branch that contains commits for your pull request (default: current branch)
-l, --label name Add labels by name
-m, --milestone name Add the pull request to a milestone by name
--no-maintainer-edit Disable maintainer's ability to modify pull request
-p, --project name Add the pull request to projects by name
--recover string Recover input from a failed run of create
-r, --reviewer handle Request reviews from people or teams by their handle
-t, --title string Title for the pull request
-w, --web Open the web browser to create a pull request
Hi,
Thanks for putting the time into releasing this!
There seems to be some issues with the --onto
option that yields unknown flag: --onto
. Using latest version 0.3.0
.
Steps to reproduce:
$ vim file1
$ # Make some changes...
$ git add -A
$ git commit -m 'file1'
$ vim file2
$ # Make some changes...
$ git add -A
$ git commit -m 'file2'
$ git submitpr --onto HEAD~1
unknown flag: --onto
Usage: gh pr create [flags]
Flags:
-a, --assignee login Assign people by their login. Use "@me" to self-assign.
-B, --base branch The branch into which you want your code merged
-b, --body string Body for the pull request
-F, --body-file file Read body text from file (use "-" to read from standard input)
-d, --draft Mark pull request as a draft
-f, --fill Do not prompt for title/body and just use commit info
-H, --head branch The branch that contains commits for your pull request (default: current branch)
-l, --label name Add labels by name
-m, --milestone name Add the pull request to a milestone by name
--no-maintainer-edit Disable maintainer's ability to modify pull request
-p, --project name Add the pull request to projects by name
--recover string Recover input from a failed run of create
-r, --reviewer handle Request reviews from people or teams by their handle
-t, --title string Title for the pull request
-w, --web
Right now the few configuration variables are all env vars, it might make sense to move this configuration to the gitconfig instead so it's in a standard place users likely already understand, and so they could potentially vary per project if users wanted. One great use case for varying per project would be if we allowed default configuration for arguments passed to gh pr create
, where you might want to add the same reviewers always on some projects but not others
If you resolve a conflict and manually edit and add another file in the rebase, when you rebasepr it won't pick up the manually edited change, using replacepr can fix it but isn't ideal
If you submit a pr with git submitpr --onto SOMETHING
and then git rebasepr
the chained PR, it is still rebased against the main branch.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.