Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow listing and resolving @git branches #1687

Merged
merged 4 commits into from
Jun 12, 2023

Conversation

ilyagr
Copy link
Collaborator

@ilyagr ilyagr commented Jun 12, 2023

Also demos jj branch forget behavior with git-tracking branches.

This addresses a portion of #1666 and also includes a commit describing
some nuanced behavior of jj branch forget in a test.

Checklist

If applicable:

  • I have updated CHANGELOG.md
  • [?] I have updated the documentation (README.md, docs/, demos/)
  • (n/a) I have updated the config schema (src/config-schema.json)
  • I have added tests to cover my changes

@ilyagr ilyagr force-pushed the branch-list-git branch 3 times, most recently from 02b3f15 to 93324cc Compare June 12, 2023 03:29
@ilyagr ilyagr marked this pull request as ready for review June 12, 2023 03:30
@ilyagr ilyagr force-pushed the branch-list-git branch 3 times, most recently from 1a43ac4 to 9ed991c Compare June 12, 2023 04:39
CHANGELOG.md Outdated Show resolved Hide resolved
src/commands/branch.rs Outdated Show resolved Hide resolved
src/commands/branch.rs Outdated Show resolved Hide resolved
tests/test_branch_command.rs Outdated Show resolved Hide resolved
src/commands/branch.rs Outdated Show resolved Hide resolved
@ilyagr ilyagr marked this pull request as draft June 12, 2023 18:46
@ilyagr ilyagr force-pushed the branch-list-git branch 7 times, most recently from 83c7f75 to 95e2dc5 Compare June 12, 2023 19:39
@ilyagr ilyagr marked this pull request as ready for review June 12, 2023 19:39
src/commands/branch.rs Outdated Show resolved Hide resolved
This doesn't change the way @git branches are stored in `git_refs` as opposed
to inside `BranchTarget` like normal remote-tracking branches. There are
subtle differences in behavior with e.g. `jj branch forget` and I'm not sure
how easy it is to rewrite `jj git import/export` to support a different
way of storage.

I've decided to call these "local-git tracking branches" since they track
branches in the local git repository. "local git-tracking" branches sounds a
bit more natural, but these could be confused with there are no remote
git-tracking branches. If one had the idea these might exist, they would be
confused with remote-tracking branches in the local git repo.

This addresses a portion of martinvonz#1666
Use `br@git` instead.

Before, if there is not a local branch `br`, jj tried to resolve
it as a git ref `refs/heads/br`. Unchanged from before, `br` can
still be resolved as a tag `refs/tag/br`.
@ilyagr ilyagr merged commit 096538b into martinvonz:main Jun 12, 2023
@ilyagr ilyagr deleted the branch-list-git branch June 12, 2023 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants