You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Andres de la Peña (Jira)" <ji...@apache.org> on 2022/10/27 11:21:00 UTC

[jira] [Comment Edited] (CASSANDRA-17997) Improve git branch handling for CircleCI generate.sh

    [ https://issues.apache.org/jira/browse/CASSANDRA-17997?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17625045#comment-17625045 ] 

Andres de la Peña edited comment on CASSANDRA-17997 at 10/27/22 11:20 AM:
--------------------------------------------------------------------------

I guess the default for {{BASE_BRANCH}} could also be a bit more clever. If there isn't a -b option and the local base branch doesn't exist, we could look into the list of remotes to see if there is a remote for the ASF repo. In that case, we could use that remote in {{BASE_BRANCH}}. For example, {{BASE_BRANCH=apache/cassandra-3.11}}, or {{BASE_BRANCH=ASF/cassandra-3.11}}, or however the remote has been named by the user. If there isn't such remote, nor a local base branch, nor a -b option, then we would graciously fail asking to either add the remote or use -b option. wdyt?

What I wouldn't do however is trying to get the base branch from the user's private remote fork. If the project hasn't been recently forked, it is likely that the remote base branch on the fork is very outdated.


was (Author: adelapena):
I guess the default for {{BASE_BRANCH}} could also be a bit more clever. If there isn't a -b option and the local base branch doesn't exist, we could look into the list of remotes to see if there is a remote for the ASF repo. In that case, we could use that remote in {{BASE_BRANCH}}. For example, {{BASE_BRANCH=apache/cassandra-3.11}}, or {{BASE_BRANCH=ASF/cassandra-3.11}}, or however the remote has been named by the user. If there isn't such remote, nor a local base branch, nor a -b option, then we would gracious fail asking to either add the remote or use -b option. wdyt?

What I wouldn't do however is trying to get the base branch from the user's private remote fork. If the project hasn't been recently forked, it is likely that the remote base branch on the fork is very outdated.

> Improve git branch handling for CircleCI generate.sh
> ----------------------------------------------------
>
>                 Key: CASSANDRA-17997
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-17997
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: CI
>            Reporter: Derek Chen-Becker
>            Assignee: Derek Chen-Becker
>            Priority: Normal
>
> The generate.sh script assumes a base git branch that is local and named after the official repo branch (e.g. `cassandra-3.11`). This may not be a local branch if the developer has recently cloned the repo and is creating a work branch, and will lead to the git commands in generate.sh failing:
>  
> ```
> fatal: ambiguous argument 'cassandra-3.11...HEAD': unknown revision or path not in the working tree.
> Use '--' to separate paths from revisions, like this:
> 'git <command> [<revision>...] -- [<file>...]'
> ```
> We should be able to make some sanity checks to better guide or warn the developer if things aren't set up properly to check against git.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org