Описание рабочего процесса для использования мерзавца для внутренней разработки

Первый путь:

В Котлин мы можем создать простое расширение для вида:

fun View.getLocationOnScreen(): Point
{
    val location = IntArray(2)
    this.getLocationOnScreen(location)
    return Point(location[0],location[1])
}

И просто получить координаты:

val location = yourView.getLocationOnScreen()
val absX = location.x
val absY = location.y

Второй путь:

Второй способ более прост:

fun View.absX(): Int
{
    val location = IntArray(2)
    this.getLocationOnScreen(location)
    return location[0]
}

fun View.absY(): Int
{
    val location = IntArray(2)
    this.getLocationOnScreen(location)
    return location[1]
}

и просто получить абсолютный X с помощью view.absX() и Y на view.absY()

16
задан krosenvold 26 June 2009 в 15:57
поделиться

1 ответ

a logical explanation of the branch/merge structure

The structure basically follows what you said: an integration branch, and features branches.
In this kind of workflow, it is key to understand, as you did, that all development will not make it to the next release.
But with a DVCS, it is also key to understand a branch can be published and clone.

That last point (publication) will have a big influence on the merge commands , namely:

  • merge
  • rebase.

Whenever a developer has to merge his work on any integration branch (he pulled from a "central" repository), I would recommend:

# switch back to previous release tag (from where feature branches for next release where done)
$ git checkout previousReleaseTag
# create one's own private
$ git checkout -b myIntegrationBranch
# merge or cherry-pick what we want to actually put in the next release
$ git merge... from our feature branch
# rebase that private integration branch on top of actual integration branch
$ git rebase integrationBranch

The last rebase will rewrite the history of your local consolidations, but in a branch you will not publish anyway (so no harm done).
Once all your new features are working, you can merge back that private branch to the current HEAD of the relevant integration branch.

The "private branch - merge or cherry pick - rebase - local resolution - merge back" is a necessary workflow since several team will have to merge their work to a common branch. They need to replay what they want to publish in a private branch before merging it to the common branch, otherwise each team could break what is represented by the HEAD of the common branch.

Other details in the questions:

14
ответ дан 30 November 2019 в 22:55
поделиться
Другие вопросы по тегам:

Похожие вопросы: