Skip to content

Commit 0119e1a

Browse files
committed
feat(): finish 3.0.0 release
1 parent 98d0d46 commit 0119e1a

File tree

7 files changed

+57
-40
lines changed

7 files changed

+57
-40
lines changed

.githudrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@
120120
# The following config controls the background fetcher daemon behavior called githudd
121121
# -------------------------------------------------------------------------------------------
122122
# run_fetcher_daemon=True
123-
# githudd_sleep_seconds=5 # how long does the daemon sleep between cycles
123+
# githudd_sleep_seconds=30 # how long does the daemon sleep between cycles
124124
# githudd_pid_file_path=/usr/local/var/run/githudd.pid
125125
# githudd_socket_file_path=/usr/local/var/run/githudd.socket
126126
#

CHANGELOG.md

+48-26
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,97 @@
1-
From v2.0.2
2-
-----------
1+
3.0.0
2+
-----
3+
* Feat: Add a daemon called `githudd` that will continuously fetch the last git folder where
4+
`githud` was executed. In a typical install where `githud` is used in the prompt, that means the
5+
last git folder browsed.
6+
* Config: some new configuration has been added for the `githudd` daemon. The default values have
7+
been tested on Mac. You can find this new section in the `.githudrc` file in this repo. The new
8+
parameters are also pasted below along with their default values.
9+
```
10+
# -------------------------------------------------------------------------------------------
11+
# The following config controls the background fetcher daemon behavior called githudd
12+
# -------------------------------------------------------------------------------------------
13+
# run_fetcher_daemon=True
14+
# githudd_sleep_seconds=30 # how long does the daemon sleep between cycles
15+
# githudd_pid_file_path=/usr/local/var/run/githudd.pid
16+
# githudd_socket_file_path=/usr/local/var/run/githudd.socket
17+
#
18+
# # Githudd logs can be verbose. They are here for debugging only. It is not advised that you
19+
# # activate them
20+
# githudd_log_file_path=/dev/null
21+
```
22+
23+
2.1.0
24+
-----
325
* Feat: Add support for TMUX with `githud tmux`. You can now use tmux inside the status bar or the
426
pane title of TMUX for example
527
* Feat: Add support for no output formatting with `githud none`.
628

7-
From v2.0.1
8-
-----------
29+
2.0.2
30+
-----
931
* Fix: Properly reset "normal" styling after displaying "Bold" characters (#13)
1032

11-
From v1.3.7
12-
-----------
33+
2.0.1
34+
-----
1335
* BREAKING: the executable is renamed from `gitHUD` to `githud`, as suggested in
1436
[#14](https://github.com/gbataille/gitHUD/issues/14) by [@voidus](https://github.com/voidus)
1537

16-
From v1.3.6
17-
-----------
38+
1.3.7
39+
-----
1840
* When in detached, but on a commit that has a tag, display the tag name rather than the commit SHA
1941

20-
From v1.3.5
21-
-----------
42+
1.3.6
43+
-----
2244
* BASH shell: properly escape invisible control characters so that the prompt length is computed
2345
properly
2446

25-
From v1.3.4
26-
-----------
47+
1.3.5
48+
-----
2749
* in 1.3.1 I introduced `merge_branch_ignore_branches` to be able to deal with
2850
"false" branches like the famous gh-pages. It happens that if this branch
2951
was properly created as an orphan branch (`git branch --orphan gh-pages`),
3052
then I can detect that it does not merge back into master and not show this
3153
part of the prompt automatically without people having to manually maintain
3254
exception. Thanks to [Markus](https://github.com/mgee) for pointing that out
3355

34-
From v1.3.3
35-
-----------
56+
1.3.4
57+
-----
3658
* Minor breaking change: Removed the trailing space. If you need it, just put
3759
it in your prompt definition
3860
* Do not override background color. Just act on foreground text color
3961

40-
From v1.3.2
41-
-----------
62+
1.3.3
63+
-----
4264
* Merge branch count indicator will not include merge-commit anymore. This is
4365
actually redundant in all case. In fact, in a develop/master typical flow,
4466
when develop merges into master and develop and master are actually equal, if
4567
you count the merge-commit, you'll have the impression that there is a delta
4668
between the 2 branches
4769

48-
From v1.3.1
49-
-----------
70+
1.3.2
71+
-----
5072
* Introduce `merge_branch_ignore_branches` config list that allows to not
5173
display the merge-branch part of the prompt for certain branch names
5274

53-
From v1.3.0
54-
-----------
75+
1.3.1
76+
-----
5577
* Allow for a special "NoColor" configuration color to reset to the terminal
5678
foreground color
5779
* NoColor is the default if the config file cannot be read
5880
* Protect the prompt from possible color set before gitHUD is invoked
5981
* Branch name has no color by default
6082
* The default commit pull-push symbol is changed to a (hopefully) clearer '⥯'
6183

62-
From v1.2.0
63-
-----------
84+
1.3.0
85+
-----
6486
* Remove dependency on a patched font in the default config
6587
* Allow for partial prompt through configuration
6688

67-
From v1.1.0
68-
-----------
89+
1.2.0
90+
-----
6991
* Configurable "no remote tracking branch" color
7092
* Fix brew formula in gbataille/homebrew-gba which failed on some configs
7193

72-
From v1.0.0
73-
-----------
94+
1.1.0
95+
-----
7496
* Configurable prompt parts (text and colors)
7597
* Tech: refactoring to a writer and wide test coverage

githud.cabal

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cabal-version: 2.2
22
name: githud
3-
version: 2.1.0
3+
version: 3.0.0
44
synopsis: More efficient replacement to the great git-radar
55
description: Please see README.md (used to be gitHUD)
66
homepage: http://github.com/gbataille/gitHUD#readme

src/GitHUD/Config/Parse.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ intParser = read <$> many1 digit
290290
intConfigToInt :: String -> Int
291291
intConfigToInt str =
292292
either
293-
(const 5)
293+
(const 30)
294294
id
295295
(parse intParser "" str)
296296

src/GitHUD/Config/Types.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ defaultConfig = Config {
163163
, confStashSuffixIntensity = Vivid
164164

165165
, confRunFetcherDaemon = True
166-
, confGithuddSleepSeconds = 5
166+
, confGithuddSleepSeconds = 30
167167
, confGithuddPidFilePath = "/usr/local/var/run/githudd.pid"
168168
, confGithuddSocketFilePath = "/usr/local/var/run/githudd.socket"
169169

src/GitHUD/Daemon/Runner.hs

+3-2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import System.Posix.Daemon (isRunning, runDetached, Redirection(DevNull, ToFile)
1414
import System.Posix.Files (fileExist)
1515

1616
import GitHUD.Config.Types
17+
import GitHUD.Git.Command
1718
import GitHUD.Daemon.Network
1819

1920
runDaemon :: Config
@@ -65,7 +66,7 @@ socketClient socketPath mvar =
6566
fromSocket socketPath withMessage
6667
where
6768
withMessage msg = do
68-
putStrLn $ "callback with " ++ msg
69+
putStrLn $ "Switching to poll " ++ msg
6970
swapMVar mvar msg
7071

7172
fetcher :: Int
@@ -74,6 +75,6 @@ fetcher :: Int
7475
-> IO ()
7576
fetcher delaySec socketPath mvar = do
7677
path <- readMVar mvar
77-
putStrLn $ "fetching " ++ path
78+
gitCmdFetch path
7879
threadDelay $ delaySec * 1_000_000
7980
return ()

src/GitHUD/Git/Command.hs

+2-8
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import Control.Concurrent.MVar (MVar, putMVar)
1717
import GHC.IO.Handle (hGetLine)
1818
import System.Directory (doesDirectoryExist)
1919
import System.Exit (ExitCode(ExitSuccess))
20-
import System.IO (hClose, hPutStrLn, openFile, IOMode(WriteMode))
2120
import System.Process (readCreateProcess, readProcessWithExitCode, proc, StdStream(CreatePipe, UseHandle), createProcess, CreateProcess(..))
2221

2322
import GitHUD.Process (readProcessWithIgnoreExitCode)
@@ -103,17 +102,12 @@ gitCmdCommitTag out = do
103102
gitCmdFetch :: String
104103
-> IO ()
105104
gitCmdFetch path = do
106-
-- TODO: gbataille - code org
107105
isDir <- doesDirectoryExist path
108-
stdout <- openFile "/tmp/out" WriteMode
109-
stderr <- openFile "/tmp/err" WriteMode
110106
if isDir
111107
then do
112-
let fetch_proc = (proc "git" ["fetch"]) { cwd = Just path, std_out = UseHandle stdout, std_err = UseHandle stderr }
108+
let fetch_proc = (proc "git" ["fetch"]) { cwd = Just path }
113109
readCreateProcess fetch_proc ""
114110
return ()
115111
else do
116-
hPutStrLn stderr ("Folder" ++ path ++ " does not exist")
112+
putStrLn ("Folder" ++ path ++ " does not exist")
117113
return ()
118-
hClose stdout
119-
hClose stderr

0 commit comments

Comments
 (0)