rust-lang / rust-lang/compiler-team

Query `git` state to get information on a currently ongoing rebase when encountering conflict markers

Open
#955 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

has-concerns major-change T-compiler
Dominant language
HTML
Stars
433
Forks
73
Avg merge
1m
Merged PRs (30d)
1

Description

Proposal

The rustc parser currently identify patch conflict markers that are caused when trying to merge or rebase code in many different code-control systems, including git. git is the most common amongst our users, so our diagnostic does provide some additional context for them. I'm proposing invoking git to get its .git/rebase-merge directory, which holds the metadata needed by git to understand where it is in a rebase. We can use the same information to surface what the target branch name is, the origin branch name is, and differentiate between a merge conflict caused by git rebase branch-name and git pull. There are other sources of conflict markers in git (like git stash pop and git merge) and other VCSs that could also be supported.

An implementation is present at https://github.com/rust-lang/rust/pull/150233.

Mentors or Reviewers

I'll mentor and review any additional work beyond the above PR.

Process

The main points of the Major Change Process are as follows:

  • File an issue describing the proposal.
  • A compiler team member who is knowledgeable in the area can second by writing @rustbot second or kickoff a team FCP with @rfcbot fcp $RESOLUTION.
  • Once an MCP is seconded, the Final Comment Period begins.
    • Final Comment Period lasts for 10 days after all outstanding concerns are solved.
    • Outstanding concerns will block the Final Comment Period from finishing. Once all concerns are resolved, the 10 day countdown is restarted.
    • If no concerns are raised after 10 days since the resolution of the last outstanding concern, the MCP is considered approved.

You can read more about Major Change Proposals on forge.

[!CAUTION]

Concerns (1 active)

Managed by @rustbot—see help for details.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the rustc parser's conflict-marker diagnostic and the implementation linked in the proposal. Read Git's .git/rebase-merge metadata and the active concern before deciding scope; done means an approved, reviewed change that adds the proposed rebase context without expanding beyond the agreed design.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, rust
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.