Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Group source code by course #9

Closed
ZijieKu opened this issue Aug 14, 2019 · 3 comments
Closed

Group source code by course #9

ZijieKu opened this issue Aug 14, 2019 · 3 comments

Comments

@ZijieKu
Copy link

ZijieKu commented Aug 14, 2019

Please group source codes by Courses.

repo
|-- Object-Oriented Data Structures in C++
| + ...
|-- Ordered Data Structure
| + ...
+- Unordered Data Structure
+ ...

Thank you.

@echuber2
Copy link
Collaborator

echuber2 commented Aug 14, 2019

We might be able to do this, but I'm not sure if we should, because it will no doubt upset or confuse some people who've already got a terminal window open to one of the nested directories when they do "git pull". We'll have to tell them to be sure to go to the root first:

cd `git rev-parse --show-toplevel`
git stash
git pull

We would also have to update a lot of the Makefiles to point to the correct relative path of the master makefile.

In the meantime, you can organize the folders for yourself while maintaining your links to the current locations using symlinks. For example, you could create a script make_course_links.sh in the top directory of the examples:

#!/bin/bash

EXAMPLES_TOP_DIR=$(git rev-parse --show-toplevel)
COURSE_1_SUBDIR=courses/cs-fundamentals-1
COURSE_2_SUBDIR=courses/cs-fundamentals-2
COURSE_3_SUBDIR=courses/cs-fundamentals-3

# go to top directory
cd ${EXAMPLES_TOP_DIR}

# make course directories for organization
mkdir -p ${EXAMPLES_TOP_DIR}/${COURSE_1_SUBDIR}
mkdir -p ${EXAMPLES_TOP_DIR}/${COURSE_2_SUBDIR}
mkdir -p ${EXAMPLES_TOP_DIR}/${COURSE_3_SUBDIR}

# make symbolic links to the examples underneath the course directories
ln -s ${EXAMPLES_TOP_DIR}/cpp-ctor ${EXAMPLES_TOP_DIR}/${COURSE_1_SUBDIR}/cpp-ctor
# ...
# ...

(You'd need to finish adding lines at the bottom to make links for all the examples you want.) Please be careful if you do this. Then you'd run the script like:

chmod +x make_course_links.sh
./make_course_links.sh

This has the benefit of leaving the existing directory structure in place for the sake of git updates.

@ZijieKu
Copy link
Author

ZijieKu commented Aug 14, 2019

Sure. Sounds good. Thanks!

@ZijieKu ZijieKu closed this as completed Aug 14, 2019
@BrianLDev
Copy link

I'll second this! Would be great to have the folders organized by section / course

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants