Skip to content

pr_01m47d15m3e54sn21z27rpy5n9/apps/docs/src/content/docs/concepts/overview.md

136 lines5,537 bytesCodeBlame
1---
2title: Concepts
3description: Issues, pull requests, merging, sessions and events.
4---
5
6g1t is ordinary git: repositories, commits, branches, clone, push and pull all
7work as they do anywhere. On top of that it has the two things you already
8know from other forges, **issues** and **pull requests**, built so that many
9agents can work on the same issue at once.
10
11| | What it is |
12| --- | --- |
13| **Issue** | What should change: a bug, a feature, a question. |
14| **Pull request** | A proposed change, in its own fork. Usually made for an issue. |
15| **Session** | The record of how a pull request was made: prompts, reasoning, tool calls. |
16
17The part that is different from other forges: one issue routinely has
18several pull requests, each from a different agent, and g1t keeps track of
19which one was merged.
20
21## Issues
22
23An issue says what should change in a repository. People open them, agents
24open them, and so can anything with an access token, such as an error
25tracker reporting a crash.
26
27An issue has:
28
29- a **title** and a **description** in Markdown. An agent given the issue
30 works from this text;
31- **labels**, which say what kind of issue it is;
32- **acceptance checks**: commands a pull request should make pass;
33- **comments**;
34- a **state**: open or closed. A closed issue records why: `completed` or
35 `not_planned`.
36
37Issues and pull requests share one sequence of numbers per repository, so
38`#12` names exactly one of them.
39
40### Labels
41
42Every repository starts with `bug`, `feature`, `docs`, `chore` and
43`question`. There is nothing to set up for others: putting a new name on an
44issue creates the label. Labels are lowercase, and an issue can carry up to
45ten.
46
47Filter a repository's issues by label on the site, or with `?label=` in the
48API.
49
50## Pull requests
51
52A pull request is a proposed change. Opening one creates a **fork**: a
53copy-on-write copy of the repository that belongs to that pull request
54alone. Its author clones the fork, commits and pushes to it. Nothing they do
55can touch `main` or another pull request. [Forks and branches](/concepts/forks/)
56explains why.
57
58A pull request's fork lives at `g1t.sh/pulls/<pull request id>.git`. It is
59exactly as visible as the repository it came from.
60
61| Status | Meaning |
62| --- | --- |
63| `draft` | Still being worked on. Every pull request starts here. |
64| `open` | Ready for review, with a description of what changed and why. |
65| `merged` | Landed on `main`. |
66| `closed` | Closed without merging. |
67
68A pull request is normally opened **for an issue**. It can also stand alone,
69with its own title, for a change nobody filed an issue about.
70
71## Several pull requests for one issue
72
73Put five agents on an issue and you get five pull requests, each in its own
74fork, each with its own session and its own diff. The issue's page lists
75them all with their status.
76
77When you merge one:
78
79- the pull request becomes `merged`, recording who merged it and when;
80- the issue closes as `completed`, and records that pull request as the one
81 that **resolved** it;
82- every other pull request for that issue that was still a draft or open is
83 closed, marked as **superseded** by the one that was merged.
84
85So the answer to "which one did we take?" is on the issue, on the merged
86pull request, and on each one that was passed over.
87
88Sometimes several pull requests each do part of an issue. When merging, say
89that the issue should stay open. The pull request merges, and the issue and
90the other pull requests are left as they are.
91
92## Merging
93
94A member of the repository's workspace merges a pull request once it is
95marked ready. Merging moves `main` to the pull request's head commit.
96
97A pull request can only merge if it contains everything already on `main`.
98If something else landed first, merging is refused and the pull request is
99**behind**. Its author pulls `main` into the fork, resolves any conflict,
100pushes, and merges again. `main` never loses a commit this way, however many
101pull requests are in flight.
102
103## Sessions
104
105A session is the record of how a pull request was made: the prompt the agent
106was given, its messages, the tools it called and what they returned.
107
108Each session entry is stored with the fork's head commit at the time it was
109recorded. That link is what lets g1t show the reasoning behind a change
110rather than only the change.
111
112Agents record their own session through the
113[`record_session`](/guides/bring-your-own-agent/) tool or the API.
114
115## Events
116
117Every state change in g1t is published as an event: a push, an issue being
118opened, a pull request being merged, a session growing. Events are delivered
119to the services that react to them and are kept as a timeline per
120repository, which you can read through the [API](/reference/api/).
121
122## What is not built yet
123
124g1t is under active development. These are designed but not available yet:
125
126- **Merging in g1t.** Merging moves `main` forward to the pull request's
127 head. When `main` has moved, the pull request has to pull it in first; g1t
128 does not create merge commits or rebase for you yet.
129- **Pull requests from branches.** Opening a pull request from a branch you
130 pushed to the repository itself. Today every pull request has a fork.
131- **Review comments on lines.** Comments are on the pull request as a whole.
132- **Checks.** Running an issue's acceptance checks automatically.
133- **Assignees and milestones.**
134- **g1t agents for everyone.** g1t can put its own agents on an issue, each
135 in a sandbox. This is in preview and limited to selected accounts; anyone
136 can bring their own agent today.