CARRY: Fix fresh repo sync#24
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
| awk ' | ||
| NR == 1 { | ||
| prev_line_start_with_caret = 0 | ||
| } | ||
| /^[^^]/ { | ||
| prev_line_start_with_caret = 0 |
There was a problem hiding this comment.
This looks like we are adding whitespace in front of the awk instructions each line. Will awk not be confused by that? Should it be
| awk ' | |
| NR == 1 { | |
| prev_line_start_with_caret = 0 | |
| } | |
| /^[^^]/ { | |
| prev_line_start_with_caret = 0 | |
| awk ' | |
| NR == 1 { | |
| prev_line_start_with_caret = 0 | |
| } | |
| /^[^^]/ { | |
| prev_line_start_with_caret = 0 |
... etc?
Awk should not care about this, as it cares about what's between ''. Some test script I used to test this. This does not happen in upstream (I assume this) as upstream never starts with a bare/empty repo? They do the initial sync by hand, for example, here: https://github.com/kubernetes/streaming/commits/master/ If you come up with a different fix to this, without touching https://github.com/kcp-dev/virtual-workspace-framework and making it not empty - sure, lets close it :) |
|
As an update for the future if we ever run into this again: the target repo must have an initial empty commit, with special emphasis on empty (no files, just commit). In this case, the repo had no commits and publishing-bot failed. This is kind of a safeguard against this, among other things. |
|
Here's an example from upstream from the staging repo that MJ linked above: kubernetes/streaming@6759320 And from one of our repos: kcp-dev/virtual-workspace-framework@3d2afca |
Attempt to fix publishing bot
This happens when processing the virtual-workspace-framework repo on the main branch. The script in construct.sh (via util.sh) tries to clean up .git/packed-refs by copying it to a backup, filtering it with awk, and replacing it. But .git/packed-refs doesn't exist in this repo's git directory.