gitext-rs / git-stack

Stacked branch management for Git
Apache License 2.0
508 stars 19 forks source link

Ignore other people's branches pulled for code review #112

Closed epage closed 2 years ago

epage commented 2 years ago

Version

No response

Use Case

@Bouke when dealing with overwhelming output from git-stack

When reviewing other's PRs I typically create a local tracking branch. These typically shouldn't be altered by git-stack, as they are externally owned. I don't fancy having to mark each branch as protected, as that's something that will be overlooked. So maybe we should try and determine un-owned branches by committer name, ignoring those that don't have the last commit from us.

Split from #107

Requirements

Possible Solutions

No response

epage commented 2 years ago

I have considered the idea of auto-detecting protected branches. The case I was thinking of was if someone had not marked a branch as protected, we should avoid showing the 500 commits on it. This would help with #90.

The challenge is getting the heuristic right

arxanas commented 2 years ago

This might not be useful for your use-case, but git-branchless considers a commit to have been authored by you if it was observed by a post-commit or post-rewrite hook. This means:

See also the criteria for surfacing a commit in the smartlog: https://github.com/arxanas/git-branchless/wiki/Command:-git-smartlog#which-commits-are-visible

epage commented 2 years ago

We're intentionally not relying on hooks but this makes me realize I should call out that any detection we do should be based on the Committer rather than the Author (or both?) so changes in history cause us to re-evaluate.

auscompgeek commented 2 years ago

You'd probably want to consider both the Author and Committer - consider that the GitHub web UI has its own committer identity.