Debian Codegraph @

docs/glossary.md

raw
1 # Glossary
2
3 ## Anonymous branch
4
5 An anonymous branch is a chain of commits that doesn't necessarily have any
6 [bookmarks](#bookmark) pointing to it or to any of its descendants. Unlike Git,
7 Jujutsu keeps commits on anonymous branches around until they are explicitly
8 abandoned. Visible anonymous branches are tracked by the [view](#view), which
9 stores a list of [heads](#head) of such branches.
10
11 ## Author date
12
13 The author date of a [commit](#commit) records when the commit's changes were
14 originally authored. It is set when the commit is first authored and usually
15 stays the same when the commit is [rewritten](#rewrite). For a newly-created
16 commit, the author date and [committer date](#committer-date) are usually the
17 same, but they can differ after history-editing commands such as `jj rebase`,
18 `jj describe`, or `jj squash`. When using the Git [backend](#backend), this is
19 stored as Git's native author date field.
20
21 ## Backend
22
23 A backend is an implementation of the storage layer. There is currently only one
24 production-ready builtin commit backend: the Git backend. The Git backend stores
25 commits in a Git repository. There are several backends used for testing. Google
26 also has its own cloud-based backend.
27
28 There are also pluggable backends for storing other information than commits,
29 such as the "operation store backend" for storing
30 [the operation log](#operation-log).
31
32 ## Bookmark
33
34 A bookmark is a named pointer to a [commit](#commit). They are similar to Git's
35 [branches](#branch) and even more similar to [Mercurial's
36 bookmarks](https://wiki.mercurial-scm.org/Bookmarks). See [here](bookmarks.md)
37 for details.
38
39 Unlike in Git, there is no concept of a "current bookmark"; bookmarks *do not*
40 move when you create a new commit. Bookmarks *do* automatically follow the
41 commit if it gets [rewritten](#rewrite).
42
43 ## Branch
44
45 In the context of `jj`, the word "branch" usually refers to an [anonymous
46 branch](#anonymous-branch) or, less formally, a branch of the commit "tree"
47 (which is itself an informal way to refer to the commit graph, parts of which
48 might resemble a tree even when it's not mathematically a tree).
49
50 We also sometimes discuss Git's branches and branches on Git remotes. Locally,
51 these correspond to [bookmarks](#bookmark). In a colocated workspace, each
52 local Git branch corresponds to a `jj` bookmark.
53
54 ## Change
55
56 A change is a commit as it [evolves over time](#rewrite). Changes themselves
57 don't exist as an object in the data model; only the change ID does. The change
58 ID is a property of a commit.
59
60 ## Change ID
61
62 A change ID is a unique identifier for a [change](#change). They are typically
63 16 bytes long and are often randomly generated. By default, `jj log` presents
64 them as a sequence of 12 letters in the k-z range, at the beginning of a line.
65 These are actually hexadecimal numbers that use "digits" z-k instead of 0-9a-f.
66
67 ## Change offset
68
69 Sometimes a change ID might not unambiguously identify a commit, such as if the
70 commit is hidden or if the change ID is [divergent](#divergent-change). In these
71 cases, you can add an offset after the change ID to make it clear which commit
72 you are referring to, with the most recent commit having an offset of 0. For
73 instance, the most recent commit with change ID `xyz` could be referred to as
74 `xyz/0`, while the one before it would be `xyz/1`, and so on.
75
76 ## Commit
77
78 A snapshot of the files in the repository at a given point in time (technically
79 a [tree object](#tree)), together with some metadata. The metadata includes the
80 author, the committer, the [author date](#author-date), the
81 [committer date](#committer-date), and pointers to the commit's parents. Through
82 the pointers to the parents, the commits form a
83 [Directed Acyclic Graph (DAG)](https://en.wikipedia.org/wiki/Directed_acyclic_graph)
84 .
85
86 Note that even though commits are stored as snapshots, they are often treated
87 as differences between snapshots, namely compared to their parent's snapshot. If
88 they have more than one parent, then the difference is computed against the
89 result of merging the parents. For example, `jj diff` will show the differences
90 introduced by a commit compared to its parent(s), and `jj rebase` will apply
91 those changes onto another base commit.
92
93 The word "revision" is used as a synonym for "commit".
94
95 ## Commit ID
96
97 A commit ID is a unique identifier for a [commit](#commit). They are 20 bytes
98 long when using the Git backend. They are presented in regular hexadecimal
99 format at the end of the line in `jj log`, using 12 hexadecimal digits by
100 default. When using the Git backend, the commit ID is the Git commit ID.
101
102 ## Committer date
103
104 The committer date of a [commit](#commit) records when that particular commit
105 object was created. It is set for a new commit and updated whenever `jj`
106 [rewrites](#rewrite) the commit, such as when rebasing, describing, or squashing
107 it. For a newly-created commit, the committer date and
108 [author date](#author-date) are usually the same, but they can differ after the
109 commit has been rewritten. When using the Git [backend](#backend), this is
110 stored as Git's native committer date field.
111
112 ## <a name="colocated-repos"></a>Colocated workspaces
113
114 When using the Git [backend](#backend) and the backing Git repository's `.git/`
115 directory is a sibling of `.jj/`, we call the workspace colocated. Most
116 tools designed for Git can be easily used on such workspaces. `jj` and `git`
117 commands can be used interchangeably.
118
119 See [here](git-compatibility.md#colocated-jujutsugit-repos) for details.
120
121 ## Conflict
122
123 Conflicts can occur in many places. The most common type is conflicts in files.
124 Those are the conflicts that users coming from other VCSs are usually familiar
125 with. You can see them in `jj status` and in `jj log` (the red "conflict"
126 label at the end of the line). See [here](conflicts.md) for details.
127
128 Conflicts can also occur in [bookmarks](#bookmark). For example, if you moved a
129 bookmark locally, and it was also moved on the remote, then the bookmark will be
130 in a conflicted state after you pull from the remote.
131 See [here](bookmarks.md#conflicts) for details.
132
133 Similar to a bookmark conflict, when a [change](#change) is rewritten locally
134 and remotely, for example, then the change will be in a conflicted state. We
135 call that a [divergent change](#divergent-change).
136
137 ## Divergent change
138
139 A divergent change is a [change](#change) that has more than one
140 [visible commit](#visible-commits). These changes are displayed with a label of
141 "divergent" in the log.
142
143 ## Head
144
145 A head is a commit with no descendants. The context in which it has no
146 descendants varies. For example, the `heads(X)`
147 [revset function](revsets.md#functions) returns commits that have no descendants
148 within the set `X` itself. The [view](#view) records which
149 anonymous heads (heads without a bookmark pointing to them) are visible at a
150 given [operation](#operation). Note that this is quite different from Git's
151 [HEAD](https://git-scm.com/book/en/v2/Git-Internals-Git-References#ref_the_ref).
152
153 ## Hidden commits, abandoned commits
154
155 See [visible commits](#visible-commits).
156
157 ## Operation
158
159 A snapshot of the [visible commits](#visible-commits) and [bookmarks](#bookmark)
160 at a given point in time (technically a [view object](#view)), together with
161 some metadata. The metadata includes the username, hostname, timestamps, and
162 pointers to the operation's parents.
163
164 ## Operation log
165
166 The operation log is the
167 [DAG](https://en.wikipedia.org/wiki/Directed_acyclic_graph) formed by
168 [operation](#operation) objects, much in the same way that commits form a DAG,
169 which is sometimes called the "commit history". When operations happen in
170 sequence, they form a single line in the graph. Operations that happen
171 concurrently from jj's perspective result in forks and merges in the DAG.
172
173 ## Repository
174
175 Basically everything under `.jj/`, i.e. the full set of [operations](#operation)
176 and [commits](#commit).
177
178 ## Remote
179
180 A remote is a reference to a copy of your repository. The most common case is
181 that the remote is hosted on the internet or another network, but local remotes
182 are also possible. Remotes are useful when working on a project with multiple
183 collaborators. As Jujutsu is compatible with Git you can use all popular
184 providers that are also available for Git. For example
185 [GitHub](https://github.com), [GitLab](https://gitlab.com) or
186 [Codeberg](https://codeberg.org/).
187
188 ## Revision
189
190 A synonym for [Commit](#commit).
191
192 ## Revset
193
194 Jujutsu supports a functional language for selecting a set of revisions.
195 Expressions in this language are called "revsets". See [here](revsets.md) for
196 details. We also often use the term "revset" for the set of revisions selected
197 by a revset.
198
199 ## Rewrite
200
201 To "rewrite" a commit means to create a new version of that commit with
202 different contents, metadata (including parent pointers), or both. Rewriting a
203 commit results in a new commit, and thus a new [commit ID](#commit-id), but the
204 [change ID](#change-id) generally remains the same. Some examples of rewriting a
205 commit would be changing its description or rebasing it. Modifying the working
206 copy rewrites the working copy commit.
207
208 ## Root commit
209
210 The root commit is a virtual commit at the root of every repository. It has a
211 commit ID consisting of all '0's (`00000000...`) and a change ID consisting of
212 all 'z's (`zzzzzzzz...`). It can be referred to in [revsets](#revset) by the
213 function `root()`. Note that our definition of "root commit" is different from
214 Git's; Git's "root commits" are the first commit(s) in the repository, i.e. the
215 commits `jj log -r 'root()+'` will show.
216
217 ## Tree
218
219 A tree object represents a snapshot of a directory in the repository. Tree
220 objects are defined recursively; each tree object only has the files and
221 directories contained directly in the directory it represents.
222
223 ## Tracked bookmarks and tracking bookmarks
224
225 A remote bookmark can be made "tracked" with the `jj bookmark track` command. This
226 results in a "tracking" local bookmark that tracks the remote bookmark.
227
228 See [the bookmarks documentation](bookmarks.md#terminology-summary) for a more
229 detailed definition of these terms.
230
231 ## Visible commits
232
233 Visible commits are the commits you see in `jj log -r 'all()'`. They are the
234 commits that are reachable from an anonymous head in the [view](#view).
235 Ancestors of a visible commit are implicitly visible.
236
237 Intuitively, a visible commit is the "latest version" of a given
238 [change](#change). A commit that is abandoned or [rewritten](#rewrite) stops
239 being visible and is labeled as "hidden". Such a commit is still accessible by
240 its [commit ID](#commit-id) or the combination of its [change ID](#change-id)
241 and a [change offset](#change-offset).
242
243 ## View
244
245 A view is a snapshot of bookmarks and their targets, anonymous heads,
246 and working-copy commits. The anonymous heads define which commits
247 are [visible](#visible-commits).
248
249 A view object is similar to a [tree](#tree) object in that it represents a
250 snapshot without history, and an [operation](#operation) object is similar to a
251 [commit](#commit) object in that it adds metadata and history.
252
253 ## Workspace
254
255 A workspace is a [working copy](#working-copy) and an
256 associated [repository](#repository). There can be multiple workspaces for a
257 single repository. Each workspace has a `.jj/` directory, but the
258 [commits](#commit) and [operations](#operation) will be stored in the initial
259 workspace; the other workspaces will have pointers to the initial workspace. See
260 [here](working-copy.md#workspaces) for details.
261
262 This is what Git calls a "worktree".
263
264 ## Working copy
265
266 The working copy contains the files you're currently working on. It is
267 automatically snapshot at the beginning of almost every `jj` command, thus
268 creating a new [working-copy commit](#working-copy-commit) if any changes had
269 been made in the working copy. Conversely, the working copy is automatically
270 updated to the state of the working-copy commit at the end of almost every `jj`
271 command. See [here](working-copy.md) for details.
272
273 This is what Git calls a "working tree".
274
275 ## Working-copy commit
276
277 A commit that corresponds to the current state of the working copy. There is
278 one working-copy commit per [workspace](#workspace). The current working-copy
279 commits are tracked in the [operation log](#operation-log).