all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Git never commits, Magit never pushes
@ 2011-04-02  7:18 Sébastien Vauban
  2011-04-02  7:55 ` Jambunathan K
                   ` (5 more replies)
  0 siblings, 6 replies; 12+ messages in thread
From: Sébastien Vauban @ 2011-04-02  7:18 UTC (permalink / raw
  To: help-gnu-emacs-mXXj517/zsQ

Hello,

I try using git (from git.el, in git-contrib-emacs, downloaded from Git's Web
site) to manage my files.

I can add "Unknown" files, that works (with `a', then my log message, followed
by `C-c C-c'). They get the new status "Uptodate".

However, I cannot *commit* "Modified" files from Emacs (with `c', then my log
message, followed by `C-c C-c'):

--8<---------------cut here---------------start------------->8---
Running git commit...
error: css/leuven.css: cannot add to the index - missing --add option?
fatal: Unable to process path css/leuven.css
--8<---------------cut here---------------end--------------->8---

Doing the commit "by hand" from the command line (Bash) works:

--8<---------------cut here---------------start------------->8---
git commit css/leuven.css -m "Fix colors."
--8<---------------cut here---------------end--------------->8---

When refreshing the `*git-status*' buffer (with `g'), I see the file as
"Uptodate".

So, something seems wrong with the commit command used by git.el?

I'm reluctant to use Magit, as I loose the interactive ediff feature
(confirmed?), which I'm fond of, but OK...

There I can perfectly stage files and even commit them. But I cannot *push*
them: the command never returns, it never completes its work (stays "git push"
in the modeline).

Once again, that works without any problems from the command line interface...

So, to wrap it up:

- with git.el, I can't commit
- with magit.el, I can't push

Any idea on how to solve the first (my favorite, for getting ediff) or both
problems?

My environment:

- GNU Emacs 23.1.50.1 (i386-mingw-nt5.1.2600) of 2009-10-14 on LENNART-69DE564
  (patched)
- Windows XP SP3
- Cygwin 1.7.something
- C:/cygwin/bin/git version 1.7.4
- Intel Core 2 Duo T5600 @ 1.83 GHz
- 2 GB RAM
- files on local C: disk (NTFS)

Best regards,
  Seb

-- 
Sébastien Vauban


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Git never commits, Magit never pushes
  2011-04-02  7:18 Git never commits, Magit never pushes Sébastien Vauban
@ 2011-04-02  7:55 ` Jambunathan K
  2011-04-02 14:05 ` Ian Barton
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 12+ messages in thread
From: Jambunathan K @ 2011-04-02  7:55 UTC (permalink / raw
  To: Sébastien Vauban; +Cc: public-help-gnu-emacs-mXXj517/zsQ




Have you tried vc-git that comes bundled with emacs.

C-x v d <git controlled dir> and C-x v C-h within a git controlled
buffer are good places to start.

Jambunathan K.






^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Git never commits, Magit never pushes
  2011-04-02  7:18 Git never commits, Magit never pushes Sébastien Vauban
  2011-04-02  7:55 ` Jambunathan K
@ 2011-04-02 14:05 ` Ian Barton
  2011-04-03 20:51   ` PJ Weisberg
       [not found] ` <mailman.7.1301730983.4225.help-gnu-emacs@gnu.org>
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 12+ messages in thread
From: Ian Barton @ 2011-04-02 14:05 UTC (permalink / raw
  To: help-gnu-emacs

On 02/04/11 08:18, Sébastien Vauban wrote:
> I'm reluctant to use Magit, as I loose the interactive ediff feature
> (confirmed?), which I'm fond of, but OK...
>
> There I can perfectly stage files and even commit them. But I cannot *push*
> them: the command never returns, it never completes its work (stays "git push"
> in the modeline).
>
> Once again, that works without any problems from the command line interface...
>
> So, to wrap it up:
>
> - with git.el, I can't commit
> - with magit.el, I can't push
>
> Any idea on how to solve the first (my favorite, for getting ediff) or both
> problems?
>

I can push OK with magit here. Using Ubuntu 10.10. Don't use git.el, so 
can help there. You can view git messages in Magit from Magit/Display 
git output, or using $. Maybe that will give a hint.

Other bits are:

GNU Emacs 23.2.1 (x86_64-pc-linux-gnu, GTK+ Version 2.21.6)
  of 2010-09-01 on americium, modified by Debian

Ian.



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Git never commits, Magit never pushes
       [not found] ` <mailman.7.1301730983.4225.help-gnu-emacs@gnu.org>
@ 2011-04-03  8:09   ` Sébastien Vauban
  2011-04-03  9:15     ` Jambunathan K
       [not found]     ` <mailman.13.1301822571.7560.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 12+ messages in thread
From: Sébastien Vauban @ 2011-04-03  8:09 UTC (permalink / raw
  To: help-gnu-emacs-mXXj517/zsQ

Hi Jambunathan,

Jambunathan K wrote:
> Have you tried vc-git that comes bundled with emacs.

Now, yes. But it still does not interest me that much, as there is no
interactive diff, which one tool I really need to compare buffers before
committing.

> C-x v d <git controlled dir> and C-x v C-h within a git controlled buffer
> are good places to start.

What's funny for me, though, is the status "added" for a file that has already
been committed several times!?

--8<---------------cut here---------------start------------->8---
VC backend : Git
Working dir: c:/home/sva/src/web-in-org/
Branch     : master
Remote     : XXX
Stash      : Nothing stashed

                         ./
                         org/
     added         +x    org/leuven.css
--8<---------------cut here---------------end--------------->8---

I could commit the file through `vc-next-action'. That works.

I did not find yet, though, how to push it to the Git repo. But, as I said, I
have fears when I have to commit files which I couldn't compare side-by-side.
I "cannot" read the sequential +/- lines...

Any idea on how to progress on this?

Best regards,
  Seb

-- 
Sébastien Vauban


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Git never commits, Magit never pushes
  2011-04-03  8:09   ` Sébastien Vauban
@ 2011-04-03  9:15     ` Jambunathan K
       [not found]     ` <mailman.13.1301822571.7560.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 12+ messages in thread
From: Jambunathan K @ 2011-04-03  9:15 UTC (permalink / raw
  To: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 2954 bytes --]


> Hi Jambunathan,
>
> Jambunathan K wrote:
>> Have you tried vc-git that comes bundled with emacs.
>
> Now, yes. But it still does not interest me that much, as there is no
> interactive diff, which one tool I really need to compare buffers before
> committing.

I use ediff with git all the time. 

Put vc-ediff.el (attached with this mail) in the load-path. Add the
following code to .emacs.

Now "x" on a vc-dir would hide update and unregistered files. (It will
only show added/modified files)

"C-x C-v =" on a version controlled buffer would launch ediff window.

I have been using this setup for a while so I know it works. If
something is broken it is possible that I haven't copy/pasted some stuff
from my init file. 

--8<---------------cut here---------------start------------->8---
(require 'vc-ediff)

(add-hook  'vc-dir-mode-hook
	   (lambda nil
	     (define-key vc-dir-mode-map "x" 'my-vc-dir-hide-up-to-date)))

(defun my-vc-dir-hide-up-to-date ()
  (interactive)
  (vc-dir-hide-up-to-date)
  (vc-dir-hide-unregistered))

(defun vc-dir-hide-unregistered ()
  "Hide unregistered items from display."
  (interactive)
  (let ((crt (ewoc-nth vc-ewoc -1))
	(first (ewoc-nth vc-ewoc 0)))
    ;; Go over from the last item to the first and remove the
    ;; unregistered files and directories with no child files.
    (while (not (eq crt first))
      (let* ((data (ewoc-data crt))
	     (dir (vc-dir-fileinfo->directory data))
	     (next (ewoc-next vc-ewoc crt))
	     (prev (ewoc-prev vc-ewoc crt))
	     ;; ewoc-delete does not work without this...
	     (inhibit-read-only t))
	(when (or
	       ;; Remove directories with no child files.
	       (and dir
		    (or
		     ;; Nothing follows this directory.
		     (not next)
		     ;; Next item is a directory.
		     (vc-dir-fileinfo->directory (ewoc-data next))))
	       ;; Remove files in the unregistered state.
	       (eq (vc-dir-fileinfo->state data) 'unregistered))
	  (ewoc-delete vc-ewoc crt))
	(setq crt prev)))))


(defun my-ediff-revision (file rev1 &optional rev2)
  "Run Ediff by comparing 'master' against the 'current'."
  (find-file file)
  (if (and (buffer-modified-p)
	   (y-or-n-p (format "Buffer %s is modified. Save buffer? "
			     (buffer-name))))
      (save-buffer (current-buffer)))

  (ediff-load-version-control)

  (funcall
   (intern (format "ediff-%S-internal" ediff-version-control-package))
   rev1 rev2 nil))

(defun my-vc-diff (&optional arg)
  (interactive "P")
  (call-interactively
   (cond (arg (lambda nil (interactive) (vc-diff nil)))
	 (t (lambda nil (interactive)
	      (my-ediff-revision (buffer-file-name)
				 (read-string "revision? " "HEAD" nil "HEAD")
				 ""))))))

(define-key vc-prefix-map "=" 'my-vc-diff)

--8<---------------cut here---------------end--------------->8---

> I did not find yet, though, how to push it to the Git repo. 

C-x v v commits to the local branch. I generally push to the remote repo
from the shell.



[-- Attachment #2: vc-ediff.el --]
[-- Type: application/emacs-lisp, Size: 2549 bytes --]

[-- Attachment #3: Type: text/plain, Size: 5 bytes --]


-- 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Git never commits, Magit never pushes
  2011-04-02 14:05 ` Ian Barton
@ 2011-04-03 20:51   ` PJ Weisberg
  0 siblings, 0 replies; 12+ messages in thread
From: PJ Weisberg @ 2011-04-03 20:51 UTC (permalink / raw
  To: lists; +Cc: help-gnu-emacs

On 4/2/11, Ian Barton <lists@manor-farm.org> wrote:

> I can push OK with magit here. Using Ubuntu 10.10. Don't use git.el, so

This appears to be Magit bug #154 [1], which doesn't appear under
GNU/Linux unless you're doing something unusual.

I use the native Windows build when I'm not on Debian, but since
Cygwin may be different you could try evaluating:

(setq magit-process-connection-type (not magit-process-connection-type))

And if that helps post back with the value of
magit-process-connection-type that worked.

Incidently, if anyone reading this is using Magit on Windows and can
do things that require you to enter a password, I'd like to know how
it's set up.

[1] https://github.com/philjackson/magit/issues/154

-PJ



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Git never commits, Magit never pushes
  2011-04-02  7:18 Git never commits, Magit never pushes Sébastien Vauban
                   ` (2 preceding siblings ...)
       [not found] ` <mailman.7.1301730983.4225.help-gnu-emacs@gnu.org>
@ 2011-04-05  6:30 ` PJ Weisberg
       [not found] ` <mailman.0.1301985049.6502.help-gnu-emacs@gnu.org>
  2011-04-15 20:14 ` PJ Weisberg
  5 siblings, 0 replies; 12+ messages in thread
From: PJ Weisberg @ 2011-04-05  6:30 UTC (permalink / raw
  To: help-gnu-emacs

On 4/2/11, Sébastien Vauban <wxhgmqzgwmuf@spammotel.com> wrote:

> There I can perfectly stage files and even commit them. But I cannot *push*
> them: the command never returns, it never completes its work (stays "git
> push"
> in the modeline).

As a workaround you could use a private key that doesn't require a
password and/or set the GIT_SSH env variable to point to some program
that's capable of asking for one within Magit.

-PJ



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Git never commits, Magit never pushes
       [not found]     ` <mailman.13.1301822571.7560.help-gnu-emacs@gnu.org>
@ 2011-04-05 11:50       ` Sébastien Vauban
  2011-04-05 16:16         ` Jambunathan K
  0 siblings, 1 reply; 12+ messages in thread
From: Sébastien Vauban @ 2011-04-05 11:50 UTC (permalink / raw
  To: help-gnu-emacs-mXXj517/zsQ

Hi Jambunathan and al.,

Thanks for your answers...

Jambunathan K wrote:
>> Jambunathan K wrote:
>>> Have you tried vc-git that comes bundled with emacs.
>>
>> Now, yes. But it still does not interest me that much, as there is no
>> interactive diff, which one tool I really need to compare buffers before
>> committing.
>
> I use ediff with git all the time.
>
> Put vc-ediff.el (attached with this mail) in the load-path. Add the
> following code to .emacs.

DONE.

> Now "x" on a vc-dir would hide update and unregistered files. (It will
> only show added/modified files)
>
> "C-x C-v =" on a version controlled buffer would launch ediff window.

You meant "C-x v =", I guess.

> I have been using this setup for a while so I know it works. If something is
> broken it is possible that I haven't copy/pasted some stuff from my init
> file.
>
> [...]

My test on an "edited" file:

--8<---------------cut here---------------start------------->8---
VC backend : Git
Working dir: c:/home/sva/src/
Branch     : master
Remote     : git-VglghZ3J0L77m/ziVfR4gQ@public.gmane.org:src/src.git
Stash      : Nothing stashed

                         ./
                         org/
     edited              org/about.org
--8<---------------cut here---------------end--------------->8---

gives the following error:

--8<---------------cut here---------------start------------->8---
Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  expand-file-name(nil)
  find-file-noselect(nil nil nil nil)
  find-file(nil)
  my-ediff-revision(nil "HEAD" "")
  (lambda nil (interactive) (my-ediff-revision (buffer-file-name) (read-string "revision? " "HEAD" nil "HEAD") ""))()
  call-interactively((lambda nil (interactive) (my-ediff-revision (buffer-file-name) (read-string "revision? " "HEAD" nil "HEAD") "")))
  my-vc-diff(nil)
  call-interactively(my-vc-diff nil nil)
--8<---------------cut here---------------end--------------->8---

>> I did not find yet, though, how to push it to the Git repo.
>
> C-x v v commits to the local branch. I generally push to the remote repo
> from the shell.

BTW, does using the "vc" backend for Git allow you as well to use exactly the
same key bindings for other backends (SVN, CVS)?

Best regards,
  Seb

-- 
Sébastien Vauban


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Git never commits, Magit never pushes
       [not found] ` <mailman.0.1301985049.6502.help-gnu-emacs@gnu.org>
@ 2011-04-05 12:01   ` Sébastien Vauban
  0 siblings, 0 replies; 12+ messages in thread
From: Sébastien Vauban @ 2011-04-05 12:01 UTC (permalink / raw
  To: help-gnu-emacs-mXXj517/zsQ

Hi PJ Weisberg,

PJ Weisberg wrote:
> On 4/2/11, Sébastien Vauban <wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org> wrote:
>
>> There I can perfectly stage files and even commit them. But I cannot *push*
>> them: the command never returns, it never completes its work (stays "git
>> push" in the modeline).

In the *magit-process* buffer:

--8<---------------cut here---------------start------------->8---
$ git --no-pager push -v origin master
Pushing to git-VglghZ3J0L77m/ziVfR4gQ@public.gmane.org:src/src.git
--8<---------------cut here---------------end--------------->8---

nothing more.

From the command-line:

--8<---------------cut here---------------start------------->8---
sva@MEDIACENTER:.../src/src 0$ git push
Enter passphrase for key '/cygdrive/c/home/sva/.ssh/id_rsa':
<< (entered my password)
Counting objects: 31, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (18/18), done.
Writing objects: 100% (26/26), 2.80 KiB, done.
Total 26 (delta 8), reused 0 (delta 0)
To git-VglghZ3J0L77m/ziVfR4gQ@public.gmane.org:src/src.git
   c5aed3b..a498869  master -> master
--8<---------------cut here---------------end--------------->8---


> As a workaround you could use a private key that doesn't require a password
> and/or set the GIT_SSH env variable to point to some program that's capable
> of asking for one within Magit.

Do you know any (for Windows or Cygwin)?

Best regards,
  Seb

-- 
Sébastien Vauban


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Git never commits, Magit never pushes
  2011-04-05 11:50       ` Sébastien Vauban
@ 2011-04-05 16:16         ` Jambunathan K
  2011-04-05 16:23           ` Jambunathan K
  0 siblings, 1 reply; 12+ messages in thread
From: Jambunathan K @ 2011-04-05 16:16 UTC (permalink / raw
  To: Sébastien Vauban; +Cc: public-help-gnu-emacs-mXXj517/zsQ




>> Now "x" on a vc-dir would hide update and unregistered files. (It will
>> only show added/modified files)
>>
>> "C-x C-v =" on a version controlled buffer would launch ediff window.
>
> You meant "C-x v =", I guess.

Yes. C-x v =.

>
>> I have been using this setup for a while so I know it works. If something is
>> broken it is possible that I haven't copy/pasted some stuff from my init
>> file.
>>
>> [...]
>
> My test on an "edited" file:
>
> VC backend : Git
> Working dir: c:/home/sva/src/
> Branch     : master
> Remote     : git-VglghZ3J0L77m/ziVfR4gQ@public.gmane.org:src/src.git
> Stash      : Nothing stashed
>
>                          ./
>                          org/
>      edited              org/about.org
>
> gives the following error:
>
> Debugger entered--Lisp error: (wrong-type-argument stringp nil)
>   expand-file-name(nil)
>   find-file-noselect(nil nil nil nil)
>   find-file(nil)
>   my-ediff-revision(nil "HEAD" "")
>   (lambda nil (interactive) (my-ediff-revision (buffer-file-name) (read-string "revision? " "HEAD" nil "HEAD") ""))()
>   call-interactively((lambda nil (interactive) (my-ediff-revision (buffer-file-name) (read-string "revision? " "HEAD" nil "HEAD") "")))
>   my-vc-diff(nil)
>   call-interactively(my-vc-diff nil nil)

Looks like you are doing `C-x v =' from vc-dir buffer. That's why it is
unable to identify a filename. Use the above command from within
`about.org' buffer - the buffer that is modified.

>
>>> I did not find yet, though, how to push it to the Git repo.
>>
>> C-x v v commits to the local branch. I generally push to the remote repo
>> from the shell.
>
> BTW, does using the "vc" backend for Git allow you as well to use exactly the
> same key bindings for other backends (SVN, CVS)?

That's correct. Over the course of years I have used essentially the
same interface/keybinding with cvs, svn, perforce, mercurial, clearcase
and now git. This way I don't have to ever remember the backend specific
commands for committing etc etc.

And it is always a good idea to use packages that come with regular
emacs. I have found vc-git.el satisfactory for my needs.

Btw if you customize `vc-command-messages' to t then you can see what
backend command vc is issuing. This is good way to explore the backend.

>
> Best regards,
>   Seb

-- 




^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Git never commits, Magit never pushes
  2011-04-05 16:16         ` Jambunathan K
@ 2011-04-05 16:23           ` Jambunathan K
  0 siblings, 0 replies; 12+ messages in thread
From: Jambunathan K @ 2011-04-05 16:23 UTC (permalink / raw
  To: Sébastien Vauban; +Cc: public-help-gnu-emacs-mXXj517/zsQ




As a side note, there has been some discussion about vc-ediff on
emacs-devel list. 

http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00373.html

Jambunathan K.






^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Git never commits, Magit never pushes
  2011-04-02  7:18 Git never commits, Magit never pushes Sébastien Vauban
                   ` (4 preceding siblings ...)
       [not found] ` <mailman.0.1301985049.6502.help-gnu-emacs@gnu.org>
@ 2011-04-15 20:14 ` PJ Weisberg
  5 siblings, 0 replies; 12+ messages in thread
From: PJ Weisberg @ 2011-04-15 20:14 UTC (permalink / raw
  Cc: help-gnu-emacs@gnu.org

On Saturday, April 2, 2011, Sébastien Vauban <wxhgmqzgwmuf@spammotel.com> wrote:

> I'm reluctant to use Magit, as I loose the interactive ediff feature
> (confirmed?), which I'm fond of, but OK...

Cool, my first non-trivial patch to Magit just got merged.

If anyone still wants to know, the version of Magit in the GitHub
repository now has Ediff support.  Press 'e' with the cursor on any
diff.

git://github.com/philjackson/magit.git

-PJ

-- 

-PJ



^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2011-04-15 20:14 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-02  7:18 Git never commits, Magit never pushes Sébastien Vauban
2011-04-02  7:55 ` Jambunathan K
2011-04-02 14:05 ` Ian Barton
2011-04-03 20:51   ` PJ Weisberg
     [not found] ` <mailman.7.1301730983.4225.help-gnu-emacs@gnu.org>
2011-04-03  8:09   ` Sébastien Vauban
2011-04-03  9:15     ` Jambunathan K
     [not found]     ` <mailman.13.1301822571.7560.help-gnu-emacs@gnu.org>
2011-04-05 11:50       ` Sébastien Vauban
2011-04-05 16:16         ` Jambunathan K
2011-04-05 16:23           ` Jambunathan K
2011-04-05  6:30 ` PJ Weisberg
     [not found] ` <mailman.0.1301985049.6502.help-gnu-emacs@gnu.org>
2011-04-05 12:01   ` Sébastien Vauban
2011-04-15 20:14 ` PJ Weisberg

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.