<commit_before>//
//  ViewController.swift
//  GitLog
//
//  Created by KyXu on 2017/7/14.
//  Copyright © 2017年 KyXu. All rights reserved.
//

import Cocoa

class ViewController: NSViewController {

    @IBOutlet var projDirField: NSTextField!
    @IBOutlet var authorNameField: NSTextField!
    @IBOutlet var consoleTextView: NSTextView!
    
    // MARK: - Life Cycle
    override func viewDidLoad() {
        super.viewDidLoad()
    }

    override var representedObject: Any? {
        didSet {
        // Update the view, if already loaded.
        }
    }
    
    
    // MARK: - IBAction
    @IBAction func browseDir(_ sender: Any) {
        let openPanel = NSOpenPanel()
        openPanel.allowsMultipleSelection = false
        openPanel.canChooseDirectories = true
        openPanel.canCreateDirectories = true
        openPanel.canChooseFiles = true
        openPanel.begin { (result) in
            if result == NSFileHandlingPanelOKButton, let path = openPanel.url?.path {
                self.projDirField.stringValue = path
            }
        }
    }
    
    
    @IBAction func generate(_ sender: Any) {
        let log = cd(projDirField.stringValue)
            .bash(command: "git",
                  arguments: ["log","--since","'5 days ago'","--oneline","--author",authorNameField.stringValue])
        consoleTextView.string = log
    }
}
<commit_msg>generate pretty git log success<commit_after>//
//  ViewController.swift
//  GitLog
//
//  Created by KyXu on 2017/7/14.
//  Copyright © 2017年 KyXu. All rights reserved.
//

import Cocoa

class ViewController: NSViewController {

    @IBOutlet var projDirField: NSTextField!
    @IBOutlet var authorNameField: NSTextField!
    @IBOutlet var consoleTextView: NSTextView!
    
    // MARK: - Life Cycle
    override func viewDidLoad() {
        super.viewDidLoad()
    }

    override var representedObject: Any? {
        didSet {
        // Update the view, if already loaded.
        }
    }
    
    
    // MARK: - IBAction
    @IBAction func browseDir(_ sender: Any) {
        let openPanel = NSOpenPanel()
        openPanel.allowsMultipleSelection = false
        openPanel.canChooseDirectories = true
        openPanel.canCreateDirectories = true
        openPanel.canChooseFiles = true
        openPanel.begin { (result) in
            if result == NSFileHandlingPanelOKButton, let path = openPanel.url?.path {
                self.projDirField.stringValue = path
            }
        }
    }
    
    
    @IBAction func generate(_ sender: Any) {
        let output = cd(projDirField.stringValue).bash(command: "git",
                                                    arguments: ["log",
                                                                "--since='7 days ago'",
                                                                "--oneline",
                                                                "--author=\(authorNameField.stringValue)",
                                                                "--pretty=format:* %s"])
        consoleTextView.string = output
    }
}

{'fraction_non_alphanumeric': 0.0946515397082658, 'fraction_numerical': 0.007779578606158833, 'mean_word_length': 1.6376068376068376, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '649639', 'n_tokens_mistral': 862, 'n_tokens_neox': 806, 'n_words': 198}