Giter Club home page Giter Club logo

git-octopus's People

Contributors

adericbourg avatar apflieger avatar benba avatar dbaeli avatar dubreuia avatar gdigugli avatar geofberard avatar hvi avatar hvihvi avatar mathieubolla avatar ozangunalp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

git-octopus's Issues

Conflict information between two branches

I am trying to use octopus script. My script tries to merge several branch named "PLD*". When a conflict occurs between master and another branch, I have the detail of the conflict... But when it is a conflict between 2 branches, I have not the information of the "from branch".

Do you know how to get information or what's is the problem ?

Help appreciated !

Uncommitted changes after git octopus execution (version 2.0)

Sometimes when we execute git octopus on multiple branches (3 in this example) the merge is apparently successful but some commits are not present in the git log, instead there are the corresponding changes uncommitted in the working copy.

Step to reproduce the bug:

First we prepare the repository:

mkdir mergebug/
cd mergebug/
git init
touch test
git add test
git commit -a -m "commit test"
git checkout -b qa
git checkout -b feature/test
touch testFeature
git add testFeature
git commit -a -m "add testFeature"
git checkout master

Then we execute git octopus to merge the 3 branches:

git octopus feature/* qa

2 branches (I)ncluded (2 matching, 0 (E)xcluded):
I  refs/heads/feature/test
I  refs/heads/qa

Fast-forwarding to: refs/heads/feature/test
Already up-to-date with refs/heads/qa

We expect to have the "add testFeature" commit in the log but git log will show only the first commit:

git log --oneline --decorate

dfc4c37 (HEAD -> master, qa) commit test

And git status will show the uncommitted file:

git status

On branch master
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

	new file:   testFeature

shouldn't be installed to /usr/local

If you install git-octopus to /usr/local jenkins won't be able to find the executable. Symlinking/moving the bin to /usr/bin/ will solve the problem.

Provide different branch ordering

Our project needs certain branches merged before others, is there any way to tell octopus to merge branch FEATURE/Y first, then FEATURE/Z ?

Incorrect usage of git unpack-file and merge-file

I don't know why, but while executing git octopus I get the following error. It doesn't break anything and the execution continues. It seems to happen on a .xls which git sees as a binary file

Trying simple merge with refs/remotes/features/AMX-11904_Assu2000_integration_F115
Simple merge did not work, trying automatic merge.
Auto-merging third-party/product-catalog/formules/src/main/resources/com/lesfurets/pc/auto/Formules_Assu2000.xls
error: Cannot merge binary files: .merge_file_Wth4IY
ERROR: content conflict in third-party/product-catalog/formules/src/main/resources/com/lesfurets/pc/auto/Formules_Assu2000.xls
fatal: merge program failed
Applying conflict resolution 71853c6197a6a7f222db0f1978c7cb232b87c5ee
usage: git unpack-file <sha1>
usage: git unpack-file <sha1>
usage: git unpack-file <sha1>
usage: git merge-file [<options>] [-L <name1> [-L <orig> [-L <name2>]]] <file1> <orig-file> <file2>

    -p, --stdout          send results to standard output
    --diff3               use a diff3 based merge
    --ours                for conflicts, use our version
    --theirs              for conflicts, use their version
    --union               for conflicts, use a union version
    --marker-size <n>     for conflicts, use this marker size
    -q, --quiet           do not warn about conflicts
    -L <name>             set labels for file1/orig-file/file2

usage: git unpack-file <sha1>
usage: git merge-file [<options>] [-L <name1> [-L <orig> [-L <name2>]]] <file1> <orig-file> <file2>

    -p, --stdout          send results to standard output
    --diff3               use a diff3 based merge
    --ours                for conflicts, use our version
    --theirs              for conflicts, use their version
    --union               for conflicts, use a union version
    --marker-size <n>     for conflicts, use this marker size
    -q, --quiet           do not warn about conflicts
    -L <name>             set labels for file1/orig-file/file2

Conflict not resolved
diff --cc third-party/product-catalog/formules/src/main/resources/com/lesfurets/pc/auto/Formules_Assu2000.xls
index ff53054,fe68524..0000000
Binary files differ

Create a Jenkins Template ready to use (French description)

FRENCH REQUEST REPORTED ON THE MAILING LIST (to translate)

J'effectue en ce moment une évaluation de Git Octopus :)
J'essaie notamment de l'intégrer le mieux possible dans notre processus de delivery (basé sur le trio Bitbucket/Jenkins/Chef).

Est-ce qu'il y a un template pour un job Jenkins qui effectue l'ensemble des actions nécessaires ?
En effet, j'ai l'impression qu'il me manque certaines commandes / options pour :

  • le cleanup du workspace (options du plugin Git de Jenkins)
  • fetch des branches remotes
  • git octopus origin/features/* origin/octopus
  • mise en forme des conflits dans un report (capture dans la console ?)

Je suis preneur de vos conseils pour m'assurer que j'utilise bien correctement Git Octopus

Directory 'bin' missing

I try to go to test directory, to run 1 test like this : ./run_test.sh simple_test but the ../bin is missing. Idem for run_all.sh. Thanks

shasum equivalent for windows ?

Hi there !
Just read quickly the docs and noticed that you were mentionning installation on windows required having a shasum installed. Does this even exist on windows ?
Have you tried this tool on windows already ? (Im not on windows myslef, but sometimes, adoption can rely on a more windows friendly tool !)

Also, I just read on StackOverFlow that there was a cksum equivalent named CertUtil. Have you tried it ?
http://stackoverflow.com/questions/12276426/windows-equivalent-of-linux-cksum-command

(in case you plan to ensure windows support)

Migrate the project to a proper language

Needs

  • Better testability. For instance, I would like to mesure test coverage.
  • Get some abstractions because bash is just a mess.
  • Something easier to debug and develop

constrains

The biggest constraint is that people are currently using git-octopus on various OS : macOS, ubuntu, Windows... If we want to use a compiled language, would it be easy to distribute binaries ?

I'm considering python3 with pygit2 for git stuff.

Don't hesitate to give opinions :)

Mecanism for excluding branches from the octopus

Usecases :

  1. In some configuration, all branches of a repo are merged in a octopus. For instance, having multiple repos, one of them called 'features', is a good practice. The resulting merge of the 'features' repo can't be pushed on the repo itself because it would be taken itself in a subsequent octopus merge. The workaround is to push the merge on a separate repo (this is what LesFuets.com does).
  2. A developper pushed his branch and broke the octopus merge. He tries to fix it on his local repo. To do so, he commits changes on his local branch and run git octopus locally to test if it fixes the merge. The problem is that this local octopus will include the remote branch as well as the local one, which causes conflicts in most cases. The only workaround we have currently is to delete the remote branch locally with git update-ref -d refs/remotes/origin/branch_name before running the local octopus.

In both cases, we just need to exclude a given branch from the merge. We need to consider both usecases for finding an elegant solution.

I came up with some ideas. First thing is that in both cases, we would expect the exclusion to be done everytime the command is run. So it should be declarable in configuration.

Proposal:

  1. Allow a new syntax that negate branch pattern : !branche-to-exclude or even !branch-*. This would work as both command argument and configuration entry.

  2. Allow git octopus to detect and exclude automatically the remote branch that correspond to the local branch you are on. This behavior itself should be configurable (conf key octopus.exclude) with the following values :

    • none (default): don't detect the remote branch
    • current: exclude branches that have the same name that the current local branch
    • upstream: read the upstream configuration of the current local branch. I'm not sure if this value is needed but maybe just for consistency/transparency on how it works internally.
    • pushDefault: automatically choose between none, current and upstream depending on the value of the push.default config (see git-config push.default section). This could be the default value on the next major release of git-octopus. Here's the mapping between push.default values and the resulting remote detection:
      • nothing : none
      • current : current
      • upstream : upstream
      • simple : current or upstream. The latter is the safest because it will match the remote part of the ref which is not possible in the current mode. See bellow.
      • matching : I'm not sure, probably none

    We need to choose the behavior of the current value regarding remotes. git push uses the notion of 'remote' whereas git octopus doesn't. This means that in the current mode, we are not able to determine the remote part of the ref (of the remote branch we are looking for) in the context of a git octopus run. I don't think it is a big deal, let's just trip off refs/heads/ of the current branch ref, grep it on the list of branches beeing merged and exclude the result.

Note that 1. and 2. could be implemented seperately

git-octopus doesn't detect "already up to date" merges

Reproduction :

  • git checkout -b temp origin/master
  • git octopus origin/master

A new commit is created, having the same tree as origin/master (no diffs).
We would expect git-octopus to not create a commit here.

Note that if a single branch is provided and is fast-forward from HEAD, git-octopus currently behaves like git merge --no-ff which is fine

Unable to find common commit

Hi,

When i'm running git octopus origin/features/* origin/master i get the following error: Unable to find common commit with refs/remotes/origin/features/<branch>

Tree is as follow:
screen shot 2017-04-05 at 12 15 15

Is there anyway to fix this, and making the octopus merge succeed?

Multiple fast-forward error

Hi, we have seen that when we have multiple branches that are in the same path and modify the same file the fast-forward does not work correctly.

In this case we have a branch feature1 that modify the file testEntry and the feature2 branched from feature1 that modify the same file. The tree is pretty straightforward:

feature2
|
feature1
|
master

But when we launch git-octopus and we have the following error:

Fast-forwarding to: refs/remotes/origin/feature1
Fast-forwarding to: refs/remotes/origin/feature2
2017/07/06 12:52:09 error: Entry 'testEntry' would be overwritten by merge. Cannot merge.

I added a branch multiple_fast_forward with a test TestTwoBranchesFastForward to try to reproduce the bug.
Thanks
Andrea

Octopus duplicate parent error

Hi, we have found a problem with git octopus in our environment, when we have one branch that is aligned with master and at least one that is not.

In this case git octopus return a success but the merge is not done and a "duplicate parent error" appears.

Here how to reproduce the problem:

  • first we prepare the repository
mkdir gitOctopusMergeIssue
cd gitOctopusMergeIssue/
git init
echo "line1" > testFile
git add testFile
git commit -m"Add first file"
git checkout -b feature1
git checkout -b feature2
echo "line2" >> testFile
git commit -am"Add line2"
  • then we launch git octopus from master
git checkout master
git octopus feature1 feature2
Branches beeing merged :
	refs/heads/feature1
	refs/heads/feature2
-----------------------------------------------------------
Already up-to-date with refs/heads/feature1
Fast-forwarding to: refs/heads/feature2
error: duplicate parent 78924a5b99166dd6c4f73ec6f95a9232c4c752f6 ignored
-----------------------------------------------------------
OCTOPUS SUCCESS
  • we see that the merge has not been done even if git octopus return a SUCCESS
cat testFile 
line1
  • "line2" from branch feature2 is missing

Octopus success despite of `git-write-tree` error

When running git octopus on two branches, with some specific conditions I could not be able to describe (at least 2 branches almost identical with just the first commit changing), we get this output:

fatal: git-write-tree: error building trees
error: duplicate parent e9ca7d1ff89e6045e6a565c8be411a17725ac075 ignored
fatal: 9942d5360000000068735f5900000000b4a3f324 is not a valid object
usage: git update-ref [options] -d <refname> [<oldval>]
   or: git update-ref [options]    <refname> <newval> [<oldval>]
   or: git update-ref [options] --stdin [-z]

    -m <reason>           reason of the update
    -d                    delete the reference
    --no-deref            update <refname> not the one it points to
    -z                    stdin has NUL-terminated arguments
    --stdin               read updates from stdin

-----------------------------------------------------------
OCTOPUS SUCCESS

The result of the octopus is pretty weird: it contains only one of the conflicting branches.
Using octopus 1.4.

I would expect an error from the octopus. It seems this bug is not reproducible in every environment. Hard to guess why.

proper use of conflict resolution ?

Hi, I'm a bit confused on the proper way to resolve conflicts.

I am merging 9 branches and there is a conflict between two. I created a conflict resolution using git conflict but octopus still fails unless i specify the resolution ref in my command line arguments:

$ git octopus origin/myproject/FEATURE-* origin/myproject/base
Branches beeing merged :
	refs/remotes/origin/myproject/FEATURE-1
	refs/remotes/origin/myproject/FEATURE-2
	refs/remotes/origin/myproject/FEATURE-3
	refs/remotes/origin/myproject/FEATURE-4
	refs/remotes/origin/myproject/FEATURE-5
	refs/remotes/origin/myproject/FEATURE-6
	refs/remotes/origin/myproject/FEATURE-7
	refs/remotes/origin/myproject/FEATURE-8
	refs/remotes/origin/myproject/base
-----------------------------------------------------------
Fast-forwarding to: refs/remotes/origin/myproject/FEATURE-1
Trying simple merge with refs/remotes/origin/myproject/FEATURE-2
Trying simple merge with refs/remotes/origin/myproject/FEATURE-3
Trying simple merge with refs/remotes/origin/myproject/FEATURE-4
Trying simple merge with refs/remotes/origin/myproject/FEATURE-5
Simple merge did not work, trying automatic merge.
Auto-merging lib/moodlelib.php
Trying simple merge with refs/remotes/origin/myproject/FEATURE-6
Simple merge did not work, trying automatic merge.
Auto-merging lib/moodlelib.php
Auto-merging lib/setuplib.php
ERROR: content conflict in lib/setuplib.php
Added local/filestorage/classes/file_storage/file_system.php in both, but differently.
ERROR: content conflict in local/filestorage/classes/file_storage/file_system.php
Added local/filestorage/lang/en/local_filestorage.php in both, but differently.
ERROR: content conflict in local/filestorage/lang/en/local_filestorage.php
Added local/logging/classes/logger.php in both, but differently.
ERROR: content conflict in local/logging/classes/logger.php
Added local/logging/classes/monolog/fluenthandler.php in both, but differently.
ERROR: content conflict in local/logging/classes/monolog/fluenthandler.php
Added local/logging/db/tasks.php in both, but differently.
ERROR: content conflict in local/logging/db/tasks.php
Added local/logging/lang/en/local_logging.php in both, but differently.
ERROR: content conflict in local/logging/lang/en/local_logging.php
Added local/logging/version.php in both, but differently.
ERROR: content conflict in local/logging/version.php
fatal: merge program failed
Applying conflict resolution 069594f00ab6213b53e1bc2c37305c812223c12d
Trying simple merge with refs/remotes/origin/myproject/FEATURE-7
fatal: You need to resolve your current index first
-----------------------------------------------------------
Testing merges one by one with myproject/base...

merging refs/remotes/origin/myproject/FEATURE-1 ... SUCCESS
merging refs/remotes/origin/myproject/FEATURE-2 ... SUCCESS
merging refs/remotes/origin/myproject/FEATURE-3 ... SUCCESS
merging refs/remotes/origin/myproject/FEATURE-4 ... SUCCESS
merging refs/remotes/origin/myproject/FEATURE-5 ... SUCCESS
merging refs/remotes/origin/myproject/FEATURE-6 ... SUCCESS
merging refs/remotes/origin/myproject/FEATURE-7 ... SUCCESS
merging refs/remotes/origin/myproject/FEATURE-8 ... SUCCESS
-----------------------------------------------------------
No conflicts found between myproject/base and the rest of the branches
OCTOPUS FAILED

If i use the conflict reference ID it works, but the documentation indicates that this isn't required, or is it ??

$ git octopus origin/myproject/FEATURE-* origin/myproject/base 069594f00ab6213b53e1bc2c37305c812223c12d
Branches beeing merged :
	refs/conflicts/069594f00ab6213b53e1bc2c37305c812223c12d
	refs/remotes/origin/myproject/FEATURE-1
	refs/remotes/origin/myproject/FEATURE-2
	refs/remotes/origin/myproject/FEATURE-3
	refs/remotes/origin/myproject/FEATURE-4
	refs/remotes/origin/myproject/FEATURE-5
	refs/remotes/origin/myproject/FEATURE-6
	refs/remotes/origin/myproject/FEATURE-7
	refs/remotes/origin/myproject/FEATURE-8
	refs/remotes/origin/myproject/base
-----------------------------------------------------------
Fast-forwarding to: refs/conflicts/069594f00ab6213b53e1bc2c37305c812223c12d
Already up-to-date with refs/remotes/origin/myproject/FEATURE-1
Already up-to-date with refs/remotes/origin/myproject/FEATURE-2
Already up-to-date with refs/remotes/origin/myproject/FEATURE-3
Already up-to-date with refs/remotes/origin/myproject/FEATURE-4
Already up-to-date with refs/remotes/origin/myproject/FEATURE-5
Already up-to-date with refs/remotes/origin/myproject/FEATURE-6
Trying simple merge with refs/remotes/origin/myproject/FEATURE-7
Trying simple merge with refs/remotes/origin/myproject/FEATURE-8
Simple merge did not work, trying automatic merge.
Auto-merging auth/db/auth.php
Auto-merging user/lib.php
Already up-to-date with refs/remotes/origin/myproject/base
error: duplicate parent f851201f58662264ad7864dbbf8e2240ce7bf84a ignored
-----------------------------------------------------------
OCTOPUS SUCCESS

Provide RPM and DEB packaging

I work for Kelkoo. We would like to use this project, but we need to repackage with rpm and maybe submit to fedora.
Did you already do it or plan to do it? Otherwise we can.
Thanks for the great job.

Broken git-octopus

Hi,
I wanted to put git-octopus in a docker image, but it seems like it's broken
The dockerfile just does make install from alpine.

The dockerfile

FROM alpine:latest
RUN apk --update add make git

COPY . /tmp/octopus
RUN make -C /tmp/octopus install

WORKDIR /

ENTRYPOINT [ "git" ]

The error

fatal: 'octopus' appears to be a git command, but we were not
able to execute it. Maybe git-octopus is broken?

Need to create alias git-merge-index='git merge-index'

Bonjour,

Pour que git-octopus fonctionne correctement j'ai du créer un alias pour git-merge-index, sinon on a l'erreur :
line 90: git-merge-index: command not found

Est-il possible d'avoir une version sans avoir à créer cet alias ?

Merci d'avance,

Benoît

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.