zsh-workers
 help / color / mirror / code / Atom feed
* Error messages from VCS_INFO_get_data_git
@ 2015-05-24 20:24 brian m. carlson
  2015-05-25 18:04 ` Daniel Hahler
  0 siblings, 1 reply; 3+ messages in thread
From: brian m. carlson @ 2015-05-24 20:24 UTC (permalink / raw)
  To: zsh-workers


[-- Attachment #1.1: Type: text/plain, Size: 825 bytes --]

I'm using zsh 5.0.7 and I'm seeing some error messages when I use git
rebase -m with vcs_info.  One is already fixed in git, and if I copy the
git version of the file over my existing copy, I get the following:

  grep: .git/rebase-merge/git-rebase-todo: No such file or directory

I'm using Git 2.4.0, and that file doesn't appear to exist in newer Git
versions.  I've also tried with Git 2.1.4, and it appears to be absent
there as well.

The fix is probably as simple as redirecting stderr in that case to
/dev/null.  A patch to do exactly that is attached.

Please CC me, as I'm not subscribed.
-- 
brian m. carlson / brian with sandals: Houston, Texas, US
+1 832 623 2791 | http://www.crustytoothpaste.net/~bmc | My opinion only
OpenPGP: RSA v4 4096b: 88AC E9B2 9196 305B A994 7552 F1BA 225C 0223 B187

[-- Attachment #1.2: vcs-info-git-patch --]
[-- Type: text/plain, Size: 748 bytes --]

diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
index c348da2..80c6df3 100644
--- a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
+++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
@@ -210,7 +210,7 @@ elif [[ -d "${gitdir}/rebase-merge" ]]; then
         # remove action
         git_patches_applied+=("${${(s: :)p}[2,-1]}")
     done
-    git_patches_unapplied=(${(f)"$(grep -v '^$' "${patchdir}/git-rebase-todo" | grep -v '^#')"})
+    git_patches_unapplied=(${(f)"$(grep -v '^$' "${patchdir}/git-rebase-todo" 2>/dev/null | grep -v '^#')"})
     VCS_INFO_git_handle_patches
 elif [[ -d "${gitdir}/rebase-apply" ]]; then
     # Fake patch names for all but current patch

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: Error messages from VCS_INFO_get_data_git
  2015-05-24 20:24 Error messages from VCS_INFO_get_data_git brian m. carlson
@ 2015-05-25 18:04 ` Daniel Hahler
  2015-05-25 18:17   ` brian m. carlson
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Hahler @ 2015-05-25 18:04 UTC (permalink / raw)
  To: brian m. carlson, Zsh Hackers' List

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 24.05.2015 22:24, brian m. carlson wrote:

> I'm using zsh 5.0.7 and I'm seeing some error messages when I use git
> rebase -m with vcs_info.  One is already fixed in git, and if I copy the
> git version of the file over my existing copy, I get the following:
> 
>   grep: .git/rebase-merge/git-rebase-todo: No such file or directory
> 
> I'm using Git 2.4.0, and that file doesn't appear to exist in newer Git
> versions.  I've also tried with Git 2.1.4, and it appears to be absent
> there as well.

The file is used with interacive rebasing ("git rebase -i"), see
git-rebase--interactive.sh in Git's source.

Were you running into a conflict with "git rebase -m", or used some other
option that would have aborted/interrupted it?
Does it happen for every "git rebase -m"?

The code path is only triggered when ".git/rebase-merge" exists:

    elif [[ -d "${gitdir}/rebase-merge" ]]; then

And that's what Git (2.4.1+) checks/uses in wt-status.c:

	} else if (!stat(git_path("rebase-merge"), &st)) {
		if (!stat(git_path("rebase-merge/interactive"), &st))
			state->rebase_interactive_in_progress = 1;
		else
			state->rebase_in_progress = 1;
		state->branch = read_and_strip_branch("rebase-merge/head-name");
		state->onto = read_and_strip_branch("rebase-merge/onto");

> The fix is probably as simple as redirecting stderr in that case to
> /dev/null.  A patch to do exactly that is attached.

Thanks, but I think there should be a "test -f ..." instead.


Regards,
Daniel.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iD8DBQFVY2RHfAK/hT/mPgARAiWQAJ4xK86pt5NBgUEComofKjzCwQO0VACfel5v
yMKm1XHzR5oQB79/btB7yn0=
=JEo/
-----END PGP SIGNATURE-----


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

* Re: Error messages from VCS_INFO_get_data_git
  2015-05-25 18:04 ` Daniel Hahler
@ 2015-05-25 18:17   ` brian m. carlson
  0 siblings, 0 replies; 3+ messages in thread
From: brian m. carlson @ 2015-05-25 18:17 UTC (permalink / raw)
  To: Zsh Hackers' List

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

On Mon, May 25, 2015 at 08:04:55PM +0200, Daniel Hahler wrote:
> On 24.05.2015 22:24, brian m. carlson wrote:
> 
> >   grep: .git/rebase-merge/git-rebase-todo: No such file or directory
> > 
> > I'm using Git 2.4.0, and that file doesn't appear to exist in newer Git
> > versions.  I've also tried with Git 2.1.4, and it appears to be absent
> > there as well.
> 
> The file is used with interacive rebasing ("git rebase -i"), see
> git-rebase--interactive.sh in Git's source.
> 
> Were you running into a conflict with "git rebase -m", or used some other
> option that would have aborted/interrupted it?
> Does it happen for every "git rebase -m"?

Yes, in this particular case I'm running into a conflict.  It's just git
rebase -m, not git rebase -i -m.  The file in question is only used by
git-rebase--interactive.sh, which is only triggered with -i.

It always happens when I encounter a conflict with git rebase -m without
using -i.
-- 
brian m. carlson / brian with sandals: Houston, Texas, US
+1 832 623 2791 | http://www.crustytoothpaste.net/~bmc | My opinion only
OpenPGP: RSA v4 4096b: 88AC E9B2 9196 305B A994 7552 F1BA 225C 0223 B187

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

end of thread, other threads:[~2015-05-25 18:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-24 20:24 Error messages from VCS_INFO_get_data_git brian m. carlson
2015-05-25 18:04 ` Daniel Hahler
2015-05-25 18:17   ` brian m. carlson

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).