Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 36 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ cherry-pick and an undo all stop here instead of being thrown away.
is typed into it
- [x] The window keeps up by itself with what an editor, a terminal or an
agent does to the repository in front, with no button to press
- [x] It says when there is a newer version, and brings the file for this
system down, checked -- and leaves installing it to you
- [ ] Three-way editor with line-by-line picking
- [ ] A screen for the submodules themselves, bisect, LFS, signing

Expand All @@ -147,6 +149,7 @@ crates/
merge.rs joining two branches or rebasing one, and stopping where it clashes
conflict.rs getting out of a merge or rebase that clashed
tag.rs lightweight and annotated tags
update.rs whether there is a newer version, and its file, checked
remote.rs fetching, pushing, and the distance to the remote branch
stash.rs the pile of changes set aside
graph.rs the lane algorithm, and the uncommitted-changes row
Expand Down Expand Up @@ -181,6 +184,7 @@ crates/
terminal.rs a shell per tab: the pseudo-terminal, the keys, the colours
terminal_view.rs the grid painted, the mouse heard, and the bar above it
watch.rs looking at the repository in front, off the painting thread
updates.rs the word for a newer version, and the menu under it
chooser.rs asking the desktop for its own folder dialog
graph_view.rs painting the graph and the references column
board_view.rs the branches laid out in columns
Expand Down Expand Up @@ -433,6 +437,35 @@ looked at when they are brought forward. Not a checkout on another
machine, where every look is a round trip on a connection the window is
using: its reload button is where it was. Run on Linux.

**A newer version:** a program installed once that never says another
word is one still on its first beta a year later. So it looks -- a little
after the window opens and once a day -- and when there is something newer
a word appears at the end of the tab strip. Nothing else: no dialog, and
nothing brought down until the word is pressed. Then it offers the file
for this system, the `.deb` to whoever took the `.deb` and the folder to
whoever did not, puts it where downloads go, and checks it against the
`SHA256SUMS` published beside it. There it stops. Each system installs a
different way, one wants a password, another will not let a running program
be written over, and none of the files is signed: a program that replaced
itself with something it could not vouch for would be worse than one that
leaves the last step to you. Looking costs no dependency -- a version is a
tag, and listing a repository's tags is the one thing this program could
always do; there is no API in it, no account and nothing sent that a clone
does not send. A tag is not a release, though: the files take a while to
be built from it, and a tag pushed by mistake never gets any. So a newer
tag is only mentioned once the sums published with its files can be read,
and one without them is passed over for the one before. Bringing the file down is `curl`, which Linux nearly always
has and macOS and Windows ship, instead of a library for HTTPS and the
forty crates behind it for one request a month; with no `curl` it says so
and the release's page is a click away. The SHA-256 is written out, sixty
lines held to the published answers. A beta is offered to whoever asks for
betas and to whoever is running one. It can be turned off, and a version
can be told not to be mentioned again. Tried on Linux against the releases
there are, by a build told it was older than it is: the look, the file,
the check, and the two refusals. The buttons that hand the file to the
desktop use a different program on each system, and only Linux's has been
run.

**The emulator:** the second dependency that was not part of the plan,
and the one there was never going to be a way round. What a shell writes
is forty years of escape sequences -- the second screen `vim` draws on,
Expand Down Expand Up @@ -513,7 +546,9 @@ gets wrong is wanted as an issue. Take one:
| macOS, Apple or Intel | the `.zip`: drag `Gitrust.app` to Applications |
| Windows | the `.zip`: there is no installer, the `.exe` runs from wherever you put it |

Whichever you took, `gitrust --version` says which one it is.
Whichever you took, `gitrust --version` says which one it is, and from then
on the window says when there is a newer one and will bring its file down
for you. It will not install it: that is the same step as the first time.

**None of it is signed.** There is no paid certificate behind these files,
so macOS will say the developer cannot be verified -- right-click, Open,
Expand Down
15 changes: 14 additions & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ token is written down nowhere else.

## What the window does by itself

Three things happen without being asked for, and each can be turned off on
Four things happen without being asked for, and each can be turned off on
the preferences screen.

**It fetches**, every minute by default, from every remote of the repository
Expand All @@ -103,6 +103,19 @@ submodule is left and named.
**It tries the merge** into the target branch in memory. That reads the
repository and writes nothing: no file, no index, no reference.

**It asks whether there is a newer version**, a little after the window
opens and once a day. That is a connection to github.com, to this project's
own repository, asking for the list of its tags: what a clone of a public
repository sends, with no credentials and nothing about you or your
repositories. When a tag is newer, the `SHA256SUMS` published with it is
asked for too, with `curl`, to know the release is really there. Nothing
else is brought down by it. A file is fetched only when
you press the button that says so, with `curl`, over HTTPS and nothing
else, and is checked against the `SHA256SUMS` the release publishes before
it is given its name. That check says the file arrived as it was built. It
does not say who built it: the sums come from the same place as the file,
and nothing here is signed. gitrust never installs what it brought down.

The tabs that were open are written into `~/.config/gitrust/settings` as
paths, and remote checkouts as `ssh://user@host:port/path`. No password is
among them, and a remote tab that comes back does not connect until asked.
Expand Down
1 change: 1 addition & 0 deletions crates/gitrust-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ pub mod start;
pub mod status;
pub mod submodule;
pub mod tag;
pub mod update;
pub mod worktree;
pub mod writer;

Expand Down
32 changes: 31 additions & 1 deletion crates/gitrust-core/src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,17 @@ pub struct General {
/// The program the terminal runs. Empty is the shell this account logs
/// in with.
pub terminal_shell: String,
/// Whether the window asks, now and then, if there is a newer version.
///
/// On unless somebody says otherwise, like the fetch nobody asked for
/// and for the opposite reason: that one is off because it reaches a
/// remote with somebody's key, and this one reaches a public
/// repository with nothing. A program that never mentions the next
/// version is one still on its first a year later.
pub updates: bool,
/// Whether a beta counts as newer. Whoever is running a beta is told
/// about the next one whatever this says.
pub update_betas: bool,
}

impl Default for General {
Expand All @@ -248,6 +259,8 @@ impl Default for General {
terminal_caret: Caret::default(),
terminal_dim: true,
terminal_shell: String::new(),
updates: true,
update_betas: false,
}
}
}
Expand Down Expand Up @@ -312,6 +325,8 @@ impl General {
// The rest of the line and not a word of it, as for a tab: a
// program can live in a folder with a space in its name.
"terminal-shell" => self.terminal_shell = value.to_string(),
"check-updates" => self.updates = on,
"update-betas" => self.update_betas = on,
_ => return false,
}
true
Expand Down Expand Up @@ -352,6 +367,11 @@ impl General {
if !self.terminal_shell.trim().is_empty() {
text.push_str(&format!("terminal-shell {}\n", self.terminal_shell.trim()));
}
text.push_str(&format!(
"check-updates {}\nupdate-betas {}\n",
word(self.updates),
word(self.update_betas),
));
text
}
}
Expand Down Expand Up @@ -384,6 +404,9 @@ pub struct Settings {
pub terminal: Panel,
/// How tall it is when all of it is showing, in points.
pub terminal_height: u32,
/// The version somebody said not to mention again, as its tag. The
/// one after it is mentioned: this is "not this one", not "never".
pub skipped: String,
}

impl Default for Settings {
Expand All @@ -397,6 +420,7 @@ impl Default for Settings {
front: 0,
terminal: Panel::default(),
terminal_height: 280,
skipped: String::new(),
}
}
}
Expand Down Expand Up @@ -456,6 +480,7 @@ impl Settings {
points.clamp(SHORTEST_TERMINAL, TALLEST_TERMINAL);
}
}
Some(("skip-update", value)) => settings.skipped = value.trim().to_string(),
Some((name, value)) => {
settings.general.take(name, value);
}
Expand Down Expand Up @@ -496,6 +521,9 @@ impl Settings {
self.terminal.as_str(),
self.terminal_height
));
if !self.skipped.is_empty() {
text.push_str(&format!("skip-update {}\n", self.skipped));
}
text
}

Expand Down Expand Up @@ -607,8 +635,10 @@ mod tests {
terminal_caret: Caret::Underline,
terminal_dim: false,
terminal_shell: "/opt/my shells/fish".to_string(),
updates: false,
update_betas: true,
};
let settings = Settings { general, ..Settings::default() };
let settings = Settings { general, skipped: "v0.2.0".to_string(), ..Settings::default() };
assert_eq!(Settings::parse(&settings.render()), settings);
// And the defaults, which is the case with no branch name to write.
assert_eq!(Settings::parse(&Settings::default().render()), Settings::default());
Expand Down
Loading
Loading