Commit Graph

37 Commits

Author SHA1 Message Date
jjangga0214
446a94a766
docs: rm unnecessary img tag from readme (#859) 2022-03-08 14:27:48 -08:00
Johannes Altmanninger
0a32584476 Fix error when inside a bare git repository
For example, "git diff" would print
"fatal: this operation must be run in a work tree"

We could still run git_branch_name in bare repositories in future.
2020-12-01 01:47:35 -08:00
Johannes Altmanninger
b1b10c333d
Check whether we are inside the worktree (#651)
Some git commands require to be run from inside the worktree (as opposed
    to the git dir, although it's usually in .git). This commit adds
a function git_is_worktree to check this. It is used for the commands
that need the worktree instead of git_is_repo.

An alternative solution might have been to find the git worktree in the
parent of the git directory, but this doesn't work for all cases.
Generally it's impossible to detect the location of the worktree (plus
    it's not unique).

Co-authored-by: Pablo Aguiar <scorphus@gmail.com>
2020-11-30 15:09:43 -08:00
Kevin F. Konrad
ee1921b4c4 Add missing quotation marks in autoload (#711) 2019-07-22 22:21:53 -07:00
Fabian Homborg
131c8d74e5 lib/git/git_is_touched: Speed up (#706)
* lib/git/git_is_touched: Speed up

This used to use `git status --porcelain`, which by necessity needs to
check the entire repo for all kinds of changes, just to figure out if
there are any.

Instead, we now use git commands that can exit early.

In large repos, this can be faster by a factor of 15 or so.

Fixes #624.

* Fix return status

`git diff` also returns 1 if there *is* a diff.
2019-06-07 12:14:11 -07:00
Thales Mello
c0e69a589e Put conf_file loop outside of init_file loop (#666) 2019-01-10 19:57:14 -02:00
Stephen M. Coakley
97b6b92cdd
Merge pull request #618 from oranja/609-installer-no-carets
Use posix stderr redirection (`2>` instead of `^`)
2019-01-04 10:19:46 -06:00
Derek W. Stavis
355cc597fa
add conf.d to require mechanism (#653) 2018-11-18 19:41:36 -08:00
Itzik Ephraim
a6a67be60b Use posix stderr redirection (2> instead of ^)
Fish is deprecating `^` as a shortcut for stderr redirection.
Replace with the more common and compatible `2>`.

Fixes #609
2018-06-09 01:23:32 +03:00
Stephen M. Coakley
d951cb1a15 Normalize redirection syntax (#459) 2016-12-17 20:26:46 -06:00
Derek Willian Stavis
7c3db938c2 docs: improve headers, use flag emojis for translations (#370) 2016-07-24 01:25:01 -03:00
Derek Willian Stavis
1d0e9aa4c7 lib/README: cleanup, better document require (#369) 2016-07-23 22:27:36 -03:00
Derek Willian Stavis
8aa8acb027 lib/git: fix branch name in detached head (#366) 2016-07-22 13:27:38 -03:00
Derek Willian Stavis
4691b92dab require: fix completions autoload (#343) 2016-06-07 21:27:14 -03:00
Derek Willian Stavis
2c4471a78c autoload: refactor for conformance and performance (#262)
Refactor autoload: Split the big function into two smaller ones,
doing only option parsing at main function.

The algorithm is also rewritten, now in two steps for both path
inclusion an exclusion functions: 1) use auxiliary lists to store
valid function and completion paths, 2) bulk insert or remove just
once in the variable.

Now also respects path insertion policy, keeping user function
path always in front of other paths, thus allowing precedence of
user functions.
2016-06-01 01:14:30 -03:00
Derek Willian Stavis
a164ebdd5d init: rewrite init process (#260)
* init: rewrite init process

Now use pure globbing to generate 100% valid function and
completion paths, effectively splitting the init process in two
steps, one which paths are added, and other when initialization
is done (sourcing init).

This initialization code introduces a new interface for
`init.fish` hook, which deprecates the previously used event
model. The new interface injects three variables into `init.fish`:
path, package and bundle. This variables can be used by the
package to autoload paths, use bundled files, etc.

Also supports key bindings by sourcing
$OMF_CONFIG/key_bindings.fish and also key_bindings.fish in
packages (plugins and themes) root directories. This is done
when fish_user_key_bindings is called.

* omf: migrate to new init hook

* omf/templates: migrate to new init and uninstall hooks

* docs: document new init and uninstall hooks interface

* README: update new hook interface spec
2016-06-01 01:09:38 -03:00
Justin Hileman
b490fad367 Merge branch 'master' into deprecate-refresh 2016-03-23 08:10:27 -07:00
Derek Stavis
65dfadfc02 lib: deprecate available function
This PR officially marks available as deprecated, moving the
deprecated functionality to omf plugin compat quarantine directory.
2016-03-22 21:48:05 -03:00
Derek Stavis
37705618b2 lib: deprecate refresh function
With great power comes great responsibility. This function is
somewhat low level, and is harmful to shell's user, as it
completely screws up with job control (subprocesses).

This PR officially marks `refresh` as deprecated, moving the
deprecated functionality to omf plugin `compat` quarantine
directory.
2016-03-22 21:35:52 -03:00
Derek Stavis
de0aaeabf7 git_ahead: Fix indicator override 2016-01-21 09:47:11 -02:00
Itzik Ephraim
e83b674fd3 bugfix: git_ahead no longer reports 'none' as 'ahead' 2016-01-19 19:00:21 +02:00
Itzik Ephraim
ec8c209f07 A different approach in git_ahead 2016-01-16 17:30:52 +02:00
Itzik Ephraim
6fa3332438 bugfix: add missing $s in git_ahead 2015-12-31 15:19:06 +02:00
Derek Stavis
042657cdcf require: recursively require package dependencies 2015-11-17 21:07:12 -02:00
Bruno Pinto
5f77a5db12 Remove basename from core library
The features added by this function are not used anywhere.

Fix #151
2015-11-03 14:02:39 +00:00
Derek Stavis
bf44c45cd5 autoload: Use set -e to remove path from destination 2015-11-01 22:43:52 -02:00
Derek Stavis
ecbc9c5ed3 require: Cleanup previously sourced init functions 2015-10-14 21:58:31 -03:00
Derek Stavis
ebd7192cd1 Implement autoload -e to remove autoload path
Address the use case of autoload path removal, which allows themes
and packages definitions to be unloaded from running fish session.
2015-10-04 15:58:38 -03:00
Bruno Pinto
1ab8a20b8c Fix #8: Fishy plugin template 2015-10-03 22:18:52 +01:00
Derek Stavis
8b8a7c8d73 Save history before replacing shell process
Fixes an issue with history between shell reloads via refresh function call.
As `exec` replaces the current process in a non-gently fashion, the
persistent history could be out of sync with the in-memory history.

Calling `history --save` before `exec` should force the shell to persist the
history before replacing the current process.
2015-10-02 21:49:53 -03:00
Bruno Pinto
319c8a05cd Don't overwrite function on test environment
Instead of overwriting functions that use `exec fish` on test
environment, skip this call if the variable `CI` has been defined on the
running shell.
2015-10-02 23:50:18 +01:00
Bruno Pinto
30ab05445d Add require function to support plugin dep
In order to support dependency between plugins a function called
`require` has been added.
2015-10-02 21:35:06 +01:00
Derek Willian Stavis
2fbd1535f7 lib/README: fix swapped lines
Swap `prompt_segments` and `refresh` description.
2015-09-14 14:06:37 -03:00
Bruno Pinto
8aa6bf7ee2 Remove unnecessary code
This was actually trying to load PATHs that do not exist under $OMF_CONFIG
directory and sourcing files that did not exist.
2015-09-05 19:20:19 +01:00
Bruno Pinto
ae0e4388b6 Back to oh-my-fish organization 2015-09-03 19:35:19 +01:00
Jorge Bucaran
bf52f5d57a fix basename polyfill 2015-08-27 03:55:16 +09:00
Jorge Bucaran
2693a2fd18 %%% United States of the Fish → Wahoo + OMF %%% 2015-08-27 00:20:13 +09:00