Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Intermittent failures in tests #34

Open
sirnewton01 opened this issue Jul 11, 2018 · 9 comments
Open

Intermittent failures in tests #34

sirnewton01 opened this issue Jul 11, 2018 · 9 comments
Labels

Comments

@sirnewton01
Copy link
Collaborator

There are intermittent failures in TestStatus (status_test.go) that happen rarely on Mac, quite often on Travis CI (disabled using an environment variable for now), sometimes on Plan 9 and often on Dragonfly. UnidiffApply also appears to be failing only on Plan 9 or Dragonfly. These tests should be more robust and work on multiple platforms so that dgit can be verified in a variety of places.

@driusan
Copy link
Owner

driusan commented Jul 11, 2018

UnidiffApply execs the system patch command, so it's likely that those are legitimate OS specific failures.

@sirnewton01
Copy link
Collaborator Author

If it invokes the system patch command how would it work on Windows?

@driusan
Copy link
Owner

driusan commented Jul 12, 2018

It wouldn't for now

@sirnewton01
Copy link
Collaborator Author

I wonder if this library could replace the use of OS installed diff/patch.

https://github.com/sergi/go-diff

@driusan
Copy link
Owner

driusan commented Jul 12, 2018

It might be worth looking into. Diffing isn't hard to do, any reasonable diff algorithm can be written in Go. It's patching that gets difficult, because you need to support any arbitrary patch for apply, not just the ones you generate yourself. Even APE uses a port of the gnu patch tool, so if you don't use the system patch you probably need bug for bug compatibility with it anyways.

@sirnewton01
Copy link
Collaborator Author

Base Plan 9 has the diff tool but I don't see anything that allows you to apply a diff to a file. Maybe I'm missing something obvious.

@driusan
Copy link
Owner

driusan commented Jul 12, 2018

dgit uses ape/patch and ape/diff on Plan 9. It's defined here: https://github.com/driusan/dgit/blob/master/git/consts_plan9.go

@sirnewton01
Copy link
Collaborator Author

I was thinking that the whole git diff and apply system is just a convenience to standardize the way that git users can pass around patches. It's not a very Unix/Plan 9 way of doing things, but I suppose git is not following the traditional Unix way at all.

Thinking back on the way that Plan 9 development was originally managed before APE I wonder how they passed around patches and applied them. I see that the base system has a diff command (not APE), but I don't see any patch command that isn't APE. There is a patch system in man(1), but that seems to be a system for managing patches. How did one casually give an experimental patch to someone and allow them to apply it?

@driusan driusan added the bug label Jul 15, 2018
@driusan
Copy link
Owner

driusan commented Jul 15, 2018

But using git as a manager for patches is a very git way of doing things, just not the GitHub way. The whole git am and git format-patch commands are dedicated to it, and some of the largest git projects (git itself, and the Linux kernel, for instance) are developed that way rather than using a GitHub PR model.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants