Skip to content

WIP: Add explicit `--fetch` flag to bst commands

Gökçen Nurlu requested to merge gokcen/no_auto_fetch into master

Description

This introduces a new flag --fetch that was mentioned in the mailing list.

Proposed changes

To put simply, this changes the following commands' behaviour so they'd not try to implicitly fetch junctions and elements (offline-first?).

  • bst {pull,push,track,checkout} element(s) command

    • Before: Fetches the junction(s) if they are used and not cached yet.
    • After: Don't do junction fetch implicitly. In case one is needed, error out by saying need to fetch junction. --fetch is supplied to fetch_subprojects.
  • bst source-bundle element command

    • Before: (Possibly track and) fetch implicitly.
    • After: Now we have 4 combinations in total (--fetch and --track)
      • Only --track: Attempt track elements, error out if there is a new ref (since no --fetch supplied, continue if there is nothing new.
      • Only --fetch: Fetch current refs for elements (including related junctions) - they might be cached already.
      • --fetch and --track: Previous behaviour of the command with --track, track for new refs if possible and fetch them.
      • No flags: error out if the current refs are not cached.
  • bst {workspace-open,workspace-reset} element.bst .. We are interested in the cases where no_checkout is NOT used.

    • Before: Error out if junction(s) are required but not cached yet. Fetch for element is always done. Track before fetch can be requested using --track.
    • After: Now we have 4 combinations in total (--fetch and --track)
      • Only --track: Attempt track elements, error out if there is a new ref (since no --fetch supplied, continue if there is nothing new.
      • Only --fetch: Fetch current refs for elements (including related junctions) - they might be cached already.
      • --fetch and --track: Previous behaviour of the command with --track, track for new refs if possible and fetch them.
      • No flags: error out if the current refs are not cached.

You can notice that the original behaviour of workspace commands are almost equivalent to source-bundle, except the latter implicitly fetches junctions where the former complains and terminates.

This merge request, when approved, will close: N/A at the moment.


Edited by Gökçen Nurlu

Merge request reports