git auto-complete doesn't prompt branch names - bash

I tried all that mentioned in this thread, still when I double tap tab key for command git checkout I get only following suggestions
FETCH_HEAD HEAD ORIG_HEAD
whereas I am expecting branch names.
Any other suggestion to get this working?
I am on ubuutu 14.04
Distributor ID: Ubuntu
Description: Ubuntu 14.04.5 LTS
Release: 14.04
Codename: trusty
UPDATE
global gitconfig file
[user]
email = abc#zxc.com
name = Abc Zxc
[credential]
helper = cache --timeout=3600
[filter "lfs"]
process = git-lfs filter-process
required = true
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
[diff]
tool = meld
[merge]
tool = meld
[difftool]
prompt = false
git version
kishor#kishor-ThinkCentre-E73:~$ git version
git version 1.9.1
bash-completion details
# bash/zsh completion support for core Git.
#
# Copyright (C) 2006,2007 Shawn O. Pearce <spearce#spearce.org>
# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/).
# Distributed under the GNU General Public License, version 2.0.
Command output
git --git-dir=".git" for-each-ref --shell --format="%(refname:short)" refs/tags refs/heads refs/remotes
'160117_whole_flow_demo'
'170109_aws_mgmt_plane'
'170123_django_angular_lib'
'170124_authentication'
'170125_merging_html'
'170206_code_integration'
'170208_ng_code_snippets'
'170214_user_mapping_and_dropdown'
... and so on
P.S. I am facing the same issue in all other repos also.

I may be wrong, but I think you are trying to use a too old version of git compared to your version of git-completion.
You can try running:
git for-each-ref --format="(refname:strip=2)" refs/heads/*
If there is no output, of if there is an error, I am probably right (I expect something along the line of fatal: unknown refname: format strip=2).
In this case, either upgrade your version of git, or replace your git-completion so that it matches your version of git. If you choose the latter, you can use this version (from git's github repository).

Related

Failure in verification of Move Module for SUI

So I was following the documentation for beginners on SUI, I faced an issue with my Move.toml as I was building my file with sui move build. And I got the following error
Failed to verify the Move module, reason: "Sui framework version mismatch detected.
Make sure that you are using a GitHub dep in your Move.toml:[dependencies]
Sui = { git = \"https://github.com/MystenLabs/sui.git\", subdir = \"crates/sui-framework\", rev = \"devnet\" }\n`
If that does not fix the issue, your `sui` binary is likely out of date--try
cargo install --locked --git https://github.com/MystenLabs/sui.git --branch devnet sui".
I get that my SUI binary is likely out of date and I tried
cargo install --locked --git https://github.com/MystenLabs/sui.git --branch devnet sui
However that didn't fix the error and I got another error which was
error: could not find `sui` in https://github.com/MystenLabs/sui.git?branch=devnet with version `*`
I have also tried running the command
cargo install --locked --git https://github.com/MystenLabs/sui.git --branch "devnet" sui sui-gateway
From the docs but i am facing this error
Updating git repository `https://github.com/MystenLabs/sui.git`
error: could not find `sui` in https://github.com/MystenLabs/sui.git?branch=devnet with version `*`
Updating git repository `https://github.com/MystenLabs/sui.git`
error: could not find `sui-gateway` in https://github.com/MystenLabs/sui.git?branch=devnet with version `*`
Summary Failed to install sui, sui-gateway (see error(s) above).
error: some crates failed to install
I am wondering how I can fix the issue and update my sui binary?
Context:
MacOs
SUI before 0.11 devnet release
I had the same errors when trying to install the SUI binaries. The following hint in the installation instructions solved my issue.
"Trouble shooting: If the previous command fails, make sure you have the latest version of Rust installed:"
rustup update stable
source "$HOME/.cargo/env"
Try to use the Sui module from Github instead of the local. In your Move.toml file
Replace this row
[dependencies]
Sui = { local = "../../../crates/sui-framework" }
with this
[dependencies]
Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework", rev = "devnet" }

Buildroot error when building with Ubuntu 21.10

I am trying to compile linux for RISCV Arch using buildroot(busybox). I was using 18.04 and 20.04 previously and had no issues compiling it. Right now, I have upgraded it to 21.10 for building some other stuffs. I have moved my toolchain and I can find it using the which command. When I try to compile linux I get some error which I havn't faced in the earlier versions.
>>> host-m4 1.4.18 Building
In file included from /usr/include/signal.h:328,
from ./signal.h:52,
from c-stack.c:49:
c-stack.c:55:26: error: missing binary operator before token "("
55 | #elif HAVE_LIBSIGSEGV && SIGSTKSZ < 16384
| ^~~~~~~~
CC closein.o
c-stack.c:134:8: error: variably modified 'buffer' at file scope
134 | char buffer[SIGSTKSZ];
| ^~~~~~
CC closeout.o
I am confused on how different versions can cause this error.
Thanks in advance.
It looks like you have hit a change in GNU C Library version 2.34 that can make SIGSTKSZ non-constant.
From the GNU C Library 2.34 release announcement:
Add _SC_MINSIGSTKSZ and _SC_SIGSTKSZ. When _DYNAMIC_STACK_SIZE_SOURCE or _GNU_SOURCE are defined, MINSIGSTKSZ and SIGSTKSZ are no longer constant on Linux. MINSIGSTKSZ is redefined to sysconf(_SC_MINSIGSTKSZ) and SIGSTKSZ is redefined to sysconf (_SC_SIGSTKSZ). This supports dynamic sized register sets for modern architectural features like Arm SVE.
A possible workaround is to configure buildroot to build host-m4 version 1.4.19 instead of 1.4.18, because it no longer uses SIGSTKSZ.
I saw that error when building on Ubuntu 22.04 for an embedded Linux board using Buildroot. It got stuck when building the host-m4 package. #Ian Abbott is right:
A possible workaround is to configure buildroot to build host-m4 version 1.4.19 instead of 1.4.18, because it no longer uses SIGSTKSZ.
In Buildroot, to update from m4 v 1.4.18 to 1.4.19, simply grab the latest files here: https://github.com/buildroot/buildroot/tree/master/package/m4
As of right now (9 Jan. 2023), the upstream Buildroot m4 version there is
1.4.19, as shown here: https://github.com/buildroot/buildroot/blob/master/package/m4/m4.mk#L7:
################################################################################
#
# m4
#
################################################################################
M4_VERSION = 1.4.19
M4_SOURCE = m4-$(M4_VERSION).tar.xz
M4_SITE = $(BR2_GNU_MIRROR)/m4
M4_LICENSE = GPL-3.0+
M4_LICENSE_FILES = COPYING
$(eval $(host-autotools-package))
How to upgrade/update any buildroot package to the latest upstream version, from the command-line
Here is an example of how to upgrade any buildroot package from the command-line. In these commands, I am upgrading the m4 package, to solve the problem in the OP's question. Change the word m4 in all 3 places to the name of the package you'd like to update:
# initially:
cd path/to/buildroot
git remote add upstream https://github.com/buildroot/buildroot.git
git fetch upstream master
# then (from within the "buildroot" repo or subrepo)
rm -r package/m4
git checkout upstream/master -- package/m4
git add -A
git status
git commit -m "Update m4 library"

git-svn Can't locate SVN/Core.pm after fresh installation of macOS Catalina 10.15.4

Recently I reinstalled macOS Catalina 10.15.4. After I installed Command_Line_Tools_11.4.1, it told me svn is no longer working with Xcode. Then I installed both git and svn by brew, hopefully git-svn would work. Unfortunately got this error message:
Can't locate SVN/Core.pm in #INC (you may need to install the SVN::Core module) (#INC contains: /usr/local/Cellar/git/2.26.2/share/perl5 /Applications/Xcode.app/Contents/Developer/Library/Perl/5.18/darwin-thread-multi-2level /Library/Developer/CommandLineTools/Library/Perl/5.18/darwin-thread-multi-2level /Library/Perl/5.18/darwin-thread-multi-2level /Library/Perl/5.18 /Network/Library/Perl/5.18/darwin-thread-multi-2level /Network/Library/Perl/5.18 /Library/Perl/Updates/5.18.4 /System/Library/Perl/5.18/darwin-thread-multi-2level /System/Library/Perl/5.18 /System/Library/Perl/Extras/5.18/darwin-thread-multi-2level /System/Library/Perl/Extras/5.18 .) at /usr/local/Cellar/git/2.26.2/share/perl5/Git/SVN/Utils.pm line 6.
Both git & svn are the latest version.
Please help me out.
Finally I figure it out!!!
Open the git-svn file (perl script, in my case file location is /usr/local/opt/git/libexec/git-core/git-svn), change the first line #!/usr/bin/perl to #!/usr/local/bin/perl
And it works!
I guess system perl doesn't include perl SVN/Core, but brew perl has it (dependency of brew svn).
Solution for MacOS Big Sur 11.5
After struggling with this error for hours:
Can't locate SVN/Core.pm in #INC (you may need to install the SVN::Core module)
I've finally found a solution that actually works.
If you run:
brew reinstall subversion
It will print a message like this:
The perl bindings are located in various subdirectories of:
/usr/local/opt/subversion/lib/perl5
Then you just need to run this command before using git svn to load the SVN module from the correct path:
export PERL5LIB=/usr/local/opt/subversion/lib/perl5/site_perl/5.30.2/darwin-thread-multi-2level
Solution for those, who, like me - want to use Sourcetree client on macOS Catalina with git-svn:
First step:
brew install git
brew install perl
brew install subversion
edit
/usr/local/Cellar/git/git_version/libexec/git-core/git-svn
replace
#!/usr/bin/perl
with
#!/usr/local/bin/perl
Second step, install missed perl modules:
cpan SVN::Core
cpan Term::ReadKey
Third step, configure SourceTree:
In Sourcetree->Preferences - set option "use system git", from:
/usr/local/Cellar/git/git_version/git
While not a permanent fix, a workaround is to set ${GITPERLLIB}:
$ export GITPERLLIB=/usr/local/Cellar/git/2.31.1/share/perl5:/usr/local/lib/perl5/site_perl/5.28.2/darwin-thread-multi-2level
$ git svn clone svn+ssh://...
worked for me without editing any scripts installed by brew.
Ensure you've installed Perl, Subversion and dependencies via Homebrew:
brew install perl subversion apr apr-util
Install required Perl modules into ~/perl5:
export PATH="/usr/local/opt/apr/bin:/usr/local/opt/apr-util/bin:$PATH"
PERL_MM_OPT="INSTALL_BASE=$HOME/perl5" cpan local::lib Git::SVN SVN::Core
Verify installed modules by:
PERL5LIB="$HOME/perl5" cpan -l | grep SVN
Then configure Perl as following (based on brew info perl steps):
eval "$(perl -I$HOME/perl5/lib/perl5 -Mlocal::lib=$HOME/perl5)"
Finally run Git's SVN:
PERLLIB="$HOME/perl5" git svn clone https://svn.somecode.example.com/svn/trunk
If you're still stuck, try GitHub and GitLab websites which offer migration with a Git/SVN.
E.g. in GitHub, create a new repository, then import the project by pasting old repository’s clone URL.
The error message says:
$ git svn --version
Can't locate SVN/Core.pm in #INC (you may need to install the SVN::Core module) (#INC contains: /usr/local/opt/subversion/lib/perl5 /usr/local/Cellar/git/2.31.1/share/perl5 /Applications/Xcode.app/Contents/Developer/Library/Perl/5.28/darwin-thread-multi-2level /Library/Developer/CommandLineTools/Library/Perl/5.28/darwin-thread-multi-2level /Library/Perl/5.30/darwin-thread-multi-2level /Library/Perl/5.30 /Network/Library/Perl/5.30/darwin-thread-multi-2level /Network/Library/Perl/5.30 /Library/Perl/Updates/5.30.2 /System/Library/Perl/5.30/darwin-thread-multi-2level /System/Library/Perl/5.30 /System/Library/Perl/Extras/5.30/darwin-thread-multi-2level /System/Library/Perl/Extras/5.30) at /usr/local/Cellar/git/2.31.1/share/perl5/Git/SVN/Utils.pm line 6.
BEGIN failed--compilation aborted at /usr/local/Cellar/git/2.31.1/share/perl5/Git/SVN/Utils.pm line 6.
Compilation failed in require at /usr/local/Cellar/git/2.31.1/share/perl5/Git/SVN.pm line 25.
BEGIN failed--compilation aborted at /usr/local/Cellar/git/2.31.1/share/perl5/Git/SVN.pm line 32.
Compilation failed in require at /usr/local/Cellar/git/2.31.1/libexec/git-core/git-svn line 23.
BEGIN failed--compilation aborted at /usr/local/Cellar/git/2.31.1/libexec/git-core/git-svn line 23.
This is because git-svn is implemented by Perl, it needs a Perl library called SVN::Core to run。
Changing the first line of git-svn script from #!/usr/bin/perl to #!/usr/local/bin/perl won't fix this error!!! Because this just changes the Perl library from system default version to brew installed version。If the brew installed version doesn't contains SVN::Core, it'll still fail:
$ git svn --version
Can't locate SVN/Core.pm in #INC (you may need to install the SVN::Core module) (#INC contains: /usr/local/Cellar/git/2.31.1/share/perl5 /Applications/Xcode.app/Contents/Developer/Library/Perl/5.28/darwin-thread-multi-2level /Library/Developer/CommandLineTools/Library/Perl/5.28/darwin-thread-multi-2level /usr/local/Cellar/perl/5.34.0/lib/perl5/site_perl/5.34.0/darwin-thread-multi-2level /usr/local/Cellar/perl/5.34.0/lib/perl5/site_perl/5.34.0 /usr/local/Cellar/perl/5.34.0/lib/perl5/5.34.0/darwin-thread-multi-2level /usr/local/Cellar/perl/5.34.0/lib/perl5/5.34.0 /usr/local/lib/perl5/site_perl/5.34.0/darwin-thread-multi-2level /usr/local/lib/perl5/site_perl/5.34.0) at /usr/local/Cellar/git/2.31.1/share/perl5/Git/SVN/Utils.pm line 6.
BEGIN failed--compilation aborted at /usr/local/Cellar/git/2.31.1/share/perl5/Git/SVN/Utils.pm line 6.
Compilation failed in require at /usr/local/Cellar/git/2.31.1/share/perl5/Git/SVN.pm line 25.
BEGIN failed--compilation aborted at /usr/local/Cellar/git/2.31.1/share/perl5/Git/SVN.pm line 32.
Compilation failed in require at /usr/local/Cellar/git/2.31.1/libexec/git-core/git-svn line 23.
BEGIN failed--compilation aborted at /usr/local/Cellar/git/2.31.1/libexec/git-core/git-svn line 23.
Note that the Perl version has been changed, but the error still exists. Because there is no SVN:Core in the directories indicated by #INC.
Now some answers may tell you to install SVN::Core by cpan SVN::Core, Don't do that!!! This won't solve the problem! Because the version of SVN::Core it installed, may not match with your SVN version:
$ git svn --version
error: git-svn died of signal 11
By the way, cpan is rubbish, don't use it to install anything. It compiles the source before installation but cannot control the compile flags/options, and it cannot uninstall things that are installed by itself.
Here is the right solution:
The corresponding Perl libraries are already installed when you installed svn, and brew has already told you:
$ brew info svn
subversion: stable 1.14.1 (bottled), HEAD
Version control system designed to be a better CVS
https://subversion.apache.org/
/usr/local/Cellar/subversion/1.14.1_2 (234 files, 32.1MB) *
Poured from bottle on 2021-06-02 at 15:52:30
From: https://mirrors.ustc.edu.cn/homebrew-core.git/Formula/subversion.rb
License: Apache-2.0
==> Dependencies
Build: openjdk ✘, pkg-config ✘, python#3.9 ✔, scons ✘, swig ✘
Required: apr ✔, apr-util ✔, gettext ✔, lz4 ✔, openssl#1.1 ✔, utf8proc ✔
==> Options
--HEAD
Install HEAD version
==> Caveats
svntools have been installed to:
/usr/local/opt/subversion/libexec
The perl bindings are located in various subdirectories of:
/usr/local/opt/subversion/lib/perl5
You may need to link the Java bindings into the Java Extensions folder:
sudo mkdir -p /Library/Java/Extensions
sudo ln -s /usr/local/lib/libsvnjavahl-1.dylib /Library/Java/Extensions/libsvnjavahl-1.dylib
==> Analytics
install: 33,749 (30 days), 67,978 (90 days), 239,148 (365 days)
install-on-request: 33,129 (30 days), 67,011 (90 days), 229,097 (365 days)
build-error: 0 (30 days)
We can see that the Perl bindings are located in /usr/local/opt/subversion/lib/perl5, we just need to let git-svn use this path. With a little investigation of git-svn script, we can see this behavior is controlled by an environment variable called GITPERLLIB:
$ head /usr/local/Cellar/git/2.31.1/libexec/git-core/git-svn
#!/usr/bin/perl
use lib (split(/:/, $ENV{GITPERLLIB} || '/usr/local/Cellar/git/2.31.1/share/perl5:/Applications/Xcode.app/Contents/Developer/Library/Perl/5.28/darwin-thread-multi-2level:/Library/Developer/CommandLineTools/Library/Perl/5.28/darwin-thread-multi-2level'));
# Copyright (C) 2006, Eric Wong <normalperson#yhbt.net>
# License: GPL v2 or later
So the right way to solve this problem is to add the following code to your bashrc or zshrc:
export GITPERLLIB=/usr/local/opt/subversion/lib/perl5/site_perl/$<your_perl_version>/darwin-thread-multi-2level
Problem solved!

Installation of modules Perl 6 failed - No compiler available for Perl v6.c

I installed Rakudo, the Perl 6 interpreter, by:
sudo apt-get install rakudo
I am following a tutorial about installation of Perl 6 modules:
http://perl6maven.com/how-to-install-perl6-modules
And in the last step I get this error:
perl6 bootstrap.pl===SORRY!=== Error while compiling /home/daniel/test/panda/bootstrap.pl
No compiler available for Perl v6.c
at /home/daniel/test/panda/bootstrap.pl:3
------> use v6.c⏏;
Information about versions:
Ubuntu 16.04.2 LTS
This is perl6 version 2015.11 built on MoarVM version 2015.11
How do I install the lacking compiler?
Warning: This solution can be used for development, but for production it is recommended to manually compile the interpreter until the Ubuntu repository will not be updated.
Panda described in the linked tutorial is depreciated. I should use zef to install Perl modules.
My build of Perl was too old. I realized this after reading issue 380 about not working version 6.c.
The correct tutorial about installation of the newest Perl, 6.c, on Ubuntu is here:
http://linuxtot.com/installing-perl-6-on-debian-or-ubuntu/
Now my rakudo -v prints:
This is Rakudo version 2017.07-132-gabf1cfe built on MoarVM version 2017.07-318-g604da4d
implementing Perl 6.c.
And everything works great.
The below commands are extracted from a tutorial linked below:
apt-get install build-essential git libssl-dev
git clone https://github.com/tadzik/rakudobrew ~/.rakudobrew
echo 'export PATH=~/.rakudobrew/bin:$PATH' >> ~/.bashrc
source ~/.bashrc
rakudobrew build moar
rakudobrew build zef
Now to install the perl6 module:
zef install Module::Name
If you are comfortable installing your own software from source, then try the following (update the URL for the latest Rakudo Star from https://rakudo.perl6.org/downloads/star/):
wget -O rakudo-star-2017.07.tar.gz https://rakudo.perl6.org/downloads/star/rakudo-star-2017.07.tar.gz
tar -xvf rakudo-star-2017.07.tar.gz
cd rakudo-star-2017.07
perl Configure.pl --backend=moar --gen-moar
make
make rakudo-test
make install
Then add the following paths to your $PATH (replacing /path/to with the actual path, of course):
/path/to/rakudo-star-2017.07/install/bin
/path/to/rakudo-star-2017.07/install/share/perl6/site/bin
I use a module file for this:
#%Module1.0
## Metadata ###########################################
set this_module rakudo-star
set this_version 2017.07
set this_root /path/to/$this_module/$this_module-$this_version/install
set this_docs http://rakudo.org/documentation/
#######################################################
## Module #############################################
proc ModulesHelp { } {
global this_module this_version this_root this_docs
puts stderr "$this_module $this_version"
puts stderr "****************************************************"
puts stderr " $this_docs"
puts stderr "****************************************************\n"
}
module-whatis "Set up environment for $this_module $this_version"
prepend-path PATH $this_root/bin
prepend-path PATH $this_root/share/perl6/site/bin

Stack and git are incompatible in Windows 7?

I have been using Stack for dependencies management and building system for Haskell programs in Windows 7 Pro without problems.
stack --version
Version 1.3.2, Git revision 3f675146590da4f3edf768b89355f798229da2a5 x86_64 hpack-0.15.0
I have recently installed git for Windows, and Stack cannot download lts files anymore. It seems that Stack is trying using the new git client instead of the internal one.
git --version
git version 2.13.3.windows.1
The error I get when I try to create a new project is the following:
C:\proj>stack new newProject
Downloading template "new-template" to create project "newProject" in newProject\ ...
Looking for .cabal or package.yaml files to use to init the project.
Using cabal packages:
- newProject\newProject.cabal
Selecting the best among 11 snapshots...
Fetching package index ...fatal: Not a git repository: '.git'
Process exited with ExitFailure 128: C:\dev\git\apps\Git\cmd\git.EXE --git-dir=.git fetch --tags
Failed to fetch package index, retrying.
removeDirectoryRecursive: permission denied (Acceso denegado.)
If I rename the directory where git is installed, Stack works again. But that is not a real solution.
Any help will be apreciated

Resources