Commit Graph

37 Commits (master)

Author SHA1 Message Date
jjangga0214 446a94a766
docs: rm unnecessary img tag from readme (#859) 2 years ago
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.
4 years ago
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>
4 years ago
Kevin F. Konrad ee1921b4c4 Add missing quotation marks in autoload (#711) 5 years ago
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.
5 years ago
Thales Mello c0e69a589e Put conf_file loop outside of init_file loop (#666) 5 years ago
Stephen M. Coakley 97b6b92cdd
Merge pull request #618 from oranja/609-installer-no-carets
Use posix stderr redirection (`2>` instead of `^`)
5 years ago
Derek W. Stavis 355cc597fa
add conf.d to require mechanism (#653) 6 years ago
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
6 years ago
Stephen M. Coakley d951cb1a15 Normalize redirection syntax (#459) 8 years ago
Derek Willian Stavis 7c3db938c2 docs: improve headers, use flag emojis for translations (#370) 8 years ago
Derek Willian Stavis 1d0e9aa4c7 lib/README: cleanup, better document require (#369) 8 years ago
Derek Willian Stavis 8aa8acb027 lib/git: fix branch name in detached head (#366) 8 years ago
Derek Willian Stavis 4691b92dab require: fix completions autoload (#343) 8 years ago
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.
8 years ago
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
8 years ago
Justin Hileman b490fad367 Merge branch 'master' into deprecate-refresh 8 years ago
Derek Stavis 65dfadfc02 lib: deprecate `available` function
This PR officially marks available as deprecated, moving the
deprecated functionality to omf plugin compat quarantine directory.
8 years ago
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.
8 years ago
Derek Stavis de0aaeabf7 git_ahead: Fix indicator override 8 years ago
Itzik Ephraim e83b674fd3 bugfix: git_ahead no longer reports 'none' as 'ahead' 8 years ago
Itzik Ephraim ec8c209f07 A different approach in git_ahead 8 years ago
Itzik Ephraim 6fa3332438 bugfix: add missing $s in git_ahead 9 years ago
Derek Stavis 042657cdcf require: recursively require package dependencies 9 years ago
Bruno Pinto 5f77a5db12 Remove `basename` from core library
The features added by this function are not used anywhere.

Fix #151
9 years ago
Derek Stavis bf44c45cd5 autoload: Use set -e to remove path from destination 9 years ago
Derek Stavis ecbc9c5ed3 require: Cleanup previously sourced init functions 9 years ago
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.
9 years ago
Bruno Pinto 1ab8a20b8c Fix #8: Fishy plugin template 9 years ago
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.
9 years ago
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.
9 years ago
Bruno Pinto 30ab05445d Add `require` function to support plugin dep
In order to support dependency between plugins a function called
`require` has been added.
9 years ago
Derek Willian Stavis 2fbd1535f7 lib/README: fix swapped lines
Swap `prompt_segments` and `refresh` description.
9 years ago
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.
9 years ago
Bruno Pinto ae0e4388b6 Back to oh-my-fish organization 9 years ago
Jorge Bucaran bf52f5d57a fix basename polyfill 9 years ago
Jorge Bucaran 2693a2fd18 %%% United States of the Fish → Wahoo + OMF %%% 9 years ago