Fatal: git was built without support for git-add--interactive (NO_PERL=1)
Thanks guys for your comments. I fixed it by removing git and installing it "apt-get install git."
The problem was that the Bitnami-LAMP VM came with a pre-built-git that, I guess, wasn't built with PERL. I checked my PERL version and is fine. Anyways, all is good.
Can't use Git add -i
Thanks to comment of @torek, I managed to use the commands after installing Per
You should not have.
- The latest versions of Git for Windows no longer use Perl for
git add
(mingw64/libexec/git-core/git-add.exe
). This is rewritten in C since Git 2.25, Q1 2020. perl.exe
is part of the Git for Windows distribution: make sure your%PATH%
includesC:\path\to\Git\usr\bin
There is no need to install Perl for Git to run.
2 years later (Q1 2022), With Git 2.36 (Q2 2022), there are still finishing touches to C rewrite of "git add -i
"(man) in single-key interactive mode.
See commit 0f584de, commit 6606d99, commit e4938ce, commit 02af15d (16 Mar 2022) by Phillip Wood (phillipwood
).
See commit 32f3ac2 (09 Mar 2022) by Junio C Hamano (gitster
).
(Merged by Junio C Hamano -- gitster
-- in commit d723492, 30 Mar 2022)
terminal
: restore settings on SIGTSTPSigned-off-by: Phillip Wood
If the user suspends git while it is waiting for a keypress reset the terminal before stopping and restore the settings when git resumes.
If the user tries to resume in the background print an error message (taking care to use async safe functions) before stopping again.
Ideally we would reprint the prompt for the user when git resumes but this patch just restarts theread()
.The signal handler is established with
sigaction()
rather than usingsigchain_push()
as this allows us to control the signal mask when the handler is invoked and ensureSA_RESTART
is used to restart the read() when resuming.
Is there any way to make `git add --patch` respond to a single `y` or `n` keystroke?
That would be the Git configuration option interactive.singleKey
.
interactive.singleKey
In interactive commands, allow the user to
provide one-letter input with a single key (i.e., without hitting
enter). Currently this is used by the--patch
mode ofgit-add(1)
,
git-checkout(1)
,git-commit(1)
,git-reset(1)
, andgit-stash(1)
. Note
that this setting is silently ignored if portable keystroke input is
not available; requires the Perl moduleTerm::ReadKey
.
That is, in your .gitconfig
or equivalent file, add:
[interactive]
singleKey = true
Or run git config [--global] interactive.singleKey yes
, if you like yes
better than true
and commands better than editors.
Multiple staging areas
Edit, 30 May 2020: In Git 2.15 or later I recommend using git worktree
instead of trying to do the below. There are some restrictions on added work-trees that make them somewhat annoying for this kind of work-flow, but it can work, and is built in to modern Git.
Note that if you do do something like I describe below, git gc
won't know to look in your alternate index files, and in fact, from its original introduction in Git 2.5 until it was fixed in Git 2.15, git gc
forgot to check added work-trees and their index files!
See VonC's answer for more.
You can in fact have multiple different staging areas (more literally, multiple index files) in git. To achieve the effect you want you would have to write your own variant of git add -p
anyway, so what I will do here is sketch an outline, as it were, of how to do this.
The default index file—the one git uses if you don't direct it to some other index file—lives in .git/index
(or, more shell-correctly, $GIT_DIR/.index
where $GIT_DIR
is taken from the environment or, if not set there, from git rev-parse --git-dir
).
If you set the environment variable GIT_INDEX_FILE
, however, git will use that file instead as the index. Thus, you might begin your "scatter changes to four branches" process by doing something like this:
GIT_DIR=${GIT_DIR:-$(git rev-parse --git-dir)} || exit 1
index_tmp_dir=$(mktemp -d) || exit 1
trap "rm -rf $index_tmp_dir" 0 1 2 3 15 # clean up on exit
# make four copies of initial staging area
for f in i1 i2 i3 i4; do
cp $GIT_DIR/index $index_tmp_dir/$f
done
# THIS IS THE HARD PART:
# Now, using `git diff-files -p` or similar, get patches
# (diff hunks).
# Whenever you're ready to stage one, pick an index for it,
# then use:
GIT_INDEX_FILE=$index_tmp_dir/$which git apply --cached < diffhunk
# Once done, commit each index file separately with some
# variation on:
for f in i1 i2 i3 i4; do
GIT_INDEX_FILE=$index_tmp_dir/$which git commit
done
For the part labeled "hard part", your best bet might well be to copy git's add-interactive perl script, found in $(git --exec-path)/git-add--interactive
, then modify it to suit. To remove the "exactly four commits" restriction, make this modified interactive-add create a new index file dynamically (by copying the original, or perhaps creating an "empty" index equal to the HEAD
commit or whatever; see git read-tree
as well).
Edit: the some variation on section really should almost certainly use git write-tree
and git commit-tree
to make new branches out of each of these commits, using the parent of the current commit as their parent, rather than allowing git commit
to string the commits together as a linear chain. That means one must also choose some naming scheme for these various newly-created branches.
cygwin cannot exec 'git-add--interactive' permission denied
This happened for me too. After lots of digging, I found that /bin/cygperll5_14.dll was missing. Using cygwin's setup.exe, I Reinstalled perl
and perl_base
. Then everything started working.
Isn't that obvious? ;-)
fswebcam: Unable to load font 'luxisr': libgd was not built with FreeType font support
What you can do is:
- Add libfreetype to .config
- Change
[buildroot_DIR]/package/feeds/packages/gd/Makefile
and set line --without-freetype
to
--with-freetype=$(STAGING_DIR)/usr
- (re-)build libgd and libfreetype packages and update OpenWrt system
Then get a copy of the desired ttf (e.g. ubuntu /usr/share/fonts/truetype/freefont/FreeSans.ttf)
export GDFONTPATH
- set desired font in fswebcam.config
Where is data_directory for homebrew? or for postgresql or how do I solve error, global/pg_filenode.map: No such file or directory?
FATAL: could not open relation mapping file "global/pg_filenode.map": No such file or directory
You had a PostgreSQL install, but deleted or moved the data directory while the server was running. Or you installed it on a removable disk that you then removed. Or some application on your system is messing with how other apps change files.
moriartymacbookair13:~ macuser$ postgres
postgres does not know where to find the server configuration file.
postgres
is the server application. The client is psql
. However, if global/pg_filenode.map
is missing you're not going to have any more luck with psql
.
moriartymacbookair13:~ macuser$ brew uninstall postgres
sudo brew uninstall postgres
Anyway there we have it, toward the end of that large output it
confirms the path for me is/usr/local/var/postgres
, so I tried-D
moriartymacbookair13:~ macuser$ postgres -D /usr/local/postgres
postgres cannot access the server configuration file "/usr/local/postgres/postgresql.conf": No such file or directory
You got the path wrong. Note what "brew info" said:
Or, if you don't want/need launchctl, you can just run:
postgres -D /usr/local/var/postgres
As for the postgres
user:
moriartymacbookair13:~ macuser$ sudo -u postgres pg_ctl -D /usr/local/var/postgres -w start
sudo: unknown user: postgres
I think some Mac OS X installs use _postgres
or postgres_
. I don't have a mac, so I can't check. But it doesn't matter in your case anyway, because the datadir is owned by your user, not postgres
:
moriartymacbookair13:~ macuser$ ls -ld /usr/local/var/postgres/
drwx------ 19 macuser admin 646B 20 Sep 19:46 /usr/local/var/postgres//
It looks to me like you or some tool on your system has mangled your PostgreSQL data directory, corrupting it. This shouldn't happen, so I'd be making an effort to find out what removed pg_filenode.map
and how/when.
If there is no data you care about in the data directory, you should delete it and re-initdb.
I don't have a Mac and I can't see how Homebrew configures your PostgreSQL install's startup, but it sounds like it probably runs postgres
as user macuser
. In which case, just:
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
rm -rf /usr/local/var/postgres
initdb -D /usr/local/var/postgres -U postgres --auth-local peer --auth-host md5 -E utf-8l
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
Finally, re:
Note, when I tried to use the postgres.app installer now it told me
"Could not start on Port 5432" and froze during installation
at a guess, when you tried that you had the postgres
server from Homebrew already running on 5432, but nonfunctional because of the damaged data directory.
So you really have two things here:
- Re-initdb the datadir to get PostgreSQL working again; and
- Figure out how it got damaged in the first place
Related Topics
Haskell Ghc Compiling/Linking Error, Not Creating Executable. (Linux)
Bash Script: Always Show Menu After Loop Execution
Linux: Instantiate from User-Space:Eeprom New_Device
How to Get No. of Lines Count That Matches a String from All the Files in a Folder
Does Using Xvfb to Run Opengl Effects Version
/Usr/Bin/Ld: Client: Hidden Symbol '_Dso_Handle'
How to Replace Finding Words with the Different in Each Occurrence in Vi/Vim Editor
Initiating Dynamic Variables (Variable Variables) in Bash Shell Script
How to Show Read Prompt with a New Line
Why Does If [ !$(Grep -Q) ] Not Work When If Grep -Q Does
How to Acess the Physical Address from Linux Kernel Space
Provide Password Using Shell Script
Iptables Script to Block All Internet Access Except for Desired Applications
How Uevents Get Triggered in Kernel