1. archer88i

    archer88i Contributor Contributor

    Joined:
    Apr 11, 2008
    Messages:
    514
    Likes Received:
    283

    Git outta here!

    Discussion in 'Software' started by archer88i, Aug 22, 2017.

    ...Eh, I thought the title was funny.

    I recently finished scene #13 in my wip. Obviously, because it was scene 13, things weren't going to go as planned. (If you aren't scared to death of the number 13, then... Well. I pity you. But back to our story.) I wound up deleting the last 1600 words of the scene and writing them over from scratch. Thing is, all the information in the original version is important, probably bound to be canon, and it was nice to know it. Normally, this would mean I'd need to keep a copy of the original scene around someplace in a scraps file, or at the bottom of the document, or... Wherever.

    This novel, however, is stored in a version control system called git, so I've already got a copy of the original scene as it was when it was committed, and I'm free to delete the thing and start over any time or any way I like. :)

    Quite pleased with that!
     
  2. surrealscenes

    surrealscenes Member

    Joined:
    Aug 9, 2017
    Messages:
    262
    Likes Received:
    175
    Location:
    a room made of impossible angles
    I thought this was going to be a rant about github. Drats, foiled again!
     
    archer88i likes this.
  3. Martin Beerbom

    Martin Beerbom Member

    Joined:
    Aug 31, 2016
    Messages:
    54
    Likes Received:
    16
    Speaking of git/github: I stumbled across https://www.penflip.com. As far as I understand, it's a graphical git frontend specifically designed for creative writing. Looks very interesting.
     
  4. archer88i

    archer88i Contributor Contributor

    Joined:
    Apr 11, 2008
    Messages:
    514
    Likes Received:
    283
    That sounds pretty neat, and it would be interesting to see if that can really make the whole distributed source control thing more accessible. Probably as a result of what I do for a living, I'm inclined to say that people should just learn to use the tool itself rather than have some other thing use it for them, but that may be a waste of time for most, huh. :)
     
  5. newjerseyrunner

    newjerseyrunner Contributor Contributor

    Joined:
    Apr 20, 2016
    Messages:
    726
    Likes Received:
    587
    I never realized fields other than software used git for stuff. Is it really all that helpful? I use git for source code that have millions of lines, but for smaller projects, I just use svn. The major advantage of git is that it's distributed, but that seems a little pointless for a personal project?

    Also, if you want a good GUI for version control, Tortoise seems to be becoming the standard.
     
  6. surrealscenes

    surrealscenes Member

    Joined:
    Aug 9, 2017
    Messages:
    262
    Likes Received:
    175
    Location:
    a room made of impossible angles
    The biggest impediment to getting 'regular' people to use github is the interface. Grab someone that does not use it & open a page and show it to them. probably 99% will look at you and say "Ok?". It makes no sense until you understand the hierarchy used to create the interface they use.
     
  7. archer88i

    archer88i Contributor Contributor

    Joined:
    Apr 11, 2008
    Messages:
    514
    Likes Received:
    283
    Well, full disclosure, I am a software engineer by trade. I don't even use a gui for git; I use the terminal. :p

    I think that it's very helpful, as a result of examples like the one I gave her. I also think distributed solutions like git or mercurial are probably preferable to centralized solutions like svn, owing to the fact that you can have the full repository on multiple machines and changes can be made independently on each.

    But I have never tried svn; closest I've come would have been the Microsoft solutions--TFS or source safe.
     
  8. archer88i

    archer88i Contributor Contributor

    Joined:
    Apr 11, 2008
    Messages:
    514
    Likes Received:
    283
    Not GitHub. Just git. But you hit the nail on the head: until you understand what is going on behind the scenes, almost none of this crap makes sense. That's why I was saying I think it's important to understand the tools rather than the gui.
     
  9. surrealscenes

    surrealscenes Member

    Joined:
    Aug 9, 2017
    Messages:
    262
    Likes Received:
    175
    Location:
    a room made of impossible angles
    That is the eternal struggle in every industry.
     
    archer88i likes this.
  10. Spacer

    Spacer Active Member

    Joined:
    Jan 13, 2011
    Messages:
    188
    Likes Received:
    10
    Location:
    Texas
    git has its full glory only if you use plain text files, or some kind of add-on to make it understand the document structure. What are you using to edit the files?
     
  11. archer88i

    archer88i Contributor Contributor

    Joined:
    Apr 11, 2008
    Messages:
    514
    Likes Received:
    283
    Visual Studio Code.
     
  12. Spacer

    Spacer Active Member

    Joined:
    Jan 13, 2011
    Messages:
    188
    Likes Received:
    10
    Location:
    Texas
    S0 you write as plain text? Possibly some light mark-up coding to indicate italics or paragraph styles?
     
  13. archer88i

    archer88i Contributor Contributor

    Joined:
    Apr 11, 2008
    Messages:
    514
    Likes Received:
    283
    I use Markdown formatting. That way I get italics and such without too much bother.
     
    Spacer likes this.
  14. Spacer

    Spacer Active Member

    Joined:
    Jan 13, 2011
    Messages:
    188
    Likes Received:
    10
    Location:
    Texas
    Nice. How do you get that into your typesetting program?
     
  15. archer88i

    archer88i Contributor Contributor

    Joined:
    Apr 11, 2008
    Messages:
    514
    Likes Received:
    283
    Part of that involves this script:

    #!/bin/zsh
    ls ./src/chapter_* | pubform "<name here>" | pandoc -o sacrifice.epub
    ls ./src/chapter_* | pubform "<name here>" | pandoc -o sacrifice.pdf​

    "pubform" is a program I wrote that accepts a list of filenames from standard input and then streams the contents of the files onto standard output. Before it spits out the files' contents, however, it first spits out some some headers that Pandoc uses for formatting a book, including the name of the book, the name of the author, etc.

    The final command in each pipeline instructs pandoc to emit a file based on the data it receives on standard input. Pandoc automatically detects that it is receiving markdown and, likewise, automatically detects that it is meant to emit an epub and a pdf, respectively. I didn't write pandoc. It's quite an impressive little piece of software.
     
    Spacer likes this.

Share This Page