Stage all files in tig - tig

In tig command line tool for git, you go to the status view and you press u to stage a file. What I am curious about is how to perform that actions multiple time without repeating the word u. Is this possible to stage multiple files or all files with just one key combo?

While it is not possible out of the box, you can configure it via your tigrc file. As an example, assuming that while you are in the stage view, you want to map the A key to the git add -A bash command. Here is what you will need to add to your tigrc file:
bind status A #git add -A
The syntax is pretty straightforward, the # flag just means that the command output will not be shown.

Related

vim ~/.ssh/config command isn't showing any results

I'm using windows 10 ,I want to get into the SSH file but whenever I type "vim ~/.ssh/config" into my Git Bash the result I get is this
but the result I'm trying to get is supposed to look like the ones are showing in this second picture:
Can someone tell me how to get those results in my command ?
If the second picture is a file you already have on your disk, you need to copy it to your %USERPROFILE%\.ssh folder (since %USERPROFILE% is what git bash uses by default as $HOME or ~)
If the second picture is a file you want to have, then you need to create it.

vim-fugitive automatically gdiff on enter from gstatus

When using vim-fugitive if you issue :Gstatus it splits the screen and gives you the would be git commit editor and you can move over different files that have changes and press enter to see them in the other half of the screen. I believe it is like issuing :Gedit .
I then need to issue a :Gdiff manually to split the editor in half and see the side by side diff of the file to review and or stage it.
My question is is there a way to make it automatically go to :Gdiff when I press enter, while my cursor is on a file name that has changes.
Basically trying to save some time when going through a large list of files.
You can use D or dd inside the :Gstatus window to run :Gdiff on the file under the cursor. See :h :fugitive-:Gstatus or use g? inside the :Gstatus window.
For additional help you may wan to look at Vimcasts, which has some very nice fugitive.vim series.
A complement to command line git
Working with the git index
Resolving merge conflicts with vimdiff
Browsing the git object database
Exploring the history of a git repository

How to do p4 annotate on single line of code?

I have a big project and I want to find all the users who have used specific keywords in the code (eg. "goto"). Doing p4 annotate on all the files will take a lot of time.
Is there a way to quickly do p4 annotate on a single line of a given file?
Do you really care about uses of 'goto' that are no longer present in the code (i.e., uses that were added and then later removed?
I suggest not; that simplifies the search.
If you start with p4 grep -e goto //project/file/path/..., you will find out which files currently contain that word. Then you only have to examine those files.
Then, for each file, you can run `p4 annotate -u //project/file/name | grep goto' and see which change(s) added the word 'goto' to that file.
Then you can examine the results.
By the way, if your server is at version 2015.2 or higher, you can use the new '-u' flag added by
#1233417 (Bug #12755) **
'p4 annotate' now supports a new flag '-u'. This flag instructs
annotate to display the user who modified the change and the date
when the modification occurred.
this will help you with your final report because you won't have to do the extra step of looking up each changelist to see who submitted it.

Is it possible to disable perforce RCS keyword expansion ($Id$)?

Perforce keeps RCS keywords unexpanded on server, but whenever you get latest it expand them. This makes it difficult when comparing changes between different branches using third-party tools.
Is it possible to disable this behavior for a particular workspace or user?
As I understand it is possible to adjust this behavior per file by modifying file type:
http://answers.perforce.com/articles/KB/3482
By I cannot modify those files on the server, so I am looking for a client-only solution.
You change the filetype from the client. From the command line, if I have, say, a text file with RCS keywords enabled and I want it disabled, I do:
p4 reopen -c default -t text //depot/path/file.txt
Or, from P4V, right-click on the file, choose "Change Filetype..." and deselect "+k RCS Keyword Expansion".

unable to use external command in tig

I use git and gitk a lot. Recently, I found some enthousiastic posts about tig and decided to give it a try.
It looks great for viewing the repository, however changing the repo with tig seems difficult if not unworkable.
The problem I am facing is that tig fails to start an editor for external commands, thus making it impossible to continue with the action.
For example, if I select a commit and issue
!git commit --amend
I get a screen saying
vim: Warning: Output is not to a terminal
Only ^C gets me out, thus stopping tig as well.
What can I do to configure this properly for either tig or git in order to get this working?
thanks in advance,
Ruud
The main way to start external commands is via keybindings and what in Tig is referred to as user-defined commands. For example, to amend the last commit you can add the following to ~/.tigrc after which pressing + will put you right into Vim:
bind generic + !git commit --amend
There are several variables for the browsing state, which can be passed to external commands, such as %(commit) and %(branch) as well as %(prompt) for asking for input, for example when creating a branch.
For reference, the !<command> allows to open the output in the pager, for example !git show 3e3abcd and as such is more like Vim's :r!<command>.

Resources