Skip to content

Instantly share code, notes, and snippets.

@paulstatezny
Last active June 15, 2018 21:45
Show Gist options
  • Save paulstatezny/f7023f11f5f374e330bc to your computer and use it in GitHub Desktop.
Save paulstatezny/f7023f11f5f374e330bc to your computer and use it in GitHub Desktop.

Revisions

  1. paulstatezny revised this gist May 11, 2015. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion commit.fish
    Original file line number Diff line number Diff line change
    @@ -18,4 +18,5 @@ function commit
    set prefix "Refs #$issue - "
    end

    git commit -m "$prefix$message."
    git commit -m "$prefix$message."
    end
  2. paulstatezny revised this gist May 11, 2015. 1 changed file with 16 additions and 4 deletions.
    20 changes: 16 additions & 4 deletions commit.fish
    Original file line number Diff line number Diff line change
    @@ -1,9 +1,21 @@
    # Prefix commit message with "Refs #[PULL_NUMBER] - "
    # PULL_NUMBER is derived from the branch name, which is assumed to be in the format: "something/[PULL_NUMBER]-short-descriptive-name"
    # PULL_NUMBER is derived from the branch name, which is assumed to be in one of the following formats:
    # something/[PULL_NUMBER]-short-descriptive-name
    # something/[GROUP_NUMBER]/[PULL_NUMBER]-short-descriptive-name

    function commit
    set issue (git rev-parse --abbrev-ref HEAD | cut -d / -f 2 | cut -d - -f 1)
    set issue (git rev-parse --abbrev-ref HEAD | cut -d / -f 3 | cut -d - -f 1 | grep "^\d*\$")
    set message $argv[1]
    set prefix "Refs #"

    git commit -m "Refs #$issue - $message."
    end
    if [ "$issue" = "" ]
    set issue (git rev-parse --abbrev-ref HEAD | cut -d / -f 2 | cut -d - -f 1 | grep "^\d*\$")
    end

    if [ "$issue" = "" ]
    set prefix ""
    else
    set prefix "Refs #$issue - "
    end

    git commit -m "$prefix$message."
  3. paulstatezny revised this gist Jul 28, 2014. 1 changed file with 1 addition and 6 deletions.
    7 changes: 1 addition & 6 deletions commit.fish
    Original file line number Diff line number Diff line change
    @@ -1,10 +1,5 @@
    # Prefix commit message with "Refs #[PULL_NUMBER] - "
    # PULL_NUMBER is derived from the branch name, which is assumed to be in the format: "something/[PULL_NUMBER]-short-descriptive-name"
    #
    # Example:
    # Branch name: feature/123-add-profile-pic
    # Usage : commit 'Add initial unit test'
    # Result : git commit -m 'Refs #123 - Add initial unit test.'
    # PULL_NUMBER is derived from the branch name, which is assumed to be in the format: "something/[PULL_NUMBER]-short-descriptive-name"

    function commit
    set issue (git rev-parse --abbrev-ref HEAD | cut -d / -f 2 | cut -d - -f 1)
  4. paulstatezny revised this gist Jul 28, 2014. 1 changed file with 8 additions and 0 deletions.
    8 changes: 8 additions & 0 deletions commit.fish
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,11 @@
    # Prefix commit message with "Refs #[PULL_NUMBER] - "
    # PULL_NUMBER is derived from the branch name, which is assumed to be in the format: "something/[PULL_NUMBER]-short-descriptive-name"
    #
    # Example:
    # Branch name: feature/123-add-profile-pic
    # Usage : commit 'Add initial unit test'
    # Result : git commit -m 'Refs #123 - Add initial unit test.'

    function commit
    set issue (git rev-parse --abbrev-ref HEAD | cut -d / -f 2 | cut -d - -f 1)
    set message $argv[1]
  5. paulstatezny revised this gist Jul 28, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion commit.fish
    Original file line number Diff line number Diff line change
    @@ -2,5 +2,5 @@ function commit
    set issue (git rev-parse --abbrev-ref HEAD | cut -d / -f 2 | cut -d - -f 1)
    set message $argv[1]

    echo "git commit -m 'Refs #$issue - $message.'"
    git commit -m "Refs #$issue - $message."
    end
  6. paulstatezny created this gist Jul 28, 2014.
    6 changes: 6 additions & 0 deletions commit.fish
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    function commit
    set issue (git rev-parse --abbrev-ref HEAD | cut -d / -f 2 | cut -d - -f 1)
    set message $argv[1]

    echo "git commit -m 'Refs #$issue - $message.'"
    end