emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] little fixes for attachment git commiting
@ 2010-02-16 19:04 Łukasz Stelmach
  2010-02-16 20:25 ` David Maus
  2010-02-19  8:46 ` Carsten Dominik
  0 siblings, 2 replies; 11+ messages in thread
From: Łukasz Stelmach @ 2010-02-16 19:04 UTC (permalink / raw)
  To: emacs-orgmode

Hello.

There are two very small commits which iron some wrinkles. Both on 
org-attach-git-commit branch of
git://github.com/steelman/steelman-org-mode.git

The first prevents git from running on an empty set of deleted files.

http://github.com/steelman/steelman-org-mode/commit/8dc5033d13af1d0aa6f1094a1775cc1a1ec33c67

The other one helps if for some reason the file one would like to add
matches an entry in a .gitignore file. I suppose no one puts anything in
the org-attach-directory by hand, so anything that goes there is by
intention.

http://github.com/steelman/steelman-org-mode/commit/8ade081fd5a331cc61f8f8a6f8cf5a92ff8881d5

Just my 2 cents (Euro ones ;)
-- 
Miłego dnia,
Łukasz Stelmach

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] little fixes for attachment git commiting
  2010-02-16 19:04 [PATCH] little fixes for attachment git commiting Łukasz Stelmach
@ 2010-02-16 20:25 ` David Maus
  2010-02-16 21:33   ` Łukasz Stelmach
  2010-02-19  8:46 ` Carsten Dominik
  1 sibling, 1 reply; 11+ messages in thread
From: David Maus @ 2010-02-16 20:25 UTC (permalink / raw)
  To: Łukasz Stelmach; +Cc: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 738 bytes --]

Łukasz Stelmach wrote:
>Hello.

>The other one helps if for some reason the file one would like to add
>matches an entry in a .gitignore file. I suppose no one puts anything in
>the org-attach-directory by hand, so anything that goes there is by
>intention.

>http://github.com/steelman/steelman-org-mode/commit/8ade081fd5a331cc61f8f8a6f8cf5a92ff8881d5

I'd like to be this customizable: I do have LaTeX files as attachments
and don't want the logs etc. be added to the git repository.  In
addition one might explicitly include the content of attachment
directories using the negating operator in .gitignore.

 -- David

-- 
OpenPGP... 0x99ADB83B5A4478E6
Jabber.... dmjena@jabber.org
Email..... maus.david@gmail.com

[-- Attachment #1.2: Type: application/pgp-signature, Size: 230 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] little fixes for attachment git commiting
  2010-02-16 20:25 ` David Maus
@ 2010-02-16 21:33   ` Łukasz Stelmach
  2010-02-17  8:04     ` David Maus
  0 siblings, 1 reply; 11+ messages in thread
From: Łukasz Stelmach @ 2010-02-16 21:33 UTC (permalink / raw)
  To: emacs-orgmode

David Maus <maus.david@gmail.com> writes:

> Łukasz Stelmach wrote:
>>The other one helps if for some reason the file one would like to add
>>matches an entry in a .gitignore file. I suppose no one puts anything in
>>the org-attach-directory by hand, so anything that goes there is by
>>intention.
>>http://github.com/steelman/steelman-org-mode/commit/8ade081fd5a331cc61f8f8a6f8cf5a92ff8881d5
>
> I'd like to be this customizable: I do have LaTeX files as attachments
> and don't want the logs etc. be added to the git repository.

Do they get created org-attach-directory?

> In addition one might explicitly include the content of attachment
> directories using the negating operator in .gitignore.

This might be a better solution indeed.

I'll investigate it a little bit closer.

-- 
Miłego dnia,
Łukasz Stelmach

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Re: [PATCH] little fixes for attachment git commiting
  2010-02-16 21:33   ` Łukasz Stelmach
@ 2010-02-17  8:04     ` David Maus
  2010-02-17 11:09       ` Łukasz Stelmach
  0 siblings, 1 reply; 11+ messages in thread
From: David Maus @ 2010-02-17  8:04 UTC (permalink / raw)
  To: Łukasz Stelmach; +Cc: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 1648 bytes --]

Łukasz Stelmach wrote:
>David Maus <maus.david@gmail.com> writes:

>> Łukasz Stelmach wrote:
>>>The other one helps if for some reason the file one would like to add
>>>matches an entry in a .gitignore file. I suppose no one puts anything in
>>>the org-attach-directory by hand, so anything that goes there is by
>>>intention.
>>>http://github.com/steelman/steelman-org-mode/commit/8ade081fd5a331cc61f8f8a6f8cf5a92ff8881d5
>>
>> I'd like to be this customizable: I do have LaTeX files as attachments
>> and don't want the logs etc. be added to the git repository.

>Do they get created org-attach-directory?

Yes, they do.

>> In addition one might explicitly include the content of attachment
>> directories using the negating operator in .gitignore.
>This might be a better solution indeed.

Yep.  Though about it: Using the -f switch overrides any configuration
of git a user may have made in a system wide, user or repository
specific gitignore -- that shouldn't be turned on by default or even
enforced in the source.

>I'll investigate it a little bit closer.

Just an idea: Why not add hooks that are called after certain
attachment operations (add, remove, update)?  This way we could
decouple a (specific) use of git or even of git itself.

Some other thing: As far as I understood the source an error while
synchronizing the attachment directory is indiciated in the "*Shell
Command Output*" buffer and the miniprompt.  I'm not sure if this
should be considered sufficient or not.

HTH
 -- David

-- 
OpenPGP... 0x99ADB83B5A4478E6
Jabber.... dmjena@jabber.org
Email..... maus.david@gmail.com

[-- Attachment #1.2: Type: application/pgp-signature, Size: 230 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] little fixes for attachment git commiting
  2010-02-17  8:04     ` David Maus
@ 2010-02-17 11:09       ` Łukasz Stelmach
  2010-02-18 20:11         ` David Maus
  0 siblings, 1 reply; 11+ messages in thread
From: Łukasz Stelmach @ 2010-02-17 11:09 UTC (permalink / raw)
  To: emacs-orgmode

David Maus <maus.david@gmail.com> writes:

> Łukasz Stelmach wrote:
>>David Maus <maus.david@gmail.com> writes:
>
>>> Łukasz Stelmach wrote:
>>>>The other one helps if for some reason the file one would like to add
>>>>matches an entry in a .gitignore file. I suppose no one puts anything in
>>>>the org-attach-directory by hand, so anything that goes there is by
>>>>intention.
>>>>http://github.com/steelman/steelman-org-mode/commit/8ade081fd5a331cc61f8f8a6f8cf5a92ff8881d5
>>>
[...]
>>> In addition one might explicitly include the content of attachment
>>> directories using the negating operator in .gitignore.
>>This might be a better solution indeed.
>
> Yep.  Though about it: Using the -f switch overrides any configuration
> of git a user may have made in a system wide, user or repository
> specific gitignore -- that shouldn't be turned on by default or even
> enforced in the source.

You're right, I admit. Please forget this commit. Take only the one
about xargs --no-run-if-empty

http://github.com/steelman/steelman-org-mode/commit/8dc5033d13af1d0aa6f1094a1775cc1a1ec33c67

>>I'll investigate it a little bit closer.
>
> Just an idea: Why not add hooks that are called after certain
> attachment operations (add, remove, update)?  This way we could
> decouple a (specific) use of git or even of git itself.

That's a little more hacking that I'd like to do now. Anyone?

> Some other thing: As far as I understood the source an error while
> synchronizing the attachment directory is indiciated in the "*Shell
> Command Output*" buffer and the miniprompt.  I'm not sure if this
> should be considered sufficient or not.

It's been enough for me to start investigating. It depends on how
userfriendly orgmode is supposed to be.
-- 
Miłego dnia,
Łukasz Stelmach

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Re: [PATCH] little fixes for attachment git commiting
  2010-02-17 11:09       ` Łukasz Stelmach
@ 2010-02-18 20:11         ` David Maus
  0 siblings, 0 replies; 11+ messages in thread
From: David Maus @ 2010-02-18 20:11 UTC (permalink / raw)
  To: Łukasz Stelmach; +Cc: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 1477 bytes --]

Łukasz Stelmach wrote:
>David Maus <maus.david@gmail.com> writes:

>> Łukasz Stelmach wrote:
>>>David Maus <maus.david@gmail.com> writes:
>>
>>>> Łukasz Stelmach wrote:
>>>>>The other one helps if for some reason the file one would like to add
>>>>>matches an entry in a .gitignore file. I suppose no one puts anything in
>>>>>the org-attach-directory by hand, so anything that goes there is by
>>>>>intention.
>>>>>http://github.com/steelman/steelman-org-mode/commit/8ade081fd5a331cc61f8f8a6f8cf5a92ff8881d5
>>>>
>[...]
>>>> In addition one might explicitly include the content of attachment
>>>> directories using the negating operator in .gitignore.
>>>This might be a better solution indeed.
>>
>> Yep.  Though about it: Using the -f switch overrides any configuration
>> of git a user may have made in a system wide, user or repository
>> specific gitignore -- that shouldn't be turned on by default or even
>> enforced in the source.

>You're right, I admit. Please forget this commit. Take only the one
>about xargs --no-run-if-empty

>http://github.com/steelman/steelman-org-mode/commit/8dc5033d13af1d0aa6f1094a1775cc1a1ec33c67

Looks good to me.  It handles the case when "git ls-files --deleted
-z" returns an empty string (nothing to delete) that is currently
handled by rm silently issuing an error message.

Regards
 -- David

-- 
OpenPGP... 0x99ADB83B5A4478E6
Jabber.... dmjena@jabber.org
Email..... maus.david@gmail.com

[-- Attachment #1.2: Type: application/pgp-signature, Size: 230 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] little fixes for attachment git commiting
  2010-02-16 19:04 [PATCH] little fixes for attachment git commiting Łukasz Stelmach
  2010-02-16 20:25 ` David Maus
@ 2010-02-19  8:46 ` Carsten Dominik
  2010-02-19 10:59   ` Łukasz Stelmach
  1 sibling, 1 reply; 11+ messages in thread
From: Carsten Dominik @ 2010-02-19  8:46 UTC (permalink / raw)
  To: Łukasz Stelmach; +Cc: emacs-orgmode


On Feb 16, 2010, at 8:04 PM, Łukasz Stelmach wrote:

> Hello.
>
> There are two very small commits which iron some wrinkles. Both on
> org-attach-git-commit branch of
> git://github.com/steelman/steelman-org-mode.git
>
> The first prevents git from running on an empty set of deleted files.

Why is that a problem?  I am hesitating to apply this patch, because
on my Mac OS 10.5, xargs does know the --no-run-if-empty argument.

- Carsten

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] little fixes for attachment git commiting
  2010-02-19  8:46 ` Carsten Dominik
@ 2010-02-19 10:59   ` Łukasz Stelmach
  2010-02-19 11:03     ` Carsten Dominik
  0 siblings, 1 reply; 11+ messages in thread
From: Łukasz Stelmach @ 2010-02-19 10:59 UTC (permalink / raw)
  To: emacs-orgmode

Carsten Dominik <carsten.dominik@gmail.com> writes:

> On Feb 16, 2010, at 8:04 PM, Łukasz Stelmach wrote:
>
>> There are two very small commits which iron some wrinkles. Both on
>> org-attach-git-commit branch of
>> git://github.com/steelman/steelman-org-mode.git
>>
>> The first prevents git from running on an empty set of deleted files.
>
> Why is that a problem?  I am hesitating to apply this patch, because
> on my Mac OS 10.5, xargs does know the --no-run-if-empty argument.
                           ^^^^^^^^^[*]

When xargs launches git rm without file arguments git emmits usage

--8<---------------cut here---------------start------------->8---
usage: git rm [options] [--] <file>...

    -n, --dry-run         dry run
    -q, --quiet           be quiet
    --cached              only remove from the index
    -f, --force           override the up-to-date check
    -r                    allow recursive removal
    --ignore-unmatch      exit with a zero status even if nothing
    -matched
--8<---------------cut here---------------end--------------->8---

message which in this situation is a bit confusing and *suggests*
somehting might have gone wrong. And of course a shell output buffer
pops up.

[*] does || doesn't?

-- 
Miłego dnia,
Łukasz Stelmach

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Re: [PATCH] little fixes for attachment git commiting
  2010-02-19 10:59   ` Łukasz Stelmach
@ 2010-02-19 11:03     ` Carsten Dominik
  2010-02-19 11:51       ` Łukasz Stelmach
  0 siblings, 1 reply; 11+ messages in thread
From: Carsten Dominik @ 2010-02-19 11:03 UTC (permalink / raw)
  To: Łukasz Stelmach; +Cc: emacs-orgmode


On Feb 19, 2010, at 11:59 AM, Łukasz Stelmach wrote:

> Carsten Dominik <carsten.dominik@gmail.com> writes:
>
>> On Feb 16, 2010, at 8:04 PM, Łukasz Stelmach wrote:
>>
>>> There are two very small commits which iron some wrinkles. Both on
>>> org-attach-git-commit branch of
>>> git://github.com/steelman/steelman-org-mode.git
>>>
>>> The first prevents git from running on an empty set of deleted  
>>> files.
>>
>> Why is that a problem?  I am hesitating to apply this patch, because
>> on my Mac OS 10.5, xargs does know the --no-run-if-empty argument.
>                           ^^^^^^^^^[*]
>
> When xargs launches git rm without file arguments git emmits usage
>
> --8<---------------cut here---------------start------------->8---
> usage: git rm [options] [--] <file>...
>
>    -n, --dry-run         dry run
>    -q, --quiet           be quiet
>    --cached              only remove from the index
>    -f, --force           override the up-to-date check
>    -r                    allow recursive removal
>    --ignore-unmatch      exit with a zero status even if nothing
>    -matched
> --8<---------------cut here---------------end--------------->8---
>
> message which in this situation is a bit confusing and *suggests*
> somehting might have gone wrong. And of course a shell output buffer
> pops up.
>
> [*] does || doesn't?

Does not.

Do you actually get to see this error message?  Where?

- Carsten

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] little fixes for attachment git commiting
  2010-02-19 11:03     ` Carsten Dominik
@ 2010-02-19 11:51       ` Łukasz Stelmach
  2010-03-09 16:04         ` Carsten Dominik
  0 siblings, 1 reply; 11+ messages in thread
From: Łukasz Stelmach @ 2010-02-19 11:51 UTC (permalink / raw)
  To: emacs-orgmode

Carsten Dominik <carsten.dominik@gmail.com> writes:

> On Feb 19, 2010, at 11:59 AM, Łukasz Stelmach wrote:
>
>> Carsten Dominik <carsten.dominik@gmail.com> writes:
>>
>>> On Feb 16, 2010, at 8:04 PM, Łukasz Stelmach wrote:
>>>
>>>> There are two very small commits which iron some wrinkles. Both on
>>>> org-attach-git-commit branch of
>>>> git://github.com/steelman/steelman-org-mode.git
>>>>
>>>> The first prevents git from running on an empty set of deleted
>>>> files.
>>>
>>> Why is that a problem?  I am hesitating to apply this patch, because
>>> on my Mac OS 10.5, xargs does know the --no-run-if-empty argument.
>>                           ^^^^^^^^^[*]
>>
>> When xargs launches git rm without file arguments git emmits usage
>>
>> --8<---------------cut here---------------start------------->8---
>> usage: git rm [options] [--] <file>...
[...]
>> --8<---------------cut here---------------end--------------->8---
>>
>> message which in this situation is a bit confusing and *suggests*
>> somehting might have gone wrong. And of course a shell output buffer
>> pops up.
>>
>> [*] does || doesn't?
>
> Does not.
>
> Do you actually get to see this error message?  Where?

Everytime I attach a file and there is no deleted files which "git
ls-files --deleted" would list.  Try running

git ls-files --deleted -z | xargs -0 git rm

when there is no deleted uncommited files in a repository. git's return
code is 123 so Emacs thinks it is an error.


-- 
Miłego dnia,
Łukasz Stelmach

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Re: [PATCH] little fixes for attachment git commiting
  2010-02-19 11:51       ` Łukasz Stelmach
@ 2010-03-09 16:04         ` Carsten Dominik
  0 siblings, 0 replies; 11+ messages in thread
From: Carsten Dominik @ 2010-03-09 16:04 UTC (permalink / raw)
  To: Łukasz Stelmach; +Cc: emacs-orgmode


On Feb 19, 2010, at 12:51 PM, Łukasz Stelmach wrote:

> Carsten Dominik <carsten.dominik@gmail.com> writes:
>
>> On Feb 19, 2010, at 11:59 AM, Łukasz Stelmach wrote:
>>
>>> Carsten Dominik <carsten.dominik@gmail.com> writes:
>>>
>>>> On Feb 16, 2010, at 8:04 PM, Łukasz Stelmach wrote:
>>>>
>>>>> There are two very small commits which iron some wrinkles. Both on
>>>>> org-attach-git-commit branch of
>>>>> git://github.com/steelman/steelman-org-mode.git
>>>>>
>>>>> The first prevents git from running on an empty set of deleted
>>>>> files.
>>>>
>>>> Why is that a problem?  I am hesitating to apply this patch,  
>>>> because
>>>> on my Mac OS 10.5, xargs does know the --no-run-if-empty argument.
>>>                          ^^^^^^^^^[*]
>>>
>>> When xargs launches git rm without file arguments git emmits usage
>>>
>>> --8<---------------cut here---------------start------------->8---
>>> usage: git rm [options] [--] <file>...
> [...]
>>> --8<---------------cut here---------------end--------------->8---
>>>
>>> message which in this situation is a bit confusing and *suggests*
>>> somehting might have gone wrong. And of course a shell output buffer
>>> pops up.
>>>
>>> [*] does || doesn't?
>>
>> Does not.
>>
>> Do you actually get to see this error message?  Where?
>
> Everytime I attach a file and there is no deleted files which "git
> ls-files --deleted" would list.  Try running
>
> git ls-files --deleted -z | xargs -0 git rm
>
> when there is no deleted uncommited files in a repository. git's  
> return
> code is 123 so Emacs thinks it is an error.

Hi Lukasz,

I am not applying the patch, because xargs does not work te same on  
all systems.

- Carsten


>
>
> -- 
> Miłego dnia,
> Łukasz Stelmach
>
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

- Carsten

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2010-03-09 17:01 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-16 19:04 [PATCH] little fixes for attachment git commiting Łukasz Stelmach
2010-02-16 20:25 ` David Maus
2010-02-16 21:33   ` Łukasz Stelmach
2010-02-17  8:04     ` David Maus
2010-02-17 11:09       ` Łukasz Stelmach
2010-02-18 20:11         ` David Maus
2010-02-19  8:46 ` Carsten Dominik
2010-02-19 10:59   ` Łukasz Stelmach
2010-02-19 11:03     ` Carsten Dominik
2010-02-19 11:51       ` Łukasz Stelmach
2010-03-09 16:04         ` Carsten Dominik

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).