Perl 6 - the future is here, just unevenly distributed

IRC log for #darcs, 2015-11-29

| Channels | #darcs index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:04 maerwald pointfree: readProcess is easier even
00:04 maerwald I think I am shamelessly going to make use of it
00:12 sm pointfree: absolutely, charts could be very motivating
00:13 sm so: server-side (diagrams, Chart), client-side (d3.js, ...), or client-side haskell (diagrams/Chart + ghcjs) ?
00:15 maerwald sm: do you know why I cannot write a handler like ":user/:repo/rawpatch/:id1..:id2" ...it seems to be unable to parse that thing
00:15 sm by the way if you ever want to spend a half hour or an hour studying and/or cleaning up gnarly code, let's schedule it
00:16 sm maerwald: that's done by snap, is it ?
00:16 maerwald yeah
00:16 sm I don't know much about it, try #snapframework ?
00:17 IbnFirnas joined #darcs
00:17 IbnFirnas joined #darcs
00:19 sm pretty late with you maerwald
00:19 maerwald late?
00:19 sm you seem to be hacking through the night
00:19 maerwald yeah
00:21 sm perhaps .. is considered part of id1
00:22 maerwald seems so
00:22 Reyu joined #darcs
00:23 sm maybe you can build up the route from more manually with path & pathArg
00:28 maerwald sm: how do you feel about calling darcs from within the darcsden code via readProcess for example? The alternative would be to use the darcs API, but that's really complicated
00:29 sm maerwald: darcsden currently calls darcs directly for everything, no ?
00:29 maerwald not for everything afais
00:29 sm when does it use the cli ?
00:30 maerwald I don't even know... http://hub.darcs.net/maerwald/darcsden-mail-notify/browse/src/DarcsDen/Handlers/RepoHandlerUtils/Changes.hs this for example uses the darcs API directly
00:31 maerwald that's a lot of complicated type stuff with a lot of indirection
00:31 maerwald when I just want the patch as raw string... it has a hundred other representations, but not string
00:32 sm my feeling is that switching to using the cli would be a backwards step in most cases
00:32 sm it's (more) fragile, and not checked by GHC
00:32 maerwald I'm unable to do it via the darcs API though
00:33 sm well that's a problem indeed, which needs solving
00:33 sm is the complexity you're seeing right now in the darcs API, or darcsden ?
00:33 maerwald mostly darcs
00:34 maerwald I don't even understand most of the type signatures. And a lot of them are not documented
00:34 sm I think darcsden is the first/only external user of libdarcs, likely it could be a lot easier to user
00:35 maerwald it seems there's not much high-level API present, the only thing that is high-level are the cli tools
00:35 sm I've never really learned the darcs API
00:36 sm I know darcs (and lately, darcsden) has some very clever devs who have used some rather advanced GHC features which can be hard to deal with
00:36 maerwald clever code -> high bus factor -> less contributors ;)
00:37 sm I agree with that :/
00:37 maerwald I mean... the core probably needs to be clever, algorithmic-wise
00:37 maerwald but there should still be some fool-proof API around it
00:39 pointfree Didn't someone say they were working on porting pushout patch theory to darcs? (pijul)
00:39 maerwald sm: this is what I mean http://hub.darcs.net/maerwald/darcsden-patches/patch/da3ee97e6afd502caf39d663a81bafd41c59fce5
00:39 maerwald with readProcess it's really trivial to do
00:40 sm when I came to darcsden it was a very straightforward, approachable code base, I even advertised it as an easier place for darcs-interested devs to start out. I have a feeling that has changed quite a lot, which I regret. Trouble is, the more advanced type stuff was done in the name of generalising and better functionality, which is also quite valuable
00:41 sm maerwald: maybe you can design a similarly easy darcs API, and someone can implement it
00:41 maerwald well, adding handlers is still pretty easy
00:41 sm yes, good
00:42 maerwald I don't think I can design a darcs API..
00:42 sm I was thinking of stuff like settings and back ends
00:42 sm I don't mean a complete API, but just enough to do what you're trying to do now at least
00:42 sm sorry, got to go o/
00:43 maerwald I was saying that adding web handlers in snap is still pretty straight forward... 1. you add it to the list in Handlers.hs, 2. you define what the handler should do in RepoHandlers.hs, 3. you maybe write inline html code for the serving page in RepoPages.hs
01:29 mizu_no_oto joined #darcs
02:18 Big_G joined #darcs
02:19 dolio joined #darcs
02:38 Big_G joined #darcs
03:51 mizu_no_oto joined #darcs
05:05 mizu_no_oto joined #darcs
05:26 mizu_no_oto joined #darcs
09:33 Heffalump maerwald: the natural fool-proof API comes exactly from using clever type system tricks in the external API (primarily type witnesses). But they still intimidate people, probably mainly because the errors are confusing. Part of that is that GHC naturally doesn't know what the errors mean in API terms ("you're using this patch without commuting it").
09:33 Heffalump maerwald: why do you want the patch as a raw string?
09:34 Heffalump I'm unfortunately rather busy in the rest of my life at the moment, but I'm happy to help improve/add stuff to the darcs API as needed if we can jointly specify what it should do
09:49 Heffalump pointfree: I'm not working on adding it at present, but I hope to do so jointly with Florent and Pierre at the Seville sprint
13:23 maerwald Heffalump: having patches as raw strings is a fundamental REST feature of e.g. github: https://github.com/hasufell/CGA/commit/8b9908ebae8e22bb946089912099a06a0af50ea3.patch
13:23 pointfree sm: looks like you didn't push the darcshub deployed changes to http://hub.darcs.net/simon/darcsden (so it's not really what runs hub.darcs.net)
13:24 maerwald so you append ".patch" which allows you to read it cleanly or even fetch it
13:24 maerwald without html foo
13:27 maerwald and then I want to do the same thing with ranges of patches: https://github.com/hasufell/CGA/compare/8b9908ebae8e22bb946089912099a06a0af50ea3...master.patch
13:27 maerwald that allows easier review of sets of patches directly inside the darcsden UI
14:17 Heffalump maerwald: what would you do with the raw strings, process them in local JS?
14:18 maerwald Heffalump: just serve them as plaintext
14:18 maerwald see http://hub.darcs.net/maerwald/darcsden-patches/patch/da3ee97e6afd502caf39d663a81bafd41c59fce5
14:18 maerwald this uses readProcess currently
14:22 Heffalump with the intention that humans read them directly?
14:22 Heffalump or that some software processes them?
14:22 maerwald both
14:23 Heffalump what software?
14:23 maerwald I don't know
14:23 maerwald you can wget and patch -p1 them
14:23 maerwald there are a hundred use cases
14:23 maerwald and you don't even need darcs for that to work
14:25 Heffalump ok, so you want a real diff, not a darcs patch format?
14:25 maerwald yeah
14:26 Heffalump I think all the code for that is in Darcs.UI.Commands.Diff.doDiff and it isn't abstracted with a library function you could call directly
14:27 maerwald I already had a look at it, I don't understand it
14:27 Heffalump what type signature would you want for a library function you could call?
14:27 Heffalump oldtree <- filt `fmap` hashedTreeIO
14:27 Heffalump (apply . invert $ unsafeCoercePEnd todiff +>+ tounapply) base ppath
14:27 Heffalump newtree <- filt `fmap` hashedTreeIO
14:27 Heffalump (apply . invert $ tounapply) base ppath
14:28 Heffalump those are the key bits of the code (IMO) - it sets up two separate trees and then shells out to diff
14:28 maerwald pset <- R.readRepo dr
14:28 maerwald that's the first thing the "getPatch" function in darcsden do
14:28 maerwald from then on, it does weird type conversions
14:29 Heffalump a lot of the code in darcsden is basically converting darcs' datatypes to its own format
14:29 maerwald fromPS :: P.RepoPatch p => (forall x0 y0 . P.Named p x0 y0 -> b) -> R.PatchSet p x1 y1 -> [b]
14:29 maerwald I don't even know where to start understanding this
14:29 Heffalump personally I'd rather it just work directly on the right darcs datatypes, but (a) I haven't had time to do that and (b) other people might complain about infecting darcsden with type witnesses
14:30 Heffalump I think you need to look at where fromPS is called
14:30 maerwald http://hub.darcs.net/maerwald/darcsden/browse/src/DarcsDen/Handlers/RepoHandlerUtils/Changes.hs#230
14:30 maerwald there
14:31 Heffalump ok, so P.Named is the darcs representation of a single patch with its "name" (i.e. checkin comment)
14:31 Heffalump (String, ((PatchInfo,[PatchInfo]), [PatchChange]))
14:32 Heffalump seems to be how darcsden is representing them
14:32 Heffalump so makeList does that conversion
14:32 Heffalump and fromPS makeList takes an entire 'PatchSet' - i.e. collection of patches in the repository, and turns them into a list of that type
14:33 Heffalump fromPS is basically a map function, but darcs doesn't use normal lists internally for a collection of patches so it has a slightly different type
14:35 maerwald patchDiff :: Named p wX wY -> String
14:35 maerwald I want that
14:36 Heffalump that doesn't exist
14:36 Heffalump because darcs doesn't know what the Named would apply to
14:37 Heffalump suppose the Named just contained "move ./foo ./bar" - i.e. a file rename
14:37 Heffalump it would need to know what was in foo before to do it
14:37 Heffalump so it'll need some kind of context information about where the Named applies to do it
14:38 maerwald well, what does "darcs diff --hash <id>" do?
14:38 Heffalump it figures that information out from the repository its looking at
14:39 maerwald patchDiff :: Named p wX wY -> Repository -> String
14:39 Heffalump yeah, that's plausible
14:39 Heffalump as long as the Named is actually part of the Repository
14:39 Heffalump oh, and it'd need to have an IO type
14:40 Heffalump in types on the darcs side, it should be Repository p wR wU wT -> Named p wX wY -> String - or maybe just pass a PatchInfo rather than a Named p
14:41 Heffalump what should it look lik eif you want to pass multiple patches?
14:41 maerwald it should fuse the patches like "darcs diff --from-hash <id> --to-hash <id>" does
14:42 Heffalump what API are you hoping for?
14:43 maerwald you could generalize it as: patchDiff :: MonadIO m => Repository p wR wU wT -> [Named p wX wY] -> m (Maybe String)
14:43 Heffalump it could be FL (Named p) wX wY for a list of patches that are already known to be in sequence in the repository
14:45 Heffalump [Named p wX wY] doesn't really make sense to darcs, because each patch has the same wX and wY which implies they all do exactly the same thing
14:46 maerwald well, I don't even know what wX and wY are, so..
14:46 Heffalump they represent repository states
14:47 Heffalump so Named p wX wY is a single darcs patch that applies to a specific repository state wX
14:55 maerwald I would think that these kind of functions should also simplify the cli tools code
14:55 maerwald what I basically have in mind is that the cli tools have a similar code-API representation
14:55 maerwald there shouldn't be a huge gap
14:56 maerwald people shouldn't have to know much of darcs internals to e.g. write a GUI for it
15:11 sm g'day all
15:11 sm pointfree: I had forgotten to push to the main repo, and also it seems I failed to get the build date in the footer to update, but I believe it is running the latest
15:38 maerwald sm: http://hub.darcs.net/maerwald/darcsden-patches/patch/597a4ebf6d39701d739b6e4315f9bd79f1c91407
15:39 sm ooh - thank you
15:39 maerwald if the page is inaccessible, it'll throw a warning "must be logged in blah"... I don't think we can know in advance if that's the case
15:40 maerwald because it only knows it when the handler gets executed, which is after the redirect
15:41 sm hmm
15:41 maerwald imo, that's fine enough... I don't see why additional redirection magic is necessary
15:43 maerwald also, case-insensitive is already an implicit dep, just need it explicit now because of the import
15:44 maerwald or wait, the type system already figures it out, we can drop it
15:45 sm even better.. if you need it, a lower bound of 1.2.0.4 would be more compatible with stack-78.yaml
15:48 sm maerwald: it's not so nice to log out and see "Not Found .. Your request to someprivaterepo has resulted in an error: repository does not exist or is private"
15:48 maerwald sm: I don't see that as a problem, really
15:48 maerwald fixing it requires a lot of foo crap
15:48 sm still, I like the change, deploying
15:48 maerwald here is the latest http://hub.darcs.net/maerwald/darcsden-patches/patch/6fd18592f91f8393faecf6d02020b5af63fc8cd8
15:49 sm oh
15:49 maerwald to fix it, you'd basically need to interact _between_ handlers
15:49 maerwald I don't see how that is easily possible
15:50 maerwald they get called, process the session and then tell you if something is fishy
15:50 maerwald there's no error handling propagated
15:52 sm I hear you.. as a matter of curiousity it would seem odd if there isn't a reasonable way to achieve it, but we needn't worry about it
15:53 maerwald and afais, the specific handlers already do some redirection
15:54 maerwald if your session is invalid for the page
15:54 sm deployed your latest, thanks. Do you have permission to close the issue ?
15:55 maerwald seems so
15:56 maerwald so I think it comes down to fixing the specific handlers like "getRepoR"
15:56 maerwald it throws "notFoundPage" instead of redirecting, but that's maybe desired
15:56 sm not sure
15:57 sm ah, related - it would be awesome to have it keep the same location on login, too
15:59 Riastradh joined #darcs
16:00 maerwald sm: that's more tricky, since it redirects through two pages, so the referer info is lost
16:01 maerwald I wonder if we can modify the header
16:02 sm I'm just noticing all these issues you updated
16:30 pointfree Not sure if the "download .zip" feature should support TAGs or patch subsets before closing. I think it would be easy enough for me to do with some DarcsFlags http://hub.darcs.net/simon/darcsden/issue/40 question is the URI scheme...
17:05 pointfree When posting that issue I thought it would be nice to have anchor-permalinks to specific issue comments by clicking on the comment date. What would be a universal, but also somewhat user-friendly timestamp format for the anchor?
18:37 pointfree I've added a darcsden "annotate" icon for which there was none: http://www.0xffffffff.in/opds/darcs-stuff/annotate-icon.png awaiting any feedback...
18:38 pointfree http://hub.darcs.net/pointfree/darcsden-ui/patch/7730e742bbeae90f81245944b7f3e8198408b7f3
18:40 Big_G joined #darcs
19:06 Heffalump maerwald: re a cli-like API, makes sense, but then you wouldn't be able to pass in patch objects
19:08 maerwald I don't know what a patch object is and if I would, I'd probably use the low level functions, no?
19:11 Heffalump I mean like Named p
19:12 Heffalump the CLI just takes flags like --to-patch, --to-hash etc
19:23 sm pointfree: thanks! deployed
19:25 pointfree sm: yay!
19:34 sm wish: in the issues page, name the last commenter. "...about 2 hours ago by X"
19:35 maerwald pointfree: I'm almost done with tar.xz and tar.gz dist
19:36 * sm hopes tarball generation is cheap, and/or not too accessible to bots
19:54 pointfree maerwald: awesome!
19:54 pointfree maerwald: what does the UI look like for it?
19:54 maerwald that's where you come into play :D
19:55 pointfree maerwald: started!
19:58 maerwald pointfree: http://hub.darcs.net/maerwald/darcsden-dist/patch/7688d0182c938ed2f1de020f1fcf721055d365ba
20:00 maerwald removing the "_darcs" directory from the tar archive will be a bit tricky
20:00 maerwald and we don't want a tar bomb
20:01 maerwald so we cannot change the base directory to the repo dir
20:02 pointfree maerwald: Doesn't the "darcs dist" command already exclude the _darcs/ directory?
20:02 sm maerwald: you might need to conditionalise some deps to keep darcsden installable on windows
20:02 maerwald I don't use that command
20:03 sm s%deps%deps/code%
20:04 maerwald pointfree: and I want to avoid using darcs API for those functions
20:05 maerwald right now, it's pretty straight forward. the tar and gzip APIs are very easy
20:06 maerwald compress :: ByteString -> ByteString
20:07 maerwald that's how haskell API should look like :)
20:07 maerwald I remember how the same thing looks in C...
20:12 maerwald but I think I can fix that _darcs directory thing
20:14 pointfree Wow the patch deps graphical arrows on maerwald's darcsden branch are messy http://www.0xffffffff.in/opds/darcs-stuff/patch-deps-hairball.png I think it needs to look and function more like camp-view http://www.0xffffffff.in/opds/darcs-stuff/camp-view.png
20:15 maerwald lol
20:27 dixie__ joined #darcs
20:31 Riastradh joined #darcs
21:23 ilbot3 joined #darcs
21:23 Topic for #darcs is now http://darcs.net/ | logs: http://irclog.perlgeek.de/darcs/ | darcs 2.10.0 is out http://darcs.net/Releases/2.10
21:24 burp joined #darcs
21:26 Big_G joined #darcs
21:29 dixie_ joined #darcs
21:32 aristid joined #darcs
22:05 attila_lendvai joined #darcs
22:05 attila_lendvai hi! is there a way to disable the new final confirm question?
22:05 attila_lendvai I couldn't find anything
22:06 siel joined #darcs
22:41 ilbot3 joined #darcs
22:41 Topic for #darcs is now http://darcs.net/ | logs: http://irclog.perlgeek.de/darcs/ | darcs 2.10.0 is out http://darcs.net/Releases/2.10
22:44 lispy joined #darcs
22:54 aristid joined #darcs
22:54 Heffalump attila_lendvai: I don't think so, sorry :-(
22:54 attila_lendvai at first I tried to get used to it, but I feel protected form something that never bit me in the past decade of using darcs
22:56 sm attila_lendvai: likewise :)
22:56 Heffalump FWIW it has bitten me sometimes
22:57 attila_lendvai not me, probably because I was always in shell-level control over the repos I was using, so I could always go there and fix as needed
23:01 sm maerwald: I guess you are still here, but we are giving your notification system a good workout
23:01 maerwald :D
23:02 sm working great :)
23:02 sm maerwald++
23:02 sm I have to head out, all thoughts welcome on http://hub.darcs.net/simon/darcsden/issue/40
23:04 sm also loving hyperlinked urls
23:04 sm pointfree++
23:05 maerwald oh right, I was wondering
23:11 Heffalump am I automatically subscribed to issues on my own repos or anything? (I'm hoping yes)
23:12 maerwald Heffalump: mh
23:12 maerwald if you are the author then yes
23:12 maerwald if you comment on one too
23:12 maerwald if you are the repo owner, then... probably not
23:12 maerwald should be possible to implement
23:13 Big_G joined #darcs
23:13 maerwald Heffalump: can you add that to the issue here http://hub.darcs.net/simon/darcsden/issue/30 so it won't be forgotten
23:15 Heffalump done
23:58 lelit joined #darcs

| Channels | #darcs index | Today | | Search | Google Search | Plain-Text | summary