summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2022-01-22 19:03:31 +0100
committerJohn Ankarström <john@ankarstrom.se>2022-01-22 19:03:31 +0100
commite4283f8ef2a7f438397f9cdaff396a1cd051ac97 (patch)
tree7afc31efb6b60cfa050c86698d45b4db3009f1d2
parent05df71193f2c637885ac80c82a1ea06b9122a13c (diff)
downloadsave-e4283f8ef2a7f438397f9cdaff396a1cd051ac97.tar.gz
M save.pl
M save.pl~
-rw-r--r--save.pl5
-rw-r--r--save.pl~12
2 files changed, 13 insertions, 4 deletions
diff --git a/save.pl b/save.pl
index 257a73a..df03446 100644
--- a/save.pl
+++ b/save.pl
@@ -18,6 +18,8 @@ unlink(D) :->
:- pce_global(@commit_browser, new(browser)).
:- pce_global(@save_button,
new(button(save, message(@prolog, save), 'RET'))).
+:- pce_global(@refresh_button,
+ new(button(refresh, message(@prolog, refresh)))).
main :-
pce_main_loop(main).
@@ -48,8 +50,7 @@ added(0) :-
bold)),
send(@dialog, append, @editor),
send(@dialog, append, @save_button),
- send(@dialog, append, button(refresh,
- and(message(@prolog, refresh)))),
+ send(@dialog, append, @refresh_button),
send(@dialog, open).
refresh :-
diff --git a/save.pl~ b/save.pl~
index c4f2e08..849cdc9 100644
--- a/save.pl~
+++ b/save.pl~
@@ -18,6 +18,8 @@ unlink(D) :->
:- pce_global(@commit_browser, new(browser)).
:- pce_global(@save_button,
new(button(save, message(@prolog, save), 'RET'))).
+:- pce_global(@refresh_button,
+ button(refresh, message(@prolog, refresh))).
main :-
pce_main_loop(main).
@@ -48,8 +50,7 @@ added(0) :-
bold)),
send(@dialog, append, @editor),
send(@dialog, append, @save_button),
- send(@dialog, append, button(refresh,
- and(message(@prolog, refresh)))),
+ send(@dialog, append, @refresh_button),
send(@dialog, open).
refresh :-
@@ -67,6 +68,13 @@ status(C) :-
read_to_chain(Out, C),
close(Out)).
+log(C) :-
+ setup_call_cleanup(
+ process_create(path(git), ['log', '--format=format:%ai'],
+ [stdout(pipe(Out))]),
+ read_to_chain(Out, C),
+ close(Out)).
+
read_to_chain(S, C) :-
read_line_to_codes(S, Cs),
( Cs == end_of_file