{"thread":{"id":"56735","subject":"[ANN] git-branchstack: make pull-requests without switching branches","startedAt":"2021-10-18T19:58:01Z","lastAt":"2021-10-18T21:04:56Z","messageCount":3,"participants":["Johannes Altmanninger","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"439001","messageId":"20211018195755.pcdpx6xyjeawttyu@gmail.com","threadId":"56735","inReplyTo":null,"subject":"[ANN] git-branchstack: make pull-requests without switching branches","fromName":"Johannes Altmanninger","fromEmail":"aclopte@gmail.com","sentAt":"2021-10-18T19:57:55Z","receivedAt":"2021-10-18T19:58:01Z","isPatch":false,"sender":{"key":"aclopte@gmail.com","avatar":"https://avatars.githubusercontent.com/u/6853872?v=4"},"body":"I like to keep all in-flight commits in a single local branch, so I can test\nthem in combination and update them easily. git-branchstack allows me to\nsend select commits upstream as pull requests (for projects that don't accept\npatches).  By never touching the worktree, it avoids invalidating builds. See\n\n\thttps://github.com/krobelus/git-branchstack\n\nTo implement this I needed a way to reword (change the commit\nmessage) and reparent commits.  I used the \"rebase\" function from [git\nrevise](https://git-revise.readthedocs.io/).  Unlike \"git merge-tree\"\nthis can change commit messages, and allows me to resolve conflicts using a\ntemporary file.  I didn't find another easy way to do this (without touching\nmy worktree/index).  Is there a plumbing command I can use to create a copy\nof a commit, but with a different commit message?\n\nI wonder if there are more use cases for creating/updating commits that are\nnot on the current branch.\nFuture \"git rebase -i\" should only update worktree files when needed (see the\n\"TODO:\" comments in sequencer.c).  Rewording never needs that, so it could,\nin theory, work on branches that are not checked out, though that would\ncomplicate the rebase UI even more.\n"},{"id":"439004","messageId":"xmqqo87mulex.fsf@gitster.g","threadId":"56735","inReplyTo":"20211018195755.pcdpx6xyjeawttyu@gmail.com","subject":"Re: [ANN] git-branchstack: make pull-requests without switching branches","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-10-18T20:29:10Z","receivedAt":"2021-10-18T20:29:15Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Altmanninger <aclopte@gmail.com> writes:\n\n> I wonder if there are more use cases for creating/updating commits that are\n> not on the current branch.\n\nI think the canonical answer to that question is \"git worktree add\"?\n"},{"id":"439006","messageId":"20211018210450.law3hfps3mydoqhe@gmail.com","threadId":"56735","inReplyTo":"xmqqo87mulex.fsf@gitster.g","subject":"Re: [ANN] git-branchstack: make pull-requests without switching branches","fromName":"Johannes Altmanninger","fromEmail":"aclopte@gmail.com","sentAt":"2021-10-18T21:04:50Z","receivedAt":"2021-10-18T21:04:56Z","isPatch":false,"sender":{"key":"aclopte@gmail.com","avatar":"https://avatars.githubusercontent.com/u/6853872?v=4"},"body":"On Mon, Oct 18, 2021 at 01:29:10PM -0700, Junio C Hamano wrote:\n> Johannes Altmanninger <aclopte@gmail.com> writes:\n> \n> > I wonder if there are more use cases for creating/updating commits that are\n> > not on the current branch.\n> \n> I think the canonical answer to that question is \"git worktree add\"?\n\nTrue. Cherry-picking a bunch of commits can be much slower than just\ncreating the commit objects but I don't think that's a problem.\n"}]}