Skip to content
This repository was archived by the owner on Aug 24, 2024. It is now read-only.

Commit d2394eb

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents 3f03704 + 2b51558 commit d2394eb

File tree

9 files changed

+793
-2
lines changed

9 files changed

+793
-2
lines changed

.github/FUNDING.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# These are supported funding model platforms
2+
3+
open_collective: git-bug

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
git-bug-migration
2+
.gitkeep
3+
dist
4+
coverage.txt
5+
.idea/

.travis.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
matrix:
2+
include:
3+
- language: go
4+
go: 1.12.x
5+
- language: go
6+
go: 1.13.x
7+
- language: go
8+
go: 1.14.x
9+
10+
env:
11+
GO111MODULE=on
12+
13+
install:
14+
- make install
15+
16+
script:
17+
- make test
18+
19+
before_install:
20+
- go get github.com/mitchellh/gox
21+
22+
after_success:
23+
- if [ ! -z "$TRAVIS_TAG" ]; then make releases; fi
24+
25+
deploy:
26+
provider: releases
27+
skip_cleanup: true
28+
api_key:
29+
secure: fLW37YkuY7KhVGpS6kgAAZPxgnePkLJG6AhWArOdVjgF0LMpps3PdvmfLkt+UUwjN0B+7l5NZSNU6c7F7R9AtJG5sfI7glFYxhQj3SdDr3rJCM1jqiJoCpkMGNHaJXsuGN1T/fWyfhHkhhyucbPv0d16llOsw98h7dIR1tCEFqMbfyA2G0182uKlOgZ/cjQGTRvU2hFgRpVHWCPcZkG+d0anLyCHtECXAwVQO5cijwNa4a7BEvIIYKRK6/j/GTrn9SqTisww3n1wxaItmEL91HbR6oqKrU9lUCJ6dTI/3JszKfLxrxGSSmwgtxa2tccV8AfmiqMXk4dISsHWwMthFzCp+I0htbdm5d1hbx9Jfq+5zJjV5Vka5ewfpWwSMOKkZpsEspjSy7iQPLk8IvkDq8t7NQ8kU2j5Z//nEEFa1Rym+sWsKhzas6fs09hv5V9p5iCU0bCnrncavhD6u1NN6FaYlZtBz8a0p2SyOrgW2Yglg37IKsZPW805e+6L7L515+jQ5OkdbrGsHr9ko3YG0OX1UkMfJ7ntQXfNeADHP90TmML8t7t+O8pNFFRiQUDPO0rbytXwneQoE/Jhdmj10Rhqi/OEm5A5uV5smItc7eg2OE6lBWYOeIQyGpQrh6eTx9cO+osX0o5ROMr4IVhJ0e/rRuR+PCm/2f8JUzHAfsk=
30+
file_glob: true
31+
file: dist/**/*
32+
on:
33+
repo: MichaelMure/git-bug-migration
34+
go: 1.14.x
35+
tags: true

LICENSE

Lines changed: 674 additions & 0 deletions
Large diffs are not rendered by default.

Makefile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
all: build
2+
3+
GIT_COMMIT:=$(shell git rev-list -1 HEAD)
4+
GIT_LAST_TAG:=$(shell git describe --abbrev=0 --tags)
5+
GIT_EXACT_TAG:=$(shell git name-rev --name-only --tags HEAD)
6+
7+
LDFLAGS:=-X 'main.GitCommit=${GIT_COMMIT}' \
8+
-X 'main.GitLastTag=${GIT_LAST_TAG}' \
9+
-X 'main.GitExactTag=${GIT_EXACT_TAG}'
10+
11+
build:
12+
go build -ldflags "$(LDFLAGS)" .
13+
14+
install:
15+
go install -ldflags "$(LDFLAGS)" .
16+
17+
releases:
18+
gox -ldflags "$(LDFLAGS)" -output "dist/{{.Dir}}_{{.OS}}_{{.Arch}}"
19+
20+
test:
21+
go test -v -bench=. ./...
22+
23+
.PHONY: build install releases test

Readme.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<h1 align="center">git-bug-migration</h1>
2+
3+
<div align="center">
4+
5+
[![Build Status](https://travis-ci.com/MichaelMure/git-bug-migration.svg?branch=master)](https://travis-ci.org/MichaelMure/git-bug-migration)
6+
[![Backers on Open Collective](https://opencollective.com/git-bug/backers/badge.svg)](#backers)
7+
[![Sponsors on Open Collective](https://opencollective.com/git-bug/sponsors/badge.svg)](#sponsors)
8+
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3+-blue.svg)](http://www.gnu.org/licenses/gpl-3.0)
9+
[![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/the-git-bug/Lobby)
10+
11+
</div>
12+
13+
`git-bug-migration` is a tool to migrate `git-bug` data stored in git repository to a newer format when breaking changes are made in `git-bug`.
14+
15+
[git-bug](https://github.com/MichaelMure/git-bug) is a distributed bug tracker embedded in git.
16+
17+
## Installation
18+
19+
Pre-compiled binaries are available in the [release page](https://github.com/MichaelMure/git-bug-migration/releases/latest)
20+
21+
## Usage
22+
23+
1. Make a backup copy of your repository
24+
1. Run `git-bug-migration` from within the repository
25+
26+
## License
27+
28+
Unless otherwise stated, this project is released under the [GPLv3](LICENSE) or later license © Michael Muré.

commands/migrate.go

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,35 @@
11
package commands
22

33
import (
4-
mg1 "github.com/MichaelMure/git-bug-migration/migration1"
4+
"fmt"
5+
56
"github.com/spf13/cobra"
7+
8+
mg1 "github.com/MichaelMure/git-bug-migration/migration1"
69
)
710

11+
// These variables are initialized externally during the build. See the Makefile.
12+
var GitCommit = "unset"
13+
var GitLastTag = "unset"
14+
var GitExactTag = "unset"
15+
816
func runMigrateCmd(_ *cobra.Command, _ []string) error {
17+
// TODO: might be nicer under a --version flag
18+
fmt.Printf("%s version %s\n\n", rootCommandName, version())
919
return mg1.Migrate01(repo)
1020
}
1121

22+
func version() string {
23+
if GitExactTag == "undefined" {
24+
GitExactTag = ""
25+
}
26+
version := GitLastTag
27+
if GitExactTag == "" {
28+
version = fmt.Sprintf("%s-dev-%.10s", version, GitCommit)
29+
}
30+
return version
31+
}
32+
1233
var migrateCmd = &cobra.Command{
1334
Use: "migrate",
1435
Short: "Migrate the repository to the newest version.",

main.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package main
22

3-
import "github.com/MichaelMure/git-bug-migration/commands"
3+
import (
4+
"github.com/MichaelMure/git-bug-migration/commands"
5+
)
46

57
func main() {
68
commands.Execute()
File renamed without changes.

0 commit comments

Comments
 (0)