develop에 있는 것을 master에 merging(정확히 말하면 rebase) 하다가 failed가 되었다. conflict를 잡고 해결하는 팁을 정리.

 

(master) $ git rebase develop
First, rewinding head to replay your work on top of it...
Applying: changed db connections number.
Using index info to reconstruct a base tree...
<stdin>:15: trailing whitespace.
blah
<stdin>:27: trailing whitespace.
blah

<stdin>:28: trailing whitespace.
blah

warning: 3 lines add whitespace errors.
Falling back to patching base and 3-way merge...
Auto-merging 절대파일주소

CONFLICT (content): Merge conflict in 절대파일주소
Auto-merging 절대파일주소
CONFLICT (content): 절대파일주소
Failed to merge in the changes.
Patch failed at 0001 changed db connections number.

When you have resolved this problem run "git rebase --continue".
If you would prefer to skip this patch, instead run "git rebase --skip".
To check out the original branch and stop rebasing run "git rebase --abort".

 

 

  [git는 설명이 잘 되어 있어서 잘 눈여겨 봐야한다.]

 

((67cccd4...)|REBASE) $ git status
# Not currently on any branch.
# Unmerged paths:
#   (use "git reset HEAD <file>..." to unstage)
#   (use "git add/rm <file>..." as appropriate to mark resolution)
#
#       both modified:      절대파일 주소
#       both modified:      절대파일 주소
#
no changes added to commit (use "git add" and/or "git commit -a")

 


[eclipse에 eGit가 깔려있다면. 쉽게 확인 가능. conflct 난 소스 변경. diff로 볼 수 있다. ]

 

image

 

 

merging 작업을 실시한다.

 

$ git add .

 

$ git rebase --continue
Applying: changed db connections number.

 

$ git status
# On branch master
# Your branch and 'origin/master' have diverged,
# and have 4 and 1 different commit(s) each, respectively.
#
nothing to commit (working directory clean)

 

 

   [different commit 이 있다고 상세한 설명을 해준다. push가 아닌 commit을 먼저 해준다]

 

$ git commit
[master c863385] Merge branch 'master' of git 주소

 

$ git push
Counting objects: 18, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (8/8), done.
Writing objects: 100% (8/8), 1.13 KiB, done.
Total 8 (delta 3), reused 0 (delta 0)
remote: => Syncing Gitorious... [OK]
To git 주소
   9c6b980..c863385  master -> master

 

깔끔히 merging됨.

 

이제. develop도 똑같이 해서 master에 맞게 동기화 해줌.

Posted by '김용환'
,

 

텐키(tenki) 라는 일본 싸이트를 접속하면. 과거 24시간, 7일간, 30일간, 100일간 지진 정보를 볼 수 있다.

(bousai.tenki.jp)

 

 

http://bousai.tenki.jp/bousai/earthquake/seismicity_map/?area_type=japan_detail&recent_type=24hours

 

image

 

진도 정보와 위치 정보가 잘 나와있다.

 

이 웹의 밑에 보면 지난 하루동안 최고치를 친 지진 4.1을 보여준다. (3시간 전이었군..)

 

image

 

 

 

 

100일간 지전 정보를 모아서 보면, 쇼킹하다.. 일본 열도가 그려진다. 동일본 지역은 지진이 많이 일어나고 있다.

 

http://bousai.tenki.jp/bousai/earthquake/seismicity_map/?area_type=japan_detail&recent_type=100days

 

 

image

Posted by '김용환'
,

 

maven에서 리소스 파일복사를 지정하고 동일한 파일을 복사하다가 충돌이 나서 파일복사가 안되는 경우가 있다.

(결국 중복 파일 이슈)

 

그 때 –X 옵션을 이용해서 debug된 화면을 보면 다음과 같이 나온다.

 

파일이름 wasn't copied because it has already been packaged for overlay [currentBuild].

 

충돌을 잘 피할 수 있도록 exclude를 사용하면 문제를 회피할 수 있다.

 

 

 

 

예를 들어 아래 설정이 에러가 나는 상황이라고 가정한다.

src/conf/release 디렉토리에 ‘prop.properties’ 파일이 있고, src/conf/release/test 디렉토리에 ‘prop.properties’ 파일이 존재한다. pom.xml 파일을 빌드하면 복사가 안된다.

 

        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-war-plugin</artifactId>
                        <configuration>
                            <webappDirectory>${deploy.dir}</webappDirectory>
                            <ignoreWebxml>true</ignoreWebxml>
                            <webResources>
                                <resource>
                                    <directory>src/conf/release</directory>
                                    <targetPath>WEB-INF/classes</targetPath>
                                </resource>
                                <resource>
                                    <directory>src/conf/release/test</directory>
                                    <targetPath>WEB-INF/classes</targetPath>
                                </resource>
                            </webResources>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>

 

 

그래서, 복사하는 파일이 충돌할 경우 다음과 같이 따로 exclude로 빼서 파일 복사가 충돌 나지 않도록 설정하면 파일 복사가 원하는 대로 이루어진다. 즉, 기존 파일은 안쓰고, 새로운 디렉토리에 있던 파일을 복사해서 쓰도록 한다의 의미를 넣은 것이다.

 

 

         <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-war-plugin</artifactId>
                        <configuration>
                            <webappDirectory>${deploy.dir}</webappDirectory>
                            <ignoreWebxml>true</ignoreWebxml>
                            <webResources>
                                <resource>
                                    <directory>src/conf/release</directory>
                                    <targetPath>WEB-INF/classes</targetPath>
                                    <excludes>
                                        <exclude>prop.properties</exclude>
                                      </excludes>
                                </resource>
                                <resource>
                                    <directory>src/conf/release/test</directory>
                                    <targetPath>WEB-INF/classes</targetPath>
                                </resource>
                            </webResources>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
Posted by '김용환'
,




* git flow 설치 방식

http://knight76.tistory.com/entry/cygwin-%EC%97%90%EC%84%9C-git-flow-%EC%84%A4%EC%B9%98




git flow 설치 이후 쓸만한 예제를 올린다.



(1) 사례 1

remote에 develop가 없는 경우, develop에 먼저 작업을 한 후 문제가 없다면 master로 자동 merging 이 되게 하는 예제. 따로 rebase나 merge가 필요없음.



(develop) $ 


  [ 코딩 작업]


(develop) $ git add .

(develop) $ git commti -m '~~~'

(develop) $ git checkout master

(master) $ 

(master) $ git status

# On branch master

# Your branch is ahead of 'origin/master' by 1 commit.

#

nothing to commit (working directory clean)


(master) $ git pull

remote: Counting objects: 5, done.

remote: Compressing objects: 100% (5/5), done.

remote: Total 5 (delta 0), reused 0 (delta 0)

Unpacking objects: 100% (5/5), done.

From git주소

 * [new tag]         R201206101818 -> R201206101818

 * [new tag]         R201206101950 -> R201206101950

 * [new tag]         R201206112159 -> R201206112159

 * [new tag]         R201206112210 -> R201206112210

 * [new tag]         R201206121457 -> R201206121457

Already up-to-date.


  [master branch에 develop에 작업된 내용이 적용된 상태]


(master) $ git push



  [개발된 것 서버로 push됨]



(master) $ git checkout develop




(2) 사례 2


develop 을 remote에 push하고 사용하는 경우.  develop와 master가 완전히 따로 따로 작업한다. rebase (또는 merge) 작업을 통해서 진행한다. 



(develop) $ git push origin develop

 * [new branch]      develop -> develop


 [코딩 작업]


(develop) $ git add .

(develop) $ git commit -m 'blah blah'

(develop) $ git push




(develop) $ git checkout master

(master) $ 


(master) $ git pull

(master) $ git rebase develop



 [소스 보면서 잘 되었는지 확인]


(master) $ git push 

 

 

(3)사례 3

 

git flow에 있는 것처럼..

remote 에 develop 을 만든 상태에서 feature를 따고(start) feature를 develop에 잘 녹이게 하고. (finish)

develop에 잘 push한다.

 


(develop) $  git flow feature start feature-a
(feature-a) $

  [코딩 작업]

(feature-a) $  git flow feature finish feature-a

Summary of actions:
- The feature branch 'feature/feature-a' was merged into 'develop'
- Feature branch 'feature/feature-a' has been removed
- You are now on branch 'develop'

  [ 여기서 feauture는 develop 브랜치에 잘 녹여들고 완전히 사라진다. local 영역이라서 지워짐 ]

(develop) $ git checkout deveop
 
(develop) $ git push

 원격에 있는 develop 에 잘 정한다.  develop 브랜치를 가지고 beta 테스트를 해본다. ,


 

 







Posted by '김용환'
,


있으면 update하고, 없으면 insert 하는 mysql - Insert On Duplicate Key Update 구문에서..

update where, table name을 쓰지 말고, insert 하듯이 사용하면 됨.  

update 때문에 where, table 넣다가 삽질함. 



INSERT INTO template (

 channel_id,

 template_id,

 language,

 description

) VALUES (

 #{channelId},

 #{templateId},

 #{language},

 #{description}

) ON DUPLICATE KEY UPDATE

 description = #{description},

 channel_id = #{channelId}, 

 template_id = #{templateId},

 language= #{language} 






예제


insert into locationtag_scores (tag_name, write_uv) values ('111', 50), ('1111', 3) on duplicate key update tag_name = values(tag_name), read_pv = values(write_uv)



Posted by '김용환'
,

'scribbling' 카테고리의 다른 글

git flow 사용 예제 - develop와 master  (0) 2012.06.12
Mysql 의 Insert .. On Duplicate Key Update 유의사항  (0) 2012.05.31
log4jdbc mix  (0) 2012.05.17
lo4jdbc 사용시 log4j.xml 설정  (0) 2012.05.17
cygwin 에서 git flow 설치  (0) 2012.04.26
Posted by '김용환'
,

log4jdbc mix

scribbling 2012. 5. 17. 22:09

log4jdbc와 결합해서 쓰면 좋은 것 - log4jdbc mix

select 결과가 실감나게 나온다.

 

 <logger name="jdbc.resultsettable" additivity="false">  
   
<level value="info" />  
   
<appender-ref ref="console-log4jdbc" />  
 
</logger>

 

select * 
       
from EMP 
|------|-------|----------|-----|----------------------|-----|-----|-------| 
|EMPNO |ENAME  |JOB       |MGR  |HIREDATE              |SAL  |COMM |DEPTNO | 
|------|-------|----------|-----|----------------------|-----|-----|-------| 
|7369  |SMITH  |CLERK     |7902 |1980-12-17 00:00:00.0 |800  |null |20     | 
|7499  |ALLEN  |SALESMAN  |7698 |1981-02-20 00:00:00.0 |1600 |300  |30     | 
|7521  |WARD   |SALESMAN  |7698 |1981-02-22 00:00:00.0 |1250 |500  |30     | 
|7566  |JONES  |MANAGER   |7839 |1981-04-02 00:00:00.0 |2975 |null |20     | 
|7654  |MARTIN |SALESMAN  |7698 |1981-09-28 00:00:00.0 |1250 |1400 |30     | 
|7698  |BLAKE  |MANAGER   |7839 |1981-05-01 00:00:00.0 |2850 |null |30     | 
|7782  |CLARK  |MANAGER   |7839 |1981-06-09 00:00:00.0 |2450 |null |10     | 
|7788  |SCOTT  |ANALYST   |7566 |1987-04-19 00:00:00.0 |3000 |null |20     | 
|7839  |KING   |PRESIDENT |null |1981-11-17 00:00:00.0 |5000 |null |10     | 
|7844  |TURNER |SALESMAN  |7698 |1981-09-08 00:00:00.0 |1500 |0    |30     | 
|7876  |ADAMS  |CLERK     |7788 |1987-05-23 00:00:00.0 |1100 |null |20     | 
|7900  |JAMES  |CLERK     |7698 |1981-12-03 00:00:00.0 |950  |null |30     | 
|7902  |FORD   |ANALYST   |7566 |1981-12-03 00:00:00.0 |3000 |null |20     | 
|7934  |MILLER |CLERK     |7782 |1982-01-23 00:00:00.0 |1300 |null |10     | 
|------|-------|----------|-----|----------------------|-----|-----|-------|

 

 

http://code.google.com/p/log4jdbc-remix/

 

http://beyondj2ee.tumblr.com/post/14507640070/spring-powerful-sql

 

 

 

 

 

Posted by '김용환'
,

 

 

log4jdbc를 그냥 썼다가는 엄청 많은 로그 때문에 스트레스를 받을 수 있다.

소스 보면서 딱 필요한 설정만 해야 해서 아래와 같이 깔끔하게 설정하니. 딱 필요한 것만 나온다. 특히 쿼리 처리 시간 까지 체크해주면서 굿~

 

 

<logger name="java.sql" additivity="false">
  <level value="WARN" />
  <appender-ref ref="general" />
 </logger>
 <logger name="jdbc.audit" additivity="false">
  <level value="WARN" />
  <appender-ref ref="general" />
 </logger>
 <logger name="jdbc.resultset" additivity="false">
  <level value="WARN" />
  <appender-ref ref="general" />
 </logger>
 <logger name="jdbc.connection" additivity="false">
  <level value="WARN" />
  <appender-ref ref="general" />
 </logger>

 <logger name="log4jdbc.debug" additivity="false">
  <level value="WARN" />
  <appender-ref ref="general" />
 </logger>

 

 

Posted by '김용환'
,

 

 

 

1. http://github.com/nvie/gitflow/raw/develop/contrib/gitflow-installer.sh 에 접속해서 shell을 copy한다.

2. cygwin shell processing

$ cat > gitflow-installer.sh

(복사한 것을 복사하고 ctrl + D)
$ chmod 755 gitflow-installer.sh
$ ./gitflow-installer.sh
$ git flow

usage: git flow <subcommand>

Available subcommands are:
   init      Initialize a new git repo with support for the branching model.
   feature   Manage your feature branches.
   release   Manage your release branches.
   hotfix    Manage your hotfix branches.
   support   Manage your support branches.
   version   Shows version information.

Try 'git flow <subcommand> help' for details.

'scribbling' 카테고리의 다른 글

log4jdbc mix  (0) 2012.05.17
lo4jdbc 사용시 log4j.xml 설정  (0) 2012.05.17
Github 가입및 셋팅 & git 공부  (0) 2012.04.25
정규식 테스트할 수 있는 웹 싸이트  (0) 2012.04.20
Redis Collection 사용시 메모리 소요비용  (0) 2012.04.19
Posted by '김용환'
,

 

1. 가입 및 셋팅
참조 : http://www.jjpark.net/61

 

2. git 프로젝트 생성  (test)

 

3. git 파일 확인
git@github.com:아이디/test.git

 

4. test
(1) master 가지고 놀기
git clone git@github.com:아이디/test.git
vi README
git add REAME
git commit -m 'added README"
git push

 

(2) feature 생성하고 놀기
git checkout -b new-feature master
git add
git commit -a -m "haha"
git branch -l
git push origin new-feature


(3) merge
$ git checkout -b hotfix
$ vim a.txt
$ git commit -a -m 'added hotfix'

$ git checkout master
$ git merge hotfix
$ git status
$ git branch -d hotfix
$ git push


(4) rebase
$ git checkout new-feature
$ git rebase master
$ git push


* rebase와 merge에 대한 좋은 설명
http://blog.outsider.ne.kr/666

* git에 대한 좋은 책
pro git 

영문  http://progit.org/book/

한글 번역 http://dogfeet.github.com/progit/progit.ko.pdf

 

 

Posted by '김용환'
,