2013-12-18 13 views
9

Quando si utilizza git add --patch somefile.txt in cygwin ottengo una risposta bizzarra.Come smettere di aggiungere git -patch non visualizzato prompt in mint

Dopo aver digitato il comando, mi attende il numero immettendo senza visualizzare nulla. Una volta che si preme immettere ottengo il seguente output

--- a/somefile.txt 
+++ b/somefile.txt 
@@ -m,n +m,n @@ 
-Aple 
+Apple 
Bear 
Cat 
Dog 

Stage this hunk [y,n,q,a,d,/,j,J,g,e,?]? y - stage this hunk 
n - do not stage this hunk 
q - quit; do not stage this hunk nor any of the remaining ones 
a - stage this hunk and all later hunks in the file 
d - do not stage this hunk nor any of the later hunks in the file 
g - select a hunk to go to 
/- search for a hunk matching the given regex 
j - leave this hunk undecided, see next undecided hunk 
J - leave this hunk un 

e lascia il carati dopo un

Dopo aver selezionato, in questo caso n ottengo il resto

J - leave this hunk unn 
decided, see next hunk 
k - leave this hunk undecided, see previous undecided hunk 
K - leave this hunk undecided, see previous hunk 
s - split the current hunk into smaller hunks 
e - manually edit the current hunk 
? - print help 
@@ -1,4 +1,4 @@ 
-Lne 1 
+Line 1 
Line 2 
Line 3 
Line 4 
Stage this hunk [y,n,q,a,d,/,j,J,g,e,?]? @@ -289,6 +289,8 @@ 
Line 289 
Line 290 
Line 291 
+Line 292 
+Line 293 
Line 294 
Line 295 
Line 296 

Il pattern continua per il resto del file lasciandomi in grado di dire a quale pezzo mi viene richiesto.

risposta

1

Dato il numero di voti, questo ha ricevuto sembra che io non sono l'unico con questo problema.

Sembrerebbe che l'installazione predefinita di Cygwin non includa git. Tuttavia, se hai installato git separatamente, sarà stato aggiunto al tuo percorso di Windows e sembrerà che funzioni in ogni altro aspetto.

cioè

> which git 
c:\Program Files (x86)\Git\bin\git 

Una volta ho installato Git attraverso Cygwin e usato quella versione il problema è stato risolto

cioè

> which git 
/usr/bin/git 
6

Di solito vedo due impostazioni quando si utilizza git con Cygwin.

Il primo (se il vostro git config -l non sono già includerlo) è di circa il pager (come in questo gitconfig file)

git config core.pager C:/cygwin/root/bin/less.exe 

[core] 
     # we want to use cygwin's less, because msys's doesn't play well 
     # with i/o via cygwin bash. This would be the default, but for the fact 
     # that msysgit prepends `dirname argv[0]` to $PATH. 
     pager = C:/cygwin/root/bin/less.exe 

Gli altri sono circa il TTY, come in this blog post:

export TERM=cygwin 
export LESS=FRSX 

Una di queste impostazioni dovrebbe rendere il tuo git add -p più fluido.

+0

Purtroppo nessuna di queste opere, suppongo sua qualcosa a che fare con il modo in cui vengono utilizzati gli Input e gli OutputString –

+0

Ho assegnato a questa risposta la taglia in quanto è l'unica risposta e la taglia stava per scadere. Tuttavia, queste impostazioni non fanno alcuna differenza sulla mia macchina. –