]> git.cworth.org Git - nogit/log
nogit
3 years agoFix emacs hook to not clobber match data master
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:

Match data clobbered by buffer modification hook

3 years agoAdd a "nogit log" command
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).

3 years agoFix two english sentence typos
Kevin Worth [Mon, 6 Jul 2020 12:21:35 +0000 (08:21 -0400)]
Fix two english sentence typos

Nothing else to say here. But I'm told that by at least saying
*something* so I'll be a much better developer... or something along
those lines. ;-P

3 years agoREADME: Simplify the setup instructions
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.

3 years agoProvide the merge=union semantics we want through an info/attributes file
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.

3 years agoREADME: Add more description about the kind of data that nogit is suitable for
Carl Worth [Sun, 5 Jul 2020 18:24:11 +0000 (11:24 -0700)]
README: Add more description about the kind of data that nogit is suitable for

It's a bit of an odd use case, so it takes a fair amount of text to
capture it.

3 years agoAdd code for integrating nogit with emacs
Carl Worth [Sun, 5 Jul 2020 18:23:32 +0000 (11:23 -0700)]
Add code for integrating nogit with emacs

With hooks for invoking "nogit sync" whenever a nogit-controlled file
is opened, edited, or saved.

3 years agoLook for a pre-existing .nogit-tmp directory
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.

3 years agoFix an accidental case of a ".nogit" literal
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.

3 years agoAdd a NOGIT_DIR_TMP variable
Carl Worth [Sun, 5 Jul 2020 18:09:08 +0000 (11:09 -0700)]
Add a NOGIT_DIR_TMP variable

Rather than repeating the "-tmp" literally throughout the code.

3 years agoUse consistent indentation for case statement
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.

3 years agoREADME: Augment the tagline just a bit
Carl Worth [Sun, 5 Jul 2020 06:58:29 +0000 (23:58 -0700)]
README: Augment the tagline just a bit

To make it a little more clear that nogit uses git but the user of
nogit won't be interacting with git directly.

3 years agoREADME: Expand on the documentation for nogit
Carl Worth [Sun, 5 Jul 2020 06:56:18 +0000 (23:56 -0700)]
README: Expand on the documentation for nogit

Providing more details on how to get setup with an existing
nogit-tracked repository or even how to create a new one.

3 years agoProvide a simple implementation of "nogit sync"
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.

3 years agoImplement "nogit clone"
Carl Worth [Sun, 5 Jul 2020 05:44:09 +0000 (22:44 -0700)]
Implement "nogit clone"

This is logically just a git clone with the following two differences:

  1. It works in the current directory instead of making a new directory

  2. It puts its object store into .nogit instead of .git, (and it's just
     fine if there's already a .git here).

There are safety checks and it will refuse to clone in either of the
following cases:

  1. There is already a .nogit directory present

  2. Any of the working-tree files to be cloned already exist

3 years agoAdd a nogit command-line utility
Carl Worth [Sun, 5 Jul 2020 05:09:21 +0000 (22:09 -0700)]
Add a nogit command-line utility

This captures the structure of the two basic commands:

nogit clone <URL>
        nogit sync

Along with "nogit help" for help on the above.

There's no implementation for either command yet. Just the
documentation so far.

3 years agoAdd a simple README for nogit
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.