B
B
bigtrouble2015-06-02 12:22:58
iOS
bigtrouble, 2015-06-02 12:22:58

How to prevent a merge "from" a specific branch?

I will omit the details of how we came to such a work scenario, I can only say that it justifies itself quite strongly.
In short - we have two main branches in the repo - test and default, the push happens to the subdomain (test.project.com) where the main branch is test, and there a hook is already configured that automatically pushes to the main domain (project.com), where is the main branch default.
The work is carried out in new branches for specific tasks, then we merge, if the task is not critical, then immediately with default, if something is large-scale, then we merge with the test, test, then merge the task branch (not the test) with the default.
At the moment, the merging of the task branch with the test, by default, is more of an observational character, because. there is no insurance against an error that some beginner will not merge the test with a default, and we ourselves may not watch it.
I would like to know - is it possible to put a ban on merging two branches (test and def) somehow? As well as put a ban on merging from the test branch to the task branch (so as not to accidentally drag everything test to your branch, and then from your branch to def)?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Aleksandr Govorukhin, 2018-07-30
@sportredwhite

I created 2 dynamic cells in TableView and on click added a custom cell below.

TableView
5b5efcca68b1c646755063.png5b5efd0a45f87893330570.png
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
        if (destinationData?[indexPath.row]) != nil {
            if(indexPath.row + 1 >= (destinationData?.count)!) {
                expandCell(tableView: tableView, index: indexPath.row)
            }
            else {
                if(destinationData?[indexPath.row+1] != nil) {
                    expandCell(tableView: tableView, index: indexPath.row)
                    // Close Cell (remove ExpansionCells)
                } else {
                    contractCell(tableView: tableView, index: indexPath.row)
                }
            }
        }
    }
    
    /*  Expand cell at given index  */
    private func expandCell(tableView: UITableView, index: Int) {
        if let infoMain = destinationData?[index]?.infoMain {
            var indexesToInsert = [IndexPath]()
            for i in 1...infoMain.count {
                destinationData?.insert(nil, at: index + 1)
                indexesToInsert.append(IndexPath(row: index + i, section: 0))
            }
            tableView.insertRows(at: indexesToInsert , with: .left)
            tableView.scrollToRow(at: IndexPath(row: index + 1, section: 0), at: .bottom, animated: true)
        }
    }
    
    /*  Contract cell at given index    */
    private func contractCell(tableView: UITableView, index: Int) {
        if let infoMain = destinationData?[index]?.infoMain {
            var indexesToDelete = [IndexPath]()
            for i in 1...infoMain.count {
                destinationData?.remove(at: index + 1)
                indexesToDelete.append(IndexPath(row: index + i, section: 0))
            }
            tableView.deleteRows(at: indexesToDelete, with: .left)
        }
    }

B
bigtrouble, 2015-06-04
@bigtrouble

hung a hook on precommit to compare branch names

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question