Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

*: added pre-commit hook. #3112

Merged
merged 8 commits into from
Apr 24, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ LDFLAGS += -X "github.com/pingcap/tidb/util/printer.TiDBGitHash=$(shell git rev-

TARGET = ""

.PHONY: all build update parser clean todo test gotest interpreter server dev benchkv benchraw check parserlib
.PHONY: all build update parser clean todo test gotest interpreter server dev benchkv benchraw check parserlib precommithook

default: server buildsucc
default: server buildsucc precommithook
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please do not add it in default.


buildsucc:
@echo Build TiDB Server successfully!
Expand Down Expand Up @@ -140,3 +140,7 @@ endif
glide vc --only-code --no-tests
mkdir -p _vendor
mv vendor _vendor/src

precommithook:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As comments are added in the pre-commit file, this is redundant.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One time job should not be added to Makefile.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DONE

ln -s hooks/pre-commit .git/hooks/
chmod +x .git/hooks/pre-commit
7 changes: 7 additions & 0 deletions hooks/pre-commit
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
#!/bin/bash
# This file modified from k8s
# https://github.com/kubernetes/kubernetes/blob/master/hooks/pre-commit

# How to use this hook?
# ln -s hooks/pre-commit .git/hooks/
# In case hook is not executable
# chmod +x .git/hooks/pre-commit

readonly reset=$(tput sgr0)
readonly red=$(tput bold; tput setaf 1)
Expand Down
2 changes: 1 addition & 1 deletion plan/decorrelate.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (

// extractCorColumnsBySchema only extracts the correlated columns that match the outer plan's schema.
// e.g. If the correlated columns from inner plan are [t1.a, t2.a, t3.a] and outer plan's schema is [t2.a, t2.b, t2.c],
// only [t2.a] is treated as this apply's correlated column.
// only [t2.a] is treated as this applies correlated column.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unrelated change.

func (a *LogicalApply) extractCorColumnsBySchema() {
schema := a.children[0].Schema()
corCols := a.children[1].(LogicalPlan).extractCorrelatedCols()
Expand Down