Carl Worth [Tue, 7 Jul 2020 18:16:14 +0000 (11:16 -0700)]
Fix emacs hook to not clobber match data
Without this, trying to do a search-and-replace operation with emacs
on a file withing a directory that had some nogit-managed files would
error out after the first replacement with an error:
Carl Worth [Tue, 7 Jul 2020 00:59:22 +0000 (17:59 -0700)]
Add a "nogit log" command
Along with a simple pretty format to back it up (so that we can see
hash, author, and author date, and the diff itself, but not the commit
message which has no meaning in nogit land).
Carl Worth [Sun, 5 Jul 2020 18:47:24 +0000 (11:47 -0700)]
README: Simplify the setup instructions
Previously we were telling users to configure merge=union in
.gitattributes files. But nogit is now taking care of this itself, so
the setup instructions are now much simpler.
Carl Worth [Sun, 5 Jul 2020 18:41:04 +0000 (11:41 -0700)]
Provide the merge=union semantics we want through an info/attributes file
This is much cleaner than we were doing before, (where we requiring a
nogit repository to provide its own .giattribtues file with the
merge=union configuration).
This is also much cleaner than an approach we had been considering
which was to temporarily move away any .gitattributes file, replacing
it with our own for the time of "nogit sync", and then restoring it.
Here, we take advantage of the define git semantics that:
1. A clone does not bring down .git/info/attributes so we are
guaranteed to be safe to provide our own content here.
2. The content we provide in .git/info/attributes overrides anything
set in any .gitattributes files so we can be confident that our
configuration here will apply in all cases.
Carl Worth [Sun, 5 Jul 2020 18:11:37 +0000 (11:11 -0700)]
Look for a pre-existing .nogit-tmp directory
Just to be extra careful, force the user to clean up any remnant of a
previously-aborted run before we dive in again with potentially
unintended consquences.
Carl Worth [Sun, 5 Jul 2020 18:10:15 +0000 (11:10 -0700)]
Fix an accidental case of a ".nogit" literal
We have the NOGIT_DIR variable to hold the ".nogit" string. Repeating
the string in the error message here set up some fragility if the
variable's value were ever to change in the future.
Carl Worth [Sun, 5 Jul 2020 18:07:49 +0000 (11:07 -0700)]
Use consistent indentation for case statement
I would actually prefer the ';;' to be out to the left, (to make it
more clear if these were ever missing), but emacs wants to indent this
and I'm not going to fight it here.
Carl Worth [Sun, 5 Jul 2020 05:58:25 +0000 (22:58 -0700)]
Provide a simple implementation of "nogit sync"
There's one piece of this that requires a cooperating
repository. Specifically, nogit really wants a merge with no input
required from the user. The "union" merge driver does what we want
here, (putting lines from both sides into the files without conflict
markers). The only trick is that there's no way (that I've found at
least) to request this merge driver from the command line of the "git
merge" invocation. Instead, we need a .gitattributes file to specify
"merge=union".
So, for now, we're relying on the repository being used with nogit to
provide a working .gitattributes file that specifies "merge=union" for
all appropriate paths.
Carl Worth [Sat, 4 Jul 2020 22:19:09 +0000 (15:19 -0700)]
Add a simple README for nogit
This provides the motivation for nogit. It doesn't yet describe the
implementation or how to use it, but that's only because the
implementation doesn't exist yet, so we'll have to bring that into
existence before we can describe it.