Skip to content

Commit

Permalink
Support multiline messages/posts
Browse files Browse the repository at this point in the history
Closes #2 for now
  • Loading branch information
JKrag committed Feb 12, 2021
1 parent fd59332 commit 7fedf32
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ I can install.
* Cross-platform (*3)
* Vendor independent (*4)

1) Even chat in multiple workspaces at once. Just open multiple terminal windows nd chat in different cloned chat repos.
1) Even chat in multiple workspaces at once. Just open multiple terminal windows and chat in different cloned chat repos.
2) I could have made it end-2-end encrypted, but have chosen not to, for now, as I find it valuable to have the chat history readable in the remote Git server web-ui.
3) *GitSlick* only requires a terminal, bash and a reasonably new Git (> 2.27 I would guess), which should never be a problem anywhere I work.
4) Any Git Server accessible by all clients will do.
Expand Down
6 changes: 6 additions & 0 deletions chat.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ commands() {
echo -e "${GREEN}/create <channel name>${RC} (to create a new #channel)"
echo -e "${GREEN}/list${RC} (to list channels)"
echo -e "${GREEN}/repeat [n]${RC} (repeat last n messages - default 5)"
echo -e "${GREEN}/post${RC} (write a post aka. multiline message via your regular git message editor)"
}

welcome() {
Expand All @@ -25,6 +26,7 @@ welcome() {
echo "with NO safety checks or error handling".
echo
echo "NOTE: Currently only really supports single line messages. Behaviour undefined if pasting multiline content."
echo "But you can now use the ${GREEN}/post${RC} feature if you want to send multiline content."
echo
echo -e "You are currenty in folder ${RED}$(pwd)${RC}"
echo -e "And pushing to ${RED}$(git remote get-url origin --push)${RC}"
Expand Down Expand Up @@ -67,6 +69,10 @@ while true ; do
: "${options:=5}"
echo -e "Repeating last $options messages in ${RED}$(git branch --show-current)${RC}"
git chatlog "-$options"
elif [ "$cm" = "/post" ]; then
git commit --quiet --allow-empty
git chatlog -1
git push --quiet origin
else
message="$cm $options"
git commit --quiet --allow-empty --message "$message"
Expand Down

0 comments on commit 7fedf32

Please sign in to comment.