forked from mirrors/jj
1898 lines
No EOL
51 KiB
HTML
1898 lines
No EOL
51 KiB
HTML
|
|
<!doctype html>
|
|
<html lang="en" class="no-js">
|
|
<head>
|
|
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
|
|
|
|
|
|
<link rel="canonical" href="https://martinvonz.github.io/jj/v0.13.0/design/tracking-branches/">
|
|
|
|
|
|
<link rel="prev" href="../run/">
|
|
|
|
|
|
|
|
<link rel="icon" href="../../assets/images/favicon.png">
|
|
<meta name="generator" content="mkdocs-1.5.3, mkdocs-material-9.4.7">
|
|
|
|
|
|
|
|
<title>Tracking branches - Jujutsu docs</title>
|
|
|
|
|
|
|
|
<link rel="stylesheet" href="../../assets/stylesheets/main.4b4a2bd9.min.css">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,700,700i%7CRoboto+Mono:400,400i,700,700i&display=fallback">
|
|
<style>:root{--md-text-font:"Roboto";--md-code-font:"Roboto Mono"}</style>
|
|
|
|
|
|
|
|
<script>__md_scope=new URL("../..",location),__md_hash=e=>[...e].reduce((e,_)=>(e<<5)-e+_.charCodeAt(0),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</head>
|
|
|
|
|
|
<body dir="ltr">
|
|
|
|
|
|
|
|
<script>var palette=__md_get("__palette");if(palette&&"object"==typeof palette.color)for(var key of Object.keys(palette.color))document.body.setAttribute("data-md-color-"+key,palette.color[key])</script>
|
|
|
|
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
|
|
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
|
|
<label class="md-overlay" for="__drawer"></label>
|
|
<div data-md-component="skip">
|
|
|
|
|
|
<a href="#remotegit-tracking-branches" class="md-skip">
|
|
Skip to content
|
|
</a>
|
|
|
|
</div>
|
|
<div data-md-component="announce">
|
|
|
|
</div>
|
|
|
|
<div data-md-color-scheme="default" data-md-component="outdated" hidden>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<header class="md-header md-header--shadow" data-md-component="header">
|
|
<nav class="md-header__inner md-grid" aria-label="Header">
|
|
<a href="../.." title="Jujutsu docs" class="md-header__button md-logo" aria-label="Jujutsu docs" data-md-component="logo">
|
|
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54Z"/></svg>
|
|
|
|
</a>
|
|
<label class="md-header__button md-icon" for="__drawer">
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3V6m0 5h18v2H3v-2m0 5h18v2H3v-2Z"/></svg>
|
|
</label>
|
|
<div class="md-header__title" data-md-component="header-title">
|
|
<div class="md-header__ellipsis">
|
|
<div class="md-header__topic">
|
|
<span class="md-ellipsis">
|
|
Jujutsu docs
|
|
</span>
|
|
</div>
|
|
<div class="md-header__topic" data-md-component="header-topic">
|
|
<span class="md-ellipsis">
|
|
|
|
Tracking branches
|
|
|
|
</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<label class="md-header__button md-icon" for="__search">
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5Z"/></svg>
|
|
</label>
|
|
<div class="md-search" data-md-component="search" role="dialog">
|
|
<label class="md-search__overlay" for="__search"></label>
|
|
<div class="md-search__inner" role="search">
|
|
<form class="md-search__form" name="search">
|
|
<input type="text" class="md-search__input" name="query" aria-label="Search" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="search-query" required>
|
|
<label class="md-search__icon md-icon" for="__search">
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5Z"/></svg>
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12Z"/></svg>
|
|
</label>
|
|
<nav class="md-search__options" aria-label="Search">
|
|
|
|
<button type="reset" class="md-search__icon md-icon" title="Clear" aria-label="Clear" tabindex="-1">
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41Z"/></svg>
|
|
</button>
|
|
</nav>
|
|
|
|
</form>
|
|
<div class="md-search__output">
|
|
<div class="md-search__scrollwrap" data-md-scrollfix>
|
|
<div class="md-search-result" data-md-component="search-result">
|
|
<div class="md-search-result__meta">
|
|
Initializing search
|
|
</div>
|
|
<ol class="md-search-result__list" role="presentation"></ol>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</nav>
|
|
|
|
</header>
|
|
|
|
<div class="md-container" data-md-component="container">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<main class="md-main" data-md-component="main">
|
|
<div class="md-main__inner md-grid">
|
|
|
|
|
|
|
|
<div class="md-sidebar md-sidebar--primary" data-md-component="sidebar" data-md-type="navigation" >
|
|
<div class="md-sidebar__scrollwrap">
|
|
<div class="md-sidebar__inner">
|
|
|
|
|
|
|
|
|
|
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
|
|
<label class="md-nav__title" for="__drawer">
|
|
<a href="../.." title="Jujutsu docs" class="md-nav__button md-logo" aria-label="Jujutsu docs" data-md-component="logo">
|
|
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54Z"/></svg>
|
|
|
|
</a>
|
|
Jujutsu docs
|
|
</label>
|
|
|
|
<ul class="md-nav__list" data-md-scrollfix>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../.." class="md-nav__link">
|
|
|
|
|
|
<span class="md-ellipsis">
|
|
Home
|
|
</span>
|
|
|
|
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item md-nav__item--nested">
|
|
|
|
|
|
|
|
|
|
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_2" >
|
|
|
|
|
|
<label class="md-nav__link" for="__nav_2" id="__nav_2_label" tabindex="0">
|
|
|
|
|
|
<span class="md-ellipsis">
|
|
Getting started
|
|
</span>
|
|
|
|
|
|
<span class="md-nav__icon md-icon"></span>
|
|
</label>
|
|
|
|
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_2_label" aria-expanded="false">
|
|
<label class="md-nav__title" for="__nav_2">
|
|
<span class="md-nav__icon md-icon"></span>
|
|
Getting started
|
|
</label>
|
|
<ul class="md-nav__list" data-md-scrollfix>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../../install-and-setup/" class="md-nav__link">
|
|
|
|
|
|
<span class="md-ellipsis">
|
|
Installation and Setup
|
|
</span>
|
|
|
|
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../../tutorial/" class="md-nav__link">
|
|
|
|
|
|
<span class="md-ellipsis">
|
|
Tutorial and Birds-Eye View
|
|
</span>
|
|
|
|
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../../github/" class="md-nav__link">
|
|
|
|
|
|
<span class="md-ellipsis">
|
|
Working with GitHub
|
|
</span>
|
|
|
|
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
</ul>
|
|
</nav>
|
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../../FAQ/" class="md-nav__link">
|
|
|
|
|
|
<span class="md-ellipsis">
|
|
FAQ
|
|
</span>
|
|
|
|
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item md-nav__item--nested">
|
|
|
|
|
|
|
|
|
|
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_4" >
|
|
|
|
|
|
<label class="md-nav__link" for="__nav_4" id="__nav_4_label" tabindex="0">
|
|
|
|
|
|
<span class="md-ellipsis">
|
|
Concepts
|
|
</span>
|
|
|
|
|
|
<span class="md-nav__icon md-icon"></span>
|
|
</label>
|
|
|
|
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_4_label" aria-expanded="false">
|
|
<label class="md-nav__title" for="__nav_4">
|
|
<span class="md-nav__icon md-icon"></span>
|
|
Concepts
|
|
</label>
|
|
<ul class="md-nav__list" data-md-scrollfix>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../../working-copy/" class="md-nav__link">
|
|
|
|
|
|
<span class="md-ellipsis">
|
|
Working Copy
|
|
</span>
|
|
|
|
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../../branches/" class="md-nav__link">
|
|
|
|
|
|
<span class="md-ellipsis">
|
|
Branches
|
|
</span>
|
|
|
|
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../../conflicts/" class="md-nav__link">
|
|
|
|
|
|
<span class="md-ellipsis">
|
|
Conflicts
|
|
</span>
|
|
|
|
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../../operation-log/" class="md-nav__link">
|
|
|
|
|
|
<span class="md-ellipsis">
|
|
Operation Log
|
|
</span>
|
|
|
|
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../../glossary/" class="md-nav__link">
|
|
|
|
|
|
<span class="md-ellipsis">
|
|
Glossary
|
|
</span>
|
|
|
|
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
</ul>
|
|
</nav>
|
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item md-nav__item--nested">
|
|
|
|
|
|
|
|
|
|
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5" >
|
|
|
|
|
|
<label class="md-nav__link" for="__nav_5" id="__nav_5_label" tabindex="0">
|
|
|
|
|
|
<span class="md-ellipsis">
|
|
Configuration
|
|
</span>
|
|
|
|
|
|
<span class="md-nav__icon md-icon"></span>
|
|
</label>
|
|
|
|
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_5_label" aria-expanded="false">
|
|
<label class="md-nav__title" for="__nav_5">
|
|
<span class="md-nav__icon md-icon"></span>
|
|
Configuration
|
|
</label>
|
|
<ul class="md-nav__list" data-md-scrollfix>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../../config/" class="md-nav__link">
|
|
|
|
|
|
<span class="md-ellipsis">
|
|
Settings
|
|
</span>
|
|
|
|
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../../revsets/" class="md-nav__link">
|
|
|
|
|
|
<span class="md-ellipsis">
|
|
Revset language
|
|
</span>
|
|
|
|
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../../templates/" class="md-nav__link">
|
|
|
|
|
|
<span class="md-ellipsis">
|
|
Templating language
|
|
</span>
|
|
|
|
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
</ul>
|
|
</nav>
|
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item md-nav__item--nested">
|
|
|
|
|
|
|
|
|
|
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_6" >
|
|
|
|
|
|
<label class="md-nav__link" for="__nav_6" id="__nav_6_label" tabindex="0">
|
|
|
|
|
|
<span class="md-ellipsis">
|
|
Comparisons
|
|
</span>
|
|
|
|
|
|
<span class="md-nav__icon md-icon"></span>
|
|
</label>
|
|
|
|
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_6_label" aria-expanded="false">
|
|
<label class="md-nav__title" for="__nav_6">
|
|
<span class="md-nav__icon md-icon"></span>
|
|
Comparisons
|
|
</label>
|
|
<ul class="md-nav__list" data-md-scrollfix>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../../git-comparison/" class="md-nav__link">
|
|
|
|
|
|
<span class="md-ellipsis">
|
|
Git comparison
|
|
</span>
|
|
|
|
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../../git-compatibility/" class="md-nav__link">
|
|
|
|
|
|
<span class="md-ellipsis">
|
|
Git compatibility
|
|
</span>
|
|
|
|
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../../sapling-comparison/" class="md-nav__link">
|
|
|
|
|
|
<span class="md-ellipsis">
|
|
Sapling
|
|
</span>
|
|
|
|
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../../related-work/" class="md-nav__link">
|
|
|
|
|
|
<span class="md-ellipsis">
|
|
Other related work
|
|
</span>
|
|
|
|
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
</ul>
|
|
</nav>
|
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item md-nav__item--nested">
|
|
|
|
|
|
|
|
|
|
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_7" >
|
|
|
|
|
|
<label class="md-nav__link" for="__nav_7" id="__nav_7_label" tabindex="0">
|
|
|
|
|
|
<span class="md-ellipsis">
|
|
Technical details
|
|
</span>
|
|
|
|
|
|
<span class="md-nav__icon md-icon"></span>
|
|
</label>
|
|
|
|
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_7_label" aria-expanded="false">
|
|
<label class="md-nav__title" for="__nav_7">
|
|
<span class="md-nav__icon md-icon"></span>
|
|
Technical details
|
|
</label>
|
|
<ul class="md-nav__list" data-md-scrollfix>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../../technical/architecture/" class="md-nav__link">
|
|
|
|
|
|
<span class="md-ellipsis">
|
|
Architecture
|
|
</span>
|
|
|
|
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../../technical/concurrency/" class="md-nav__link">
|
|
|
|
|
|
<span class="md-ellipsis">
|
|
Concurrency
|
|
</span>
|
|
|
|
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../../technical/conflicts/" class="md-nav__link">
|
|
|
|
|
|
<span class="md-ellipsis">
|
|
Conflicts
|
|
</span>
|
|
|
|
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
</ul>
|
|
</nav>
|
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item md-nav__item--nested">
|
|
|
|
|
|
|
|
|
|
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_8" >
|
|
|
|
|
|
<label class="md-nav__link" for="__nav_8" id="__nav_8_label" tabindex="0">
|
|
|
|
|
|
<span class="md-ellipsis">
|
|
Contributing
|
|
</span>
|
|
|
|
|
|
<span class="md-nav__icon md-icon"></span>
|
|
</label>
|
|
|
|
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_8_label" aria-expanded="false">
|
|
<label class="md-nav__title" for="__nav_8">
|
|
<span class="md-nav__icon md-icon"></span>
|
|
Contributing
|
|
</label>
|
|
<ul class="md-nav__list" data-md-scrollfix>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../../contributing/" class="md-nav__link">
|
|
|
|
|
|
<span class="md-ellipsis">
|
|
Guidelines and "How to...?"
|
|
</span>
|
|
|
|
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../../code-of-conduct/" class="md-nav__link">
|
|
|
|
|
|
<span class="md-ellipsis">
|
|
Code of conduct
|
|
</span>
|
|
|
|
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
</ul>
|
|
</nav>
|
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item md-nav__item--active md-nav__item--nested">
|
|
|
|
|
|
|
|
|
|
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_9" checked>
|
|
|
|
|
|
<label class="md-nav__link" for="__nav_9" id="__nav_9_label" tabindex="0">
|
|
|
|
|
|
<span class="md-ellipsis">
|
|
Design docs
|
|
</span>
|
|
|
|
|
|
<span class="md-nav__icon md-icon"></span>
|
|
</label>
|
|
|
|
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_9_label" aria-expanded="true">
|
|
<label class="md-nav__title" for="__nav_9">
|
|
<span class="md-nav__icon md-icon"></span>
|
|
Design docs
|
|
</label>
|
|
<ul class="md-nav__list" data-md-scrollfix>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../git-submodules/" class="md-nav__link">
|
|
|
|
|
|
<span class="md-ellipsis">
|
|
git-submodules
|
|
</span>
|
|
|
|
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../git-submodule-storage/" class="md-nav__link">
|
|
|
|
|
|
<span class="md-ellipsis">
|
|
git-submodule-storage
|
|
</span>
|
|
|
|
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<a href="../run/" class="md-nav__link">
|
|
|
|
|
|
<span class="md-ellipsis">
|
|
JJ run
|
|
</span>
|
|
|
|
|
|
</a>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="md-nav__item md-nav__item--active">
|
|
|
|
<input class="md-nav__toggle md-toggle" type="checkbox" id="__toc">
|
|
|
|
|
|
|
|
|
|
|
|
<label class="md-nav__link md-nav__link--active" for="__toc">
|
|
|
|
|
|
<span class="md-ellipsis">
|
|
Tracking branches
|
|
</span>
|
|
|
|
|
|
<span class="md-nav__icon md-icon"></span>
|
|
</label>
|
|
|
|
<a href="./" class="md-nav__link md-nav__link--active">
|
|
|
|
|
|
<span class="md-ellipsis">
|
|
Tracking branches
|
|
</span>
|
|
|
|
|
|
</a>
|
|
|
|
|
|
|
|
<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<label class="md-nav__title" for="__toc">
|
|
<span class="md-nav__icon md-icon"></span>
|
|
Table of contents
|
|
</label>
|
|
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#objective" class="md-nav__link">
|
|
Objective
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#current-data-model-as-of-jj-080" class="md-nav__link">
|
|
Current data model (as of jj 0.8.0)
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#proposed-data-model" class="md-nav__link">
|
|
Proposed data model
|
|
</a>
|
|
|
|
<nav class="md-nav" aria-label="Proposed data model">
|
|
<ul class="md-nav__list">
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#importexport-data-flow" class="md-nav__link">
|
|
Import/export data flow
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#tracking-state" class="md-nav__link">
|
|
Tracking state
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#mapping-to-the-current-data-model" class="md-nav__link">
|
|
Mapping to the current data model
|
|
</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
</nav>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#common-command-behaviors" class="md-nav__link">
|
|
Common command behaviors
|
|
</a>
|
|
|
|
<nav class="md-nav" aria-label="Common command behaviors">
|
|
<ul class="md-nav__list">
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#fetchimport" class="md-nav__link">
|
|
fetch/import
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#pushexport" class="md-nav__link">
|
|
push/export
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#initclone" class="md-nav__link">
|
|
init/clone
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#branch" class="md-nav__link">
|
|
branch
|
|
</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
</nav>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#command-behavior-examples" class="md-nav__link">
|
|
Command behavior examples
|
|
</a>
|
|
|
|
<nav class="md-nav" aria-label="Command behavior examples">
|
|
<ul class="md-nav__list">
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#fetchimport_1" class="md-nav__link">
|
|
fetch/import
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#push" class="md-nav__link">
|
|
push
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#export" class="md-nav__link">
|
|
export
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#undo-fetch" class="md-nav__link">
|
|
undo fetch
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#git-remote" class="md-nav__link">
|
|
@git remote
|
|
</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
</nav>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#remaining-issues" class="md-nav__link">
|
|
Remaining issues
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#references" class="md-nav__link">
|
|
References
|
|
</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</nav>
|
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
</ul>
|
|
</nav>
|
|
|
|
</li>
|
|
|
|
|
|
|
|
</ul>
|
|
</nav>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<div class="md-sidebar md-sidebar--secondary" data-md-component="sidebar" data-md-type="toc" >
|
|
<div class="md-sidebar__scrollwrap">
|
|
<div class="md-sidebar__inner">
|
|
|
|
|
|
<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<label class="md-nav__title" for="__toc">
|
|
<span class="md-nav__icon md-icon"></span>
|
|
Table of contents
|
|
</label>
|
|
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#objective" class="md-nav__link">
|
|
Objective
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#current-data-model-as-of-jj-080" class="md-nav__link">
|
|
Current data model (as of jj 0.8.0)
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#proposed-data-model" class="md-nav__link">
|
|
Proposed data model
|
|
</a>
|
|
|
|
<nav class="md-nav" aria-label="Proposed data model">
|
|
<ul class="md-nav__list">
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#importexport-data-flow" class="md-nav__link">
|
|
Import/export data flow
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#tracking-state" class="md-nav__link">
|
|
Tracking state
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#mapping-to-the-current-data-model" class="md-nav__link">
|
|
Mapping to the current data model
|
|
</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
</nav>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#common-command-behaviors" class="md-nav__link">
|
|
Common command behaviors
|
|
</a>
|
|
|
|
<nav class="md-nav" aria-label="Common command behaviors">
|
|
<ul class="md-nav__list">
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#fetchimport" class="md-nav__link">
|
|
fetch/import
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#pushexport" class="md-nav__link">
|
|
push/export
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#initclone" class="md-nav__link">
|
|
init/clone
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#branch" class="md-nav__link">
|
|
branch
|
|
</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
</nav>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#command-behavior-examples" class="md-nav__link">
|
|
Command behavior examples
|
|
</a>
|
|
|
|
<nav class="md-nav" aria-label="Command behavior examples">
|
|
<ul class="md-nav__list">
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#fetchimport_1" class="md-nav__link">
|
|
fetch/import
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#push" class="md-nav__link">
|
|
push
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#export" class="md-nav__link">
|
|
export
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#undo-fetch" class="md-nav__link">
|
|
undo fetch
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#git-remote" class="md-nav__link">
|
|
@git remote
|
|
</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
</nav>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#remaining-issues" class="md-nav__link">
|
|
Remaining issues
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="md-nav__item">
|
|
<a href="#references" class="md-nav__link">
|
|
References
|
|
</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</nav>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<div class="md-content" data-md-component="content">
|
|
<article class="md-content__inner md-typeset">
|
|
|
|
|
|
|
|
|
|
<h1 id="remotegit-tracking-branches">Remote/<code>@git</code> tracking branches<a class="headerlink" href="#remotegit-tracking-branches" title="Permanent link">¶</a></h1>
|
|
<p>This is a plan to implement more Git-like remote tracking branch UX.</p>
|
|
<h2 id="objective">Objective<a class="headerlink" href="#objective" title="Permanent link">¶</a></h2>
|
|
<p><code>jj</code> imports all remote branches to local branches by default. As described in
|
|
<a href="https://github.com/martinvonz/jj/issues/1136">#1136</a>, this doesn't interact nicely with Git if we have multiple Git remotes
|
|
with a number of branches. The <code>git.auto-local-branch</code> config can mitigate this
|
|
problem, but we'll get locally-deleted branches instead.</p>
|
|
<p>The goal of this plan is to implement</p>
|
|
<ul>
|
|
<li>proper support for tracking/non-tracking remote branches</li>
|
|
<li>logically consistent data model for importing/exporting Git refs</li>
|
|
</ul>
|
|
<h2 id="current-data-model-as-of-jj-080">Current data model (as of jj 0.8.0)<a class="headerlink" href="#current-data-model-as-of-jj-080" title="Permanent link">¶</a></h2>
|
|
<p>Under the current model, all remote branches are "tracking" branches, and
|
|
remote changes are merged into the local counterparts.</p>
|
|
<div class="highlight"><pre><span></span><code>branches
|
|
[name]:
|
|
local_target?
|
|
remote_targets[remote]: target
|
|
tags
|
|
[name]: target
|
|
git_refs
|
|
["refs/heads/{name}"]: target # last-known local branches
|
|
["refs/remotes/{remote}/{name}"]: target # last-known remote branches
|
|
# (copied to remote_targets)
|
|
["refs/tags/{name}"]: target # last-known tags
|
|
git_head: target?
|
|
</code></pre></div>
|
|
<ul>
|
|
<li>Remote branches are stored in both <code>branches[name].remote_targets</code> and
|
|
<code>git_refs["refs/remotes"]</code>. These two are mostly kept in sync, but there
|
|
are two scenarios where remote-tracking branches and git refs can diverge:<ol>
|
|
<li><code>jj branch forget</code></li>
|
|
<li><code>jj op undo</code>/<code>restore</code> in colocated repo</li>
|
|
</ol>
|
|
</li>
|
|
<li>Pseudo <code>@git</code> tracking branches are stored in <code>git_refs["refs/heads"]</code>. We
|
|
need special case to resolve <code>@git</code> branches, and their behavior is slightly
|
|
different from the other remote-tracking branches.</li>
|
|
</ul>
|
|
<h2 id="proposed-data-model">Proposed data model<a class="headerlink" href="#proposed-data-model" title="Permanent link">¶</a></h2>
|
|
<p>We'll add a per-remote-branch <code>state</code> to distinguish non-tracking branches
|
|
from tracking ones.</p>
|
|
<div class="highlight"><pre><span></span><code>state = new # not merged in the local branch or tag
|
|
| tracking # merged in the local branch or tag
|
|
# `ignored` state could be added if we want to manage it by view, not by
|
|
# config file. target of ignored remote branch would be absent.
|
|
</code></pre></div>
|
|
<p>We'll add a per-remote view-like object to record the last known remote
|
|
branches. It will replace <code>branches[name].remote_targets</code> in the current model.
|
|
<code>@git</code> branches will be stored in <code>remotes["git"]</code>.</p>
|
|
<div class="highlight"><pre><span></span><code>branches
|
|
[name]: target
|
|
tags
|
|
[name]: target
|
|
remotes
|
|
["git"]:
|
|
branches
|
|
[name]: target, state # refs/heads/{name}
|
|
tags
|
|
[name]: target, state = tracking # refs/tags/{name}
|
|
head: target?, state = TBD # refs/HEAD
|
|
[remote]:
|
|
branches
|
|
[name]: target, state # refs/remotes/{remote}/{name}
|
|
tags: (empty)
|
|
head: (empty)
|
|
git_refs # last imported/exported refs
|
|
["refs/heads/{name}"]: target
|
|
["refs/remotes/{remote}/{name}"]: target
|
|
["refs/tags/{name}"]: target
|
|
</code></pre></div>
|
|
<p>With the proposed data model, we can</p>
|
|
<ul>
|
|
<li>naturally support remote branches which have no local counterparts</li>
|
|
<li>deduplicate <code>branches[name].remote_targets</code> and <code>git_refs["refs/remotes"]</code></li>
|
|
</ul>
|
|
<h3 id="importexport-data-flow">Import/export data flow<a class="headerlink" href="#importexport-data-flow" title="Permanent link">¶</a></h3>
|
|
<div class="highlight"><pre><span></span><code> export flow import flow
|
|
----------- -----------
|
|
+----------------+ --.
|
|
+------------------->|backing Git repo|---+ :
|
|
| +----------------+ | : unchanged
|
|
|[update] |[copy] : on "op restore"
|
|
| +----------+ | :
|
|
| +-------------->| git_refs |<------+ :
|
|
| | +----------+ | --'
|
|
+--[compare] [diff]--+
|
|
| .-- +---------------+ | | --.
|
|
| : +--->|remotes["git"] | | | :
|
|
+---: | | |<---+ | :
|
|
: | |remotes[remote]| | : restored
|
|
'-- | +---------------+ |[merge] : on "op restore"
|
|
| | : by default
|
|
[copy]| +---------------+ | :
|
|
+----| (local) |<---------+ :
|
|
| branches/tags | :
|
|
+---------------+ --'
|
|
</code></pre></div>
|
|
<ul>
|
|
<li><code>jj git import</code> applies diff between <code>git_refs</code> and <code>remotes[]</code>. <code>git_refs</code> is
|
|
always copied from the backing Git repo.</li>
|
|
<li><code>jj git export</code> copies jj's <code>remotes</code> view back to the Git repo. If a ref in
|
|
the Git repo has been updated since the last import, the ref isn't exported.</li>
|
|
<li><code>jj op restore</code> never rolls back <code>git_refs</code>.</li>
|
|
</ul>
|
|
<h3 id="tracking-state">Tracking state<a class="headerlink" href="#tracking-state" title="Permanent link">¶</a></h3>
|
|
<p>The <code>git.auto-local-branch</code> config knob is applied when importing new remote
|
|
branch. <code>jj branch</code> sub commands will be added to change the tracking state.</p>
|
|
<div class="highlight"><pre><span></span><code><span class="k">fn</span> <span class="nf">default_state_for_newly_imported_branch</span><span class="p">(</span><span class="n">config</span><span class="p">,</span><span class="w"> </span><span class="n">remote</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
|
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="n">remote</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="s">"git"</span><span class="w"> </span><span class="p">{</span>
|
|
<span class="w"> </span><span class="n">State</span>::<span class="n">Tracking</span>
|
|
<span class="w"> </span><span class="p">}</span><span class="w"> </span><span class="k">else</span><span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="n">config</span><span class="p">[</span><span class="s">"git.auto-local-branch"</span><span class="p">]</span><span class="w"> </span><span class="p">{</span>
|
|
<span class="w"> </span><span class="n">State</span>::<span class="n">Tracking</span>
|
|
<span class="w"> </span><span class="p">}</span><span class="w"> </span><span class="k">else</span><span class="w"> </span><span class="p">{</span>
|
|
<span class="w"> </span><span class="n">State</span>::<span class="n">New</span>
|
|
<span class="w"> </span><span class="p">}</span>
|
|
<span class="p">}</span>
|
|
</code></pre></div>
|
|
<p>A branch target to be merged is calculated based on the <code>state</code>.</p>
|
|
<div class="highlight"><pre><span></span><code><span class="k">fn</span> <span class="nf">target_in_merge_context</span><span class="p">(</span><span class="n">known_target</span><span class="p">,</span><span class="w"> </span><span class="n">state</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
|
|
<span class="w"> </span><span class="k">match</span><span class="w"> </span><span class="n">state</span><span class="w"> </span><span class="p">{</span>
|
|
<span class="w"> </span><span class="n">State</span>::<span class="n">New</span><span class="w"> </span><span class="o">=></span><span class="w"> </span><span class="n">RefTarget</span>::<span class="n">absent</span><span class="p">(),</span>
|
|
<span class="w"> </span><span class="n">State</span>::<span class="n">Tracking</span><span class="w"> </span><span class="o">=></span><span class="w"> </span><span class="n">known_target</span><span class="p">,</span>
|
|
<span class="w"> </span><span class="p">}</span>
|
|
<span class="p">}</span>
|
|
</code></pre></div>
|
|
<h3 id="mapping-to-the-current-data-model">Mapping to the current data model<a class="headerlink" href="#mapping-to-the-current-data-model" title="Permanent link">¶</a></h3>
|
|
<ul>
|
|
<li>New <code>remotes["git"].branches</code> corresponds to <code>git_refs["refs/heads"]</code>, but
|
|
forgotten branches are removed from <code>remotes["git"].branches</code>.</li>
|
|
<li>New <code>remotes["git"].tags</code> corresponds to <code>git_refs["refs/tags"]</code>.</li>
|
|
<li>New <code>remotes["git"].head</code> corresponds to <code>git_head</code>.</li>
|
|
<li>New <code>remotes[remote].branches</code> corresponds to
|
|
<code>branches[].remote_targets[remote]</code>.</li>
|
|
<li><code>state = new|tracking</code> doesn't exist in the current model. It's determined
|
|
by <code>git.auto-local-branch</code> config.</li>
|
|
</ul>
|
|
<h2 id="common-command-behaviors">Common command behaviors<a class="headerlink" href="#common-command-behaviors" title="Permanent link">¶</a></h2>
|
|
<p>In the following sections, a merge is expressed as <code>adds - removes</code>.
|
|
In particular, a merge of local and remote targets is
|
|
<code>[local, remote] - [known_remote]</code>.</p>
|
|
<h3 id="fetchimport">fetch/import<a class="headerlink" href="#fetchimport" title="Permanent link">¶</a></h3>
|
|
<ul>
|
|
<li>
|
|
<p><code>jj git fetch</code></p>
|
|
<ol>
|
|
<li>Fetches remote changes to the backing Git repo.</li>
|
|
<li>Import changes only for <code>remotes[remote].branches[glob]</code> (see below)<ul>
|
|
<li>TODO: how about fetched <code>.tags</code>?</li>
|
|
</ul>
|
|
</li>
|
|
</ol>
|
|
</li>
|
|
<li>
|
|
<p><code>jj git import</code></p>
|
|
<ol>
|
|
<li>Copies <code>git_refs</code> from the backing Git repo.</li>
|
|
<li>Calculates diff from the known <code>remotes</code> to the new <code>git_refs</code>.<ul>
|
|
<li><code>git_refs["refs/heads"] - remotes["git"].branches</code></li>
|
|
<li><code>git_refs["refs/tags"] - remotes["git"].tags</code></li>
|
|
<li>TBD: <code>"HEAD" - remotes["git"].head</code> (unused)</li>
|
|
<li><code>git_refs["refs/remotes/{remote}"] - remotes[remote]</code></li>
|
|
</ul>
|
|
</li>
|
|
<li>Merges diff in local <code>branches</code> and <code>tags</code> if <code>state</code> is <code>tracking</code>.<ul>
|
|
<li>If the known <code>target</code> is <code>absent</code>, the default <code>state</code> should be
|
|
calculated. This also applies to previously-forgotten branches.</li>
|
|
</ul>
|
|
</li>
|
|
<li>Updates <code>remotes</code> reflecting the import.</li>
|
|
<li>Abandons commits that are no longer referenced.</li>
|
|
</ol>
|
|
</li>
|
|
</ul>
|
|
<h3 id="pushexport">push/export<a class="headerlink" href="#pushexport" title="Permanent link">¶</a></h3>
|
|
<ul>
|
|
<li>
|
|
<p><code>jj git push</code></p>
|
|
<ol>
|
|
<li>Calculates diff from the known <code>remotes[remote]</code> to the local changes.<ul>
|
|
<li><code>branches - remotes[remote].branches</code><ul>
|
|
<li>If <code>state</code> is <code>new</code> (i.e. untracked), the known remote branch <code>target</code>
|
|
is considered <code>absent</code>.</li>
|
|
<li>If <code>state</code> is <code>new</code>, and if the local branch <code>target</code> is <code>absent</code>, the
|
|
diff <code>[absent, remote] - absent</code> is noop. So it's not allowed to push
|
|
deleted branch to untracked remote.</li>
|
|
<li>TODO: Copy Git's <code>--force-with-lease</code> behavior?</li>
|
|
</ul>
|
|
</li>
|
|
<li>~<code>tags</code>~ (not implemented, but should be the same as <code>branches</code>)</li>
|
|
</ul>
|
|
</li>
|
|
<li>Pushes diff to the remote Git repo (as well as remote tracking branches
|
|
in the backing Git repo.)</li>
|
|
<li>Updates <code>remotes[remote]</code> and <code>git_refs</code> reflecting the push.</li>
|
|
</ol>
|
|
</li>
|
|
<li>
|
|
<p><code>jj git export</code></p>
|
|
<ol>
|
|
<li>Copies local <code>branches</code>/<code>tags</code> back to <code>remotes["git"]</code>.<ul>
|
|
<li>Conceptually, <code>remotes["git"].branches[name].state</code> can be set to
|
|
untracked. Untracked local branches won't be exported to Git.</li>
|
|
<li>If <code>remotes["git"].branches[name]</code> is <code>absent</code>, the default
|
|
<code>state = tracking</code> applies. This also applies to forgotten branches.</li>
|
|
<li>~<code>tags</code>~ (not implemented, but should be the same as <code>branches</code>)</li>
|
|
</ul>
|
|
</li>
|
|
<li>Calculates diff from the known <code>git_refs</code> to the new <code>remotes[remote]</code>.</li>
|
|
<li>Applies diff to the backing Git repo.</li>
|
|
<li>Updates <code>git_refs</code> reflecting the export.</li>
|
|
</ol>
|
|
<p>If a ref failed to export at the step 3, the preceding steps should also be
|
|
rolled back for that ref.</p>
|
|
</li>
|
|
</ul>
|
|
<h3 id="initclone">init/clone<a class="headerlink" href="#initclone" title="Permanent link">¶</a></h3>
|
|
<ul>
|
|
<li>
|
|
<p><code>jj init</code></p>
|
|
<ul>
|
|
<li>Import, track, and merge per <code>git.auto_local_branch</code> config.</li>
|
|
<li>If <code>!git.auto_local_branch</code>, no <code>tracking</code> state will be set.</li>
|
|
</ul>
|
|
</li>
|
|
<li>
|
|
<p><code>jj git clone</code></p>
|
|
<ul>
|
|
<li>Import, track, and merge per <code>git.auto_local_branch</code> config.</li>
|
|
<li>The default branch will be tracked regardless of <code>git.auto_local_branch</code>
|
|
config. This isn't technically needed, but will help users coming from Git.</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<h3 id="branch">branch<a class="headerlink" href="#branch" title="Permanent link">¶</a></h3>
|
|
<ul>
|
|
<li><code>jj branch set {name}</code><ol>
|
|
<li>Sets local <code>branches[name]</code> entry.</li>
|
|
</ol>
|
|
</li>
|
|
<li><code>jj branch delete {name}</code><ol>
|
|
<li>Removes local <code>branches[name]</code> entry.</li>
|
|
</ol>
|
|
</li>
|
|
<li><code>jj branch forget {name}</code><ol>
|
|
<li>Removes local <code>branches[name]</code> entry if exists.</li>
|
|
<li>Removes <code>remotes[remote].branches[name]</code> entries if exist.
|
|
TODO: maybe better to not remove non-tracking remote branches?</li>
|
|
</ol>
|
|
</li>
|
|
<li><code>jj branch track {name}@{remote}</code> (new command)<ol>
|
|
<li>Merges <code>[local, remote] - [absent]</code> in local branch.<ul>
|
|
<li>Same as "fetching/importing existing branch from untracked remote".</li>
|
|
</ul>
|
|
</li>
|
|
<li>Sets <code>remotes[remote].branches[name].state = tracking</code>.</li>
|
|
</ol>
|
|
</li>
|
|
<li><code>jj branch untrack {name}@{remote}</code> (new command)<ol>
|
|
<li>Sets <code>remotes[remote].branches[name].state = new</code>.</li>
|
|
</ol>
|
|
</li>
|
|
<li><code>jj branch list</code><ul>
|
|
<li>TODO: hide non-tracking branches by default? ...</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<p>Note: desired behavior of <code>jj branch forget</code> is to</p>
|
|
<ul>
|
|
<li>discard both local and remote branches (without actually removing branches
|
|
at remotes)</li>
|
|
<li>not abandon commits which belongs to those branches (even if the branch is
|
|
removed at a remote)</li>
|
|
</ul>
|
|
<h2 id="command-behavior-examples">Command behavior examples<a class="headerlink" href="#command-behavior-examples" title="Permanent link">¶</a></h2>
|
|
<h3 id="fetchimport_1">fetch/import<a class="headerlink" href="#fetchimport_1" title="Permanent link">¶</a></h3>
|
|
<ul>
|
|
<li>Fetching/importing new branch<ol>
|
|
<li>Decides new <code>state = new|tracking</code> based on <code>git.auto_local_branch</code></li>
|
|
<li>If new <code>state</code> is <code>tracking</code>, merges <code>[absent, new_remote] - [absent]</code>
|
|
(i.e. creates local branch with <code>new_remote</code> target)</li>
|
|
<li>Sets <code>remotes[remote].branches[name].state</code></li>
|
|
</ol>
|
|
</li>
|
|
<li>Fetching/importing existing branch from tracking remote<ol>
|
|
<li>Merges <code>[local, new_remote] - [known_remote]</code></li>
|
|
</ol>
|
|
</li>
|
|
<li>Fetching/importing existing branch from untracked remote<ol>
|
|
<li>Decides new <code>state = new|tracking</code> based on <code>git.auto_local_branch</code></li>
|
|
<li>If new <code>state</code> is <code>tracking</code>, merges <code>[local, new_remote] - [absent]</code></li>
|
|
<li>Sets <code>remotes[remote].branches[name].state</code></li>
|
|
</ol>
|
|
</li>
|
|
<li>Fetching/importing remotely-deleted branch from tracking remote<ol>
|
|
<li>Merges <code>[local, absent] - [known_remote]</code></li>
|
|
<li>Removes <code>remotes[remote].branches[name]</code> (<code>target</code> becomes <code>absent</code>)
|
|
(i.e. the remote branch is no longer tracked)</li>
|
|
<li>Abandons commits in the deleted branch</li>
|
|
</ol>
|
|
</li>
|
|
<li>Fetching/importing remotely-deleted branch from untracked remote<ol>
|
|
<li>Decides new <code>state = new|tracking</code> based on <code>git.auto_local_branch</code></li>
|
|
<li>Noop anyway since <code>[local, absent] - [absent]</code> -> <code>local</code></li>
|
|
</ol>
|
|
</li>
|
|
<li>Fetching previously-forgotten branch from remote<ol>
|
|
<li>Decides new <code>state = new|tracking</code> based on <code>git.auto_local_branch</code></li>
|
|
<li>If new <code>state</code> is <code>tracking</code>, merges
|
|
<code>[absent, new_remote] - [absent]</code> -> <code>new_remote</code></li>
|
|
<li>Sets <code>remotes[remote].branches[name].state</code></li>
|
|
</ol>
|
|
</li>
|
|
<li>Fetching forgotten and remotely-deleted branch<ul>
|
|
<li>Same as "remotely-deleted branch from untracked remote" since forgotten
|
|
remote branch should be <code>state = new</code></li>
|
|
<li>Therefore, no local commits should be abandoned</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<h3 id="push">push<a class="headerlink" href="#push" title="Permanent link">¶</a></h3>
|
|
<ul>
|
|
<li>Pushing new branch, remote doesn't exist<ol>
|
|
<li>Pushes <code>[local, absent] - [absent]</code> -> <code>local</code></li>
|
|
<li>Sets <code>remotes[remote].branches[name].target = local</code>, <code>.state = tracking</code></li>
|
|
</ol>
|
|
</li>
|
|
<li>Pushing new branch, untracked remote exists<ol>
|
|
<li>Pushes <code>[local, remote] - [absent]</code><ul>
|
|
<li>Fails if <code>local</code> moved backwards or sideways</li>
|
|
</ul>
|
|
</li>
|
|
<li>Sets <code>remotes[remote].branches[name].target = local</code>, <code>.state = tracking</code></li>
|
|
</ol>
|
|
</li>
|
|
<li>Pushing existing branch to tracking remote<ol>
|
|
<li>Pushes <code>[local, remote] - [remote]</code> -> <code>local</code><ul>
|
|
<li>Fails if <code>local</code> moved backwards or sideways, and if <code>remote</code> is out of
|
|
sync</li>
|
|
</ul>
|
|
</li>
|
|
<li>Sets <code>remotes[remote].branches[name].target = local</code></li>
|
|
</ol>
|
|
</li>
|
|
<li>Pushing existing branch to untracked remote<ul>
|
|
<li>Same as "new branch"</li>
|
|
</ul>
|
|
</li>
|
|
<li>Pushing deleted branch to tracking remote<ol>
|
|
<li>Pushes <code>[absent, remote] - [remote]</code> -> <code>absent</code><ul>
|
|
<li>TODO: Fails if <code>remote</code> is out of sync?</li>
|
|
</ul>
|
|
</li>
|
|
<li>Removes <code>remotes[remote].branches[name]</code> (<code>target</code> becomes <code>absent</code>)</li>
|
|
</ol>
|
|
</li>
|
|
<li>Pushing deleted branch to untracked remote<ul>
|
|
<li>Noop since <code>[absent, remote] - [absent]</code> -> <code>remote</code></li>
|
|
<li>Perhaps, UI will report error</li>
|
|
</ul>
|
|
</li>
|
|
<li>Pushing forgotten branch to untracked remote<ul>
|
|
<li>Same as "deleted branch to untracked remote"</li>
|
|
</ul>
|
|
</li>
|
|
<li>Pushing previously-forgotten branch to remote<ul>
|
|
<li>Same as "new branch, untracked remote exists"</li>
|
|
<li>The <code>target</code> of forgotten remote branch is <code>absent</code></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<h3 id="export">export<a class="headerlink" href="#export" title="Permanent link">¶</a></h3>
|
|
<ul>
|
|
<li>Exporting new local branch, git branch doesn't exist<ol>
|
|
<li>Sets <code>remotes["git"].branches[name].target = local</code>, <code>.state = tracking</code></li>
|
|
<li>Exports <code>[local, absent] - [absent]</code> -> <code>local</code></li>
|
|
</ol>
|
|
</li>
|
|
<li>Exporting new local branch, git branch is out of sync<ol>
|
|
<li>Exports <code>[local, git] - [absent]</code> -> fail</li>
|
|
</ol>
|
|
</li>
|
|
<li>Exporting existing local branch, git branch is synced<ol>
|
|
<li>Sets <code>remotes["git"].branches[name].target = local</code></li>
|
|
<li>Exports <code>[local, git] - [git]</code> -> <code>local</code></li>
|
|
</ol>
|
|
</li>
|
|
<li>Exporting deleted local branch, git branch is synced<ol>
|
|
<li>Removes <code>remotes["git"].branches[name]</code></li>
|
|
<li>Exports <code>[absent, git] - [git]</code> -> <code>absent</code></li>
|
|
</ol>
|
|
</li>
|
|
<li>Exporting forgotten branches, git branches are synced<ol>
|
|
<li>Exports <code>[absent, git] - [git]</code> -> <code>absent</code> for forgotten local/remote
|
|
branches</li>
|
|
</ol>
|
|
</li>
|
|
</ul>
|
|
<h3 id="undo-fetch">undo fetch<a class="headerlink" href="#undo-fetch" title="Permanent link">¶</a></h3>
|
|
<ul>
|
|
<li>Exporting undone fetch, git branches are synced<ol>
|
|
<li>Exports <code>[old, git] - [git]</code> -> <code>old</code> for undone local/remote branches</li>
|
|
</ol>
|
|
</li>
|
|
<li>Redoing undone fetch without exporting<ul>
|
|
<li>Same as plain fetch since the known <code>git_refs</code> isn't diffed against the
|
|
refs in the backing Git repo.</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<h3 id="git-remote"><code>@git</code> remote<a class="headerlink" href="#git-remote" title="Permanent link">¶</a></h3>
|
|
<ul>
|
|
<li><code>jj branch untrack {name}@git</code><ul>
|
|
<li>Maybe rejected (to avoid confusion)?</li>
|
|
<li>Allowing this would mean different local branches of the same name coexist
|
|
in jj and git.</li>
|
|
</ul>
|
|
</li>
|
|
<li><code>jj git fetch --remote git</code><ul>
|
|
<li>Rejected. The implementation is different.</li>
|
|
<li>Conceptually, it's <code>git::import_refs()</code> only for local branches.</li>
|
|
</ul>
|
|
</li>
|
|
<li><code>jj git push --remote git</code><ul>
|
|
<li>Rejected. The implementation is different.</li>
|
|
<li>Conceptually, it's <code>jj branch track</code> and <code>git::export_refs()</code> only for
|
|
local branches.</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<h2 id="remaining-issues">Remaining issues<a class="headerlink" href="#remaining-issues" title="Permanent link">¶</a></h2>
|
|
<ul>
|
|
<li>https://github.com/martinvonz/jj/issues/1278 pushing to tracked remote<ul>
|
|
<li>Option could be added to push to all <code>tracking</code> remotes?</li>
|
|
</ul>
|
|
</li>
|
|
<li>Track remote branch locally with different name<ul>
|
|
<li>Local branch name could be stored per remote branch</li>
|
|
<li>Consider UI complexity</li>
|
|
</ul>
|
|
</li>
|
|
<li>"private" state (suggested by @ilyagr)<ul>
|
|
<li>"private" branches can be pushed to their own remote, but not to the
|
|
upstream repo</li>
|
|
<li>This might be a state attached to a local branch (similar to Mercurial's
|
|
"secret" phase)</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<h2 id="references">References<a class="headerlink" href="#references" title="Permanent link">¶</a></h2>
|
|
<ul>
|
|
<li>https://github.com/martinvonz/jj/issues/1136</li>
|
|
<li>https://github.com/martinvonz/jj/issues/1666</li>
|
|
<li>https://github.com/martinvonz/jj/issues/1690</li>
|
|
<li>https://github.com/martinvonz/jj/issues/1734</li>
|
|
<li>https://github.com/martinvonz/jj/pull/1739</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</article>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
</main>
|
|
|
|
<footer class="md-footer">
|
|
|
|
<div class="md-footer-meta md-typeset">
|
|
<div class="md-footer-meta__inner md-grid">
|
|
<div class="md-copyright">
|
|
|
|
|
|
Made with
|
|
<a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
|
|
Material for MkDocs
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
</footer>
|
|
|
|
</div>
|
|
<div class="md-dialog" data-md-component="dialog">
|
|
<div class="md-dialog__inner md-typeset"></div>
|
|
</div>
|
|
|
|
|
|
<script id="__config" type="application/json">{"base": "../..", "features": [], "search": "../../assets/javascripts/workers/search.f886a092.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}, "version": {"provider": "mike"}}</script>
|
|
|
|
|
|
<script src="../../assets/javascripts/bundle.aecac24b.min.js"></script>
|
|
|
|
|
|
</body>
|
|
</html> |