adds nice git interface
This commit is contained in:
@@ -1,98 +1,76 @@
|
||||
# Git commit form
|
||||
|
||||
The commit form sits at the foot of the [Git](git.md) column, edge to edge. It holds the commit message field, the Commit button and the Push button.
|
||||
The commit form is the block at the top of the [Git](git.md) view, under its top bar. It holds the commit message, the author, and the Commit split button.
|
||||
|
||||
[Guide index](index.md) · Related: [Git](git.md), [Notifications](notifications.md), [Keyboard shortcuts](keyboard-shortcuts.md)
|
||||
|
||||
## At a glance
|
||||
|
||||
```text
|
||||
+-------------------------------------+
|
||||
| (1) Shift+Enter to commit |
|
||||
| |
|
||||
| |
|
||||
|-------------------------------------|
|
||||
| (2) Commit ^ | (3)^ |
|
||||
+-------------------------------------+
|
||||
+----------------------------------------------------------------------------+
|
||||
| (1) fix the login form_ |
|
||||
|----------------------------------------------------------------------------|
|
||||
| (2) Jonathan <jonathan@example.com> (3) Cmd+Enter commits |
|
||||
| (4) [ Commit 2 files | v ] |
|
||||
+----------------------------------------------------------------------------+
|
||||
(5)
|
||||
+------------------------+
|
||||
| v Commit |
|
||||
| ^ Commit and push |
|
||||
+------------------------+
|
||||
```
|
||||
|
||||
1. **Message field**: one line of commit message. The grey hint `Shift+Enter to commit` shows while it is empty.
|
||||
2. **Commit button**: amber when there is something staged.
|
||||
3. **Push button**: a narrow button with an up arrow. It lights up when the branch has commits to push.
|
||||
1. **Message field**: the commit message. The grey placeholder `Commit message` shows while it is empty.
|
||||
2. **Author**: `user.name <user.email>` from your git config, read when the view opens. With no email set, only the name shows; with no name, nothing.
|
||||
3. **Hint**: `⌘↵ commits`.
|
||||
4. **Commit button**: `Commit N files`, or `Nothing staged`. The caret on its right opens the menu.
|
||||
5. **Commit menu**: **Commit** and **Commit and push**.
|
||||
|
||||
## Features
|
||||
|
||||
### Write the message
|
||||
|
||||
- Click the field, or press `Cmd+C` anywhere outside a terminal with no text selected. `Cmd+C` also shows the [Git](git.md) column when it is hidden.
|
||||
- The focused field gets an amber outline.
|
||||
- Opening the [Git](git.md) view puts the cursor in the field. `Cmd+C` with no text selected, outside a terminal, opens the view there too.
|
||||
- The field gets an amber line under it while it has the cursor.
|
||||
- The field grows with long text and scrolls after about seven lines.
|
||||
- A commit message in Helder is always **one lowercase line**:
|
||||
- Capitals become lowercase as you type or paste.
|
||||
- A line break becomes a space. Pressing `Enter` on its own does not start a new line.
|
||||
- A line break becomes a space. `Enter` does not start a new line, and it does not commit.
|
||||
- This keeps dictated or pasted text as one short subject line.
|
||||
- The draft stays in the field while you work elsewhere in the window.
|
||||
- The draft stays in the field while the view is closed.
|
||||
|
||||
### Commit
|
||||
|
||||
You can commit in three ways:
|
||||
|
||||
- Click **Commit**.
|
||||
- Press `Shift+Enter` (or `Cmd+Enter`, or `Ctrl+Enter`) in the message field.
|
||||
- Press `Cmd+Enter` anywhere in the window.
|
||||
- Click **Commit N files**.
|
||||
- Choose **Commit** from the caret menu.
|
||||
- Press `Cmd+Enter` while the view is open. This works from the message field too, but not from the console input.
|
||||
|
||||
A commit only happens when both are true:
|
||||
The button is amber when at least one file is staged and the message is not empty. Otherwise it is grey. A click always runs `git commit`, also when the button is grey, so git's own refusal shows in the [console](git.md#console).
|
||||
|
||||
- At least one file is staged.
|
||||
- The message is not empty (spaces alone do not count).
|
||||
|
||||
The **Commit** button follows the first rule only. It is amber when something is staged and grey and disabled when nothing is. With files staged but an empty message, the button looks ready but a click does nothing. Type a message first.
|
||||
### Commit and push
|
||||
- Choose **Commit and push** from the caret menu. It commits, and when the commit succeeds it pushes, the same as the **Push** button. See [Pull and push](git.md#pull-and-push).
|
||||
|
||||
### After a commit
|
||||
|
||||
- The message field clears.
|
||||
- The committed files leave **Staged Changes**. Unstaged edits stay in **Changes**.
|
||||
- The committed files leave the **staged** section. Unstaged edits stay where they were.
|
||||
- A [notification](notifications.md) says `Committed N files`, with the start of your message below it (cut off after 34 characters).
|
||||
- The Push button lights up, because the branch is now ahead of its remote.
|
||||
- **Push** in the top bar shows `↑N`, because the branch is now ahead of its remote.
|
||||
|
||||
### When a commit fails
|
||||
|
||||
- Your message comes back in the field, so you can fix and retry.
|
||||
- A notification says `Commit failed`, with git's own error text below it. A typical cause is a git hook that rejected the commit.
|
||||
|
||||
### Push
|
||||
|
||||
- Click the **Push** button right of Commit, or press `Cmd+P`.
|
||||
- The button is **lit** (amber arrow on an amber tint) when there is something to push:
|
||||
- The branch is ahead of its remote branch, or
|
||||
- The branch has no remote branch yet.
|
||||
- It is grey when there is nothing to push. A click still runs the push; git then reports it is up to date.
|
||||
- Hover the button for a tooltip: `Push 2 commits to remote (⌘P)`, `Push the branch to remote (⌘P)`, or `Nothing to push (⌘P)`.
|
||||
|
||||
What happens when you push:
|
||||
|
||||
- A notification says `Pushing…`. The button dims and ignores clicks until the push ends.
|
||||
- A branch with no remote branch is pushed to `origin` and set to track it, so the next push needs nothing extra.
|
||||
- Helder never asks for a password. Git must already have access to the remote, for example through an SSH key or a credential helper.
|
||||
- A push that takes longer than two minutes stops.
|
||||
- When it ends, a notification says `Pushed` with git's summary line, or `Push failed` with git's last error line.
|
||||
- The Git column re-reads git, so the Push button goes back to grey.
|
||||
|
||||
Pull, fetch and branch switching are not part of Helder. Use the [Command line](command-line.md) for those.
|
||||
- Your message stays in the field, so you can fix and retry.
|
||||
- A notification says `Commit failed`, with git's first error line below it. The full output is in the console. Typical causes are nothing staged, an empty message, or a git hook that rejected the commit.
|
||||
- When the message was empty, the cursor goes back to the field.
|
||||
|
||||
## Keyboard
|
||||
|
||||
| Keys | Action |
|
||||
|---|---|
|
||||
| `Cmd+C` | Focus the message field (no text selected, not in a terminal) |
|
||||
| `Shift+Enter` | Commit, while in the message field |
|
||||
| `Cmd+Enter` | Commit, from anywhere in the window |
|
||||
| `Ctrl+Enter` | Commit, while in the message field |
|
||||
| `Cmd+C` | Open the Git view on the message field (no text selected, not in a terminal) |
|
||||
| `Cmd+Enter` | Commit, while the Git view is open (not from the console input) |
|
||||
| `Cmd+P` | Push the current branch |
|
||||
|
||||
## Related
|
||||
|
||||
- [Git](git.md): the column that holds this form, and where you stage files.
|
||||
- [Git](git.md): the view that holds this form, and where you stage files.
|
||||
- [Notifications](notifications.md): the messages after a commit or push.
|
||||
- [Status bar](status-bar.md): shows the branch you commit and push to.
|
||||
- [Command line](command-line.md): for git commands Helder has no button for.
|
||||
- [Keyboard shortcuts](keyboard-shortcuts.md): every shortcut in one list.
|
||||
|
||||
Reference in New Issue
Block a user