Skip to content

Inconsistency between git origin/HEAD/Fetching

When given a URL and leaving out the checkout argument,

On the CLI, git checkout HEAD is used. But for individual subsystems in the .cfg file, git checkout origin/HEAD is used. Also inconsistent is the behavior for a directory name as the CLI argument.

Do I want all subsystems to stay stale or do I want to force the system to keep up with origin? Probably the latter.

I would also like to integrate the behavior for when you specify just a directory on the CLI: a fast-forward-only pull is done, if possible (Keeping everything up-to-date), but that only happens if the current branch has an upstream branch.

I believed that this was incompatible with having a checkout argument, but now, I think that if we do this pull ff-only thing when checkout is unspecified, it will be the best of both worlds. I'd still have support for using origin/HEAD as the checkout argument, for aaoBuildSetAllLast, but that's slightly different from a ff-only pull:

  • If the curren t HEAD has commits that aren't in a branch, you could loose said commits (salvageable from reflog) when you specify origin/HEAD, but a ff-only pull would fail.
  • ff-only pull sticks to the current branch, origin/HEAD can switch branches
  • The advantage of ff-only pull is that the current repository might be on a branch that you want to keep it on.